Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f506604d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f506604d
编写于
5月 11, 2022
作者:
D
dapan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stmt auto create table
上级
68f1ede8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
14 deletion
+31
-14
include/libs/parser/parser.h
include/libs/parser/parser.h
+1
-1
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+19
-6
source/libs/parser/src/parInsertData.c
source/libs/parser/src/parInsertData.c
+4
-1
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+7
-6
未找到文件。
include/libs/parser/parser.h
浏览文件 @
f506604d
...
...
@@ -58,7 +58,7 @@ int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash
int32_t
qResetStmtDataBlock
(
void
*
block
,
bool
keepBuf
);
int32_t
qCloneStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
);
void
qFreeStmtDataBlock
(
void
*
pDataBlock
);
int32_t
qRebuildStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
,
uint64_t
uid
);
int32_t
qRebuildStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
,
uint64_t
uid
,
int32_t
vgId
);
void
qDestroyStmtDataBlock
(
void
*
pBlock
);
STableMeta
*
qGetTableMetaInDataBlock
(
void
*
pDataBlock
);
...
...
source/client/src/clientStmt.c
浏览文件 @
f506604d
...
...
@@ -321,6 +321,18 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
stmtRebuildDataBlock
(
STscStmt
*
pStmt
,
STableDataBlocks
*
pDataBlock
,
STableDataBlocks
**
newBlock
,
uint64_t
uid
)
{
SEpSet
ep
=
getEpSet_s
(
&
pStmt
->
taos
->
pAppInfo
->
mgmtEp
);
SVgroupInfo
vgInfo
=
{
0
};
STMT_ERR_RET
(
catalogGetTableHashVgroup
(
pStmt
->
pCatalog
,
pStmt
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pStmt
->
bInfo
.
sname
,
&
vgInfo
));
STMT_ERR_RET
(
taosHashPut
(
pStmt
->
exec
.
pVgHash
,
(
const
char
*
)
&
vgInfo
.
vgId
,
sizeof
(
vgInfo
.
vgId
),
(
char
*
)
&
vgInfo
,
sizeof
(
vgInfo
)));
STMT_ERR_RET
(
qRebuildStmtDataBlock
(
newBlock
,
pDataBlock
,
uid
,
vgInfo
.
vgId
));
return
TSDB_CODE_SUCCESS
;
}
int32_t
stmtGetFromCache
(
STscStmt
*
pStmt
)
{
pStmt
->
bInfo
.
needParse
=
true
;
pStmt
->
bInfo
.
inExecCache
=
false
;
...
...
@@ -344,14 +356,18 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
return
TSDB_CODE_SUCCESS
;
}
if
(
NULL
==
pStmt
->
pCatalog
)
{
STMT_ERR_RET
(
catalogGetHandle
(
pStmt
->
taos
->
pAppInfo
->
clusterId
,
&
pStmt
->
pCatalog
));
}
if
(
pStmt
->
sql
.
autoCreateTbl
)
{
SStmtTableCache
*
pCache
=
taosHashGet
(
pStmt
->
sql
.
pTableCache
,
&
pStmt
->
bInfo
.
tbSuid
,
sizeof
(
pStmt
->
bInfo
.
tbSuid
));
if
(
pCache
)
{
pStmt
->
bInfo
.
needParse
=
false
;
STableDataBlocks
*
pNewBlock
=
NULL
;
STMT_ERR_RET
(
qRebuildStmtDataBlock
(
&
pNewBlock
,
pCache
->
pData
Block
,
0
));
STMT_ERR_RET
(
stmtRebuildDataBlock
(
pStmt
,
pCache
->
pDataBlock
,
&
pNew
Block
,
0
));
if
(
taosHashPut
(
pStmt
->
exec
.
pBlockHash
,
pStmt
->
bInfo
.
tbFName
,
strlen
(
pStmt
->
bInfo
.
tbFName
),
&
pNewBlock
,
POINTER_BYTES
))
{
STMT_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
...
...
@@ -362,9 +378,6 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
STMT_RET
(
stmtCleanBindInfo
(
pStmt
));
}
if
(
NULL
==
pStmt
->
pCatalog
)
{
STMT_ERR_RET
(
catalogGetHandle
(
pStmt
->
taos
->
pAppInfo
->
clusterId
,
&
pStmt
->
pCatalog
));
}
STableMeta
*
pTableMeta
=
NULL
;
SEpSet
ep
=
getEpSet_s
(
&
pStmt
->
taos
->
pAppInfo
->
mgmtEp
);
...
...
@@ -419,7 +432,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
pStmt
->
bInfo
.
tagsCached
=
true
;
STableDataBlocks
*
pNewBlock
=
NULL
;
STMT_ERR_RET
(
qRebuildStmtDataBlock
(
&
pNewBlock
,
pCache
->
pData
Block
,
uid
));
STMT_ERR_RET
(
stmtRebuildDataBlock
(
pStmt
,
pCache
->
pDataBlock
,
&
pNew
Block
,
uid
));
if
(
taosHashPut
(
pStmt
->
exec
.
pBlockHash
,
pStmt
->
bInfo
.
tbFName
,
strlen
(
pStmt
->
bInfo
.
tbFName
),
&
pNewBlock
,
POINTER_BYTES
))
{
STMT_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
...
...
source/libs/parser/src/parInsertData.c
浏览文件 @
f506604d
...
...
@@ -620,7 +620,7 @@ int32_t qCloneStmtDataBlock(void** pDst, void* pSrc) {
return
qResetStmtDataBlock
(
*
pDst
,
false
);
}
int32_t
qRebuildStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
,
uint64_t
uid
)
{
int32_t
qRebuildStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
,
uint64_t
uid
,
int32_t
vgId
)
{
int32_t
code
=
qCloneStmtDataBlock
(
pDst
,
pSrc
);
if
(
code
)
{
return
code
;
...
...
@@ -633,8 +633,11 @@ int32_t qRebuildStmtDataBlock(void** pDst, void* pSrc, uint64_t uid) {
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pBlock
->
vgId
=
vgId
;
if
(
pBlock
->
pTableMeta
)
{
pBlock
->
pTableMeta
->
uid
=
uid
;
pBlock
->
pTableMeta
->
vgId
=
vgId
;
}
memset
(
pBlock
->
pData
,
0
,
sizeof
(
SSubmitBlk
));
...
...
tests/script/api/batchprepare.c
浏览文件 @
f506604d
...
...
@@ -230,12 +230,12 @@ CaseCtrl gCaseCtrl = {
.
optrIdxListNum
=
0
,
.
optrIdxList
=
NULL
,
.
checkParamNum
=
false
,
.
printRes
=
tru
e
,
.
printRes
=
fals
e
,
.
runTimes
=
0
,
.
caseIdx
=
-
1
,
.
caseNum
=
15
,
.
caseRunIdx
=
8
,
.
caseRunNum
=
15
,
.
caseNum
=
-
1
,
.
caseRunIdx
=
-
1
,
.
caseRunNum
=
-
1
,
};
#endif
...
...
@@ -3465,16 +3465,17 @@ void* runCaseList(TAOS *taos) {
}
void
runAll
(
TAOS
*
taos
)
{
/*
strcpy
(
gCaseCtrl
.
caseCatalog
,
"Normal Test"
);
printf
(
"%s Begin
\n
"
,
gCaseCtrl
.
caseCatalog
);
runCaseList
(
taos
);
*/
#if 0
strcpy(gCaseCtrl.caseCatalog, "Auto Create Table Test");
gCaseCtrl.autoCreateTbl = true;
printf("%s Begin\n", gCaseCtrl.caseCatalog);
runCaseList(taos);
gCaseCtrl.autoCreateTbl = false;
#endif
/*
strcpy(gCaseCtrl.caseCatalog, "Null Test");
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录