Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6f49a2ca
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f49a2ca
编写于
5月 07, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stmt insert
上级
f6f317d6
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
393 addition
and
167 deletion
+393
-167
include/libs/qcom/query.h
include/libs/qcom/query.h
+1
-1
source/client/inc/clientStmt.h
source/client/inc/clientStmt.h
+1
-0
source/client/src/clientSml.c
source/client/src/clientSml.c
+1
-1
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+17
-5
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-2
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+1
-1
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+2
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+1
-1
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+367
-155
未找到文件。
include/libs/qcom/query.h
浏览文件 @
6f49a2ca
...
...
@@ -182,7 +182,7 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t
#define SET_META_TYPE_TABLE(t) (t) = META_TYPE_TABLE
#define SET_META_TYPE_BOTH_TABLE(t) (t) = META_TYPE_BOTH_TABLE
#define NEED_CLIENT_RM_TBLMETA_ERROR(_code) ((_code) == TSDB_CODE_
TDB_INVALID_TABLE_ID
|| (_code) == TSDB_CODE_VND_TB_NOT_EXIST)
#define NEED_CLIENT_RM_TBLMETA_ERROR(_code) ((_code) == TSDB_CODE_
PAR_TABLE_NOT_EXIST
|| (_code) == TSDB_CODE_VND_TB_NOT_EXIST)
#define NEED_CLIENT_REFRESH_VG_ERROR(_code) ((_code) == TSDB_CODE_VND_HASH_MISMATCH || (_code) == TSDB_CODE_VND_INVALID_VGROUP_ID)
#define NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code) ((_code) == TSDB_CODE_TDB_TABLE_RECREATED)
#define NEED_CLIENT_HANDLE_ERROR(_code) (NEED_CLIENT_RM_TBLMETA_ERROR(_code) || NEED_CLIENT_REFRESH_VG_ERROR(_code) || NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code))
...
...
source/client/inc/clientStmt.h
浏览文件 @
6f49a2ca
...
...
@@ -60,6 +60,7 @@ typedef struct SStmtBindInfo {
int32_t
sBindRowNum
;
int32_t
sBindLastIdx
;
int8_t
tbType
;
bool
tagsCached
;
void
*
boundTags
;
char
*
tbName
;
SName
sname
;
...
...
source/client/src/clientSml.c
浏览文件 @
6f49a2ca
...
...
@@ -432,7 +432,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
code
=
catalogGetSTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
&
pTableMeta
);
if
(
code
==
TSDB_CODE_
TDB_INVALID_TABLE_ID
||
code
==
TSDB_CODE_MND_INVALID_STB
)
{
if
(
code
==
TSDB_CODE_
PAR_TABLE_NOT_EXIST
||
code
==
TSDB_CODE_MND_INVALID_STB
)
{
SSchemaAction
schemaAction
=
{
0
};
schemaAction
.
action
=
SCHEMA_ACTION_CREATE_STABLE
;
memcpy
(
schemaAction
.
createSTable
.
sTableName
,
superTable
,
superTableLen
);
...
...
source/client/src/clientStmt.c
浏览文件 @
6f49a2ca
...
...
@@ -123,6 +123,7 @@ int32_t stmtSetBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags) {
pStmt
->
bInfo
.
tbSuid
=
pTableMeta
->
suid
;
pStmt
->
bInfo
.
tbType
=
pTableMeta
->
tableType
;
pStmt
->
bInfo
.
boundTags
=
tags
;
pStmt
->
bInfo
.
tagsCached
=
false
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -207,8 +208,6 @@ int32_t stmtParseSql(STscStmt* pStmt) {
STMT_ERR_RET
(
TSDB_CODE_TSC_STMT_CLAUSE_ERROR
);
}
STMT_ERR_RET
(
stmtCacheBlock
(
pStmt
));
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -219,8 +218,10 @@ int32_t stmtCleanBindInfo(STscStmt* pStmt) {
pStmt
->
bInfo
.
needParse
=
true
;
taosMemoryFreeClear
(
pStmt
->
bInfo
.
tbName
);
destroyBoundColumnInfo
(
pStmt
->
bInfo
.
boundTags
);
taosMemoryFreeClear
(
pStmt
->
bInfo
.
boundTags
);
if
(
!
pStmt
->
bInfo
.
tagsCached
)
{
destroyBoundColumnInfo
(
pStmt
->
bInfo
.
boundTags
);
taosMemoryFreeClear
(
pStmt
->
bInfo
.
boundTags
);
}
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -275,6 +276,7 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
qDestroyStmtDataBlock
(
pCache
->
pDataBlock
);
destroyBoundColumnInfo
(
pCache
->
boundTags
);
taosMemoryFreeClear
(
pCache
->
boundTags
);
pIter
=
taosHashIterate
(
pStmt
->
sql
.
pTableCache
,
pIter
);
}
...
...
@@ -302,7 +304,15 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
STableMeta
*
pTableMeta
=
NULL
;
SEpSet
ep
=
getEpSet_s
(
&
pStmt
->
taos
->
pAppInfo
->
mgmtEp
);
STMT_ERR_RET
(
catalogGetTableMeta
(
pStmt
->
pCatalog
,
pStmt
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pStmt
->
bInfo
.
sname
,
&
pTableMeta
));
int32_t
code
=
catalogGetTableMeta
(
pStmt
->
pCatalog
,
pStmt
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pStmt
->
bInfo
.
sname
,
&
pTableMeta
);
if
(
TSDB_CODE_PAR_TABLE_NOT_EXIST
==
code
)
{
STMT_ERR_RET
(
stmtCleanBindInfo
(
pStmt
));
return
TSDB_CODE_SUCCESS
;
}
STMT_ERR_RET
(
code
);
uint64_t
uid
=
pTableMeta
->
uid
;
uint64_t
suid
=
pTableMeta
->
suid
;
int8_t
tableType
=
pTableMeta
->
tableType
;
...
...
@@ -328,6 +338,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
pStmt
->
bInfo
.
tbSuid
=
suid
;
pStmt
->
bInfo
.
tbType
=
tableType
;
pStmt
->
bInfo
.
boundTags
=
pCache
->
boundTags
;
pStmt
->
bInfo
.
tagsCached
=
true
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -340,6 +351,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
pStmt
->
bInfo
.
tbSuid
=
suid
;
pStmt
->
bInfo
.
tbType
=
tableType
;
pStmt
->
bInfo
.
boundTags
=
pCache
->
boundTags
;
pStmt
->
bInfo
.
tagsCached
=
true
;
STableDataBlocks
*
pNewBlock
=
NULL
;
STMT_ERR_RET
(
qRebuildStmtDataBlock
(
&
pNewBlock
,
pCache
->
pDataBlock
));
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
6f49a2ca
...
...
@@ -3869,7 +3869,7 @@ int32_t tsdbQuerySTableByTagCond(void* pMeta, uint64_t uid, TSKEY skey, const ch
if
(
metaGetTableEntryByUid
(
&
mr
,
uid
)
<
0
)
{
tsdbError
(
"%p failed to get stable, uid:%"
PRIu64
", TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
pMeta
,
uid
,
taskId
,
reqId
);
terrno
=
TSDB_CODE_
TDB_INVALID_TABLE_ID
;
terrno
=
TSDB_CODE_
PAR_TABLE_NOT_EXIST
;
goto
_error
;
}
else
{
tsdbDebug
(
"%p succeed to get stable, uid:%"
PRIu64
", TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
pMeta
,
uid
,
taskId
,
reqId
);
...
...
@@ -3939,7 +3939,7 @@ int32_t tsdbGetOneTableGroup(void* pMeta, uint64_t uid, TSKEY startKey, STableGr
metaReaderInit
(
&
mr
,
(
SMeta
*
)
pMeta
,
0
);
if
(
metaGetTableEntryByUid
(
&
mr
,
uid
)
<
0
)
{
terrno
=
TSDB_CODE_
TDB_INVALID_TABLE_ID
;
terrno
=
TSDB_CODE_
PAR_TABLE_NOT_EXIST
;
goto
_error
;
}
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
6f49a2ca
...
...
@@ -36,7 +36,7 @@ extern "C" {
#define CTG_DEFAULT_INVALID_VERSION (-1)
#define CTG_ERR_CODE_TABLE_NOT_EXIST TSDB_CODE_
TDB_INVALID_TABLE_ID
#define CTG_ERR_CODE_TABLE_NOT_EXIST TSDB_CODE_
PAR_TABLE_NOT_EXIST
enum
{
CTG_READ
=
1
,
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
6f49a2ca
...
...
@@ -1151,6 +1151,7 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
(
*
pCxt
->
pStmtCb
->
setExecInfoFn
)(
pCxt
->
pStmtCb
->
pStmt
,
pCxt
->
pVgroupsHashObj
,
pCxt
->
pTableBlockHashObj
);
pCxt
->
pVgroupsHashObj
=
NULL
;
pCxt
->
pTableBlockHashObj
=
NULL
;
pCxt
->
pTableMeta
=
NULL
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1276,7 +1277,7 @@ int32_t qBindStmtTagsValue(void *pBlock, void *boundTags, int64_t suid, char *tN
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
SSchema
*
pSchema
=
getTableTagSchema
(
pDataBlock
->
pTableMeta
)
;
SSchema
*
pSchema
=
pDataBlock
->
pTableMeta
->
schema
;
SKvParam
param
=
{.
builder
=
&
tagBuilder
};
for
(
int
c
=
0
;
c
<
tags
->
numOfBound
;
++
c
)
{
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
6f49a2ca
...
...
@@ -2574,7 +2574,7 @@ static int32_t translateDropTable(STranslateContext* pCxt, SDropTableStmt* pStmt
SName
tableName
;
int32_t
code
=
getTableMetaImpl
(
pCxt
,
toName
(
pCxt
->
pParseCxt
->
acctId
,
pClause
->
dbName
,
pClause
->
tableName
,
&
tableName
),
&
pTableMeta
);
if
((
TSDB_CODE_
TDB_INVALID_TABLE_ID
==
code
||
TSDB_CODE_VND_TB_NOT_EXIST
==
code
)
&&
pClause
->
ignoreNotExists
)
{
if
((
TSDB_CODE_
PAR_TABLE_NOT_EXIST
==
code
||
TSDB_CODE_VND_TB_NOT_EXIST
==
code
)
&&
pClause
->
ignoreNotExists
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
tests/script/api/batchprepare.c
浏览文件 @
6f49a2ca
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录