Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
733d2216
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看板
提交
733d2216
编写于
5月 21, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix stmt bug
上级
a70a942d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
59 addition
and
12 deletion
+59
-12
include/libs/qcom/query.h
include/libs/qcom/query.h
+2
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+25
-0
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+8
-2
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+5
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+1
-0
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+5
-1
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+12
-8
tests/system-test/0-others/udfTest.py
tests/system-test/0-others/udfTest.py
+1
-1
未找到文件。
include/libs/qcom/query.h
浏览文件 @
733d2216
...
...
@@ -198,6 +198,8 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t
#define NEED_CLIENT_HANDLE_ERROR(_code) \
(NEED_CLIENT_RM_TBLMETA_ERROR(_code) || NEED_CLIENT_REFRESH_VG_ERROR(_code) || \
NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code))
#define NEED_CLIENT_RM_TBLMETA_REQ(_type) ((_type) == TDMT_VND_CREATE_TABLE || (_type) == TDMT_VND_CREATE_STB \
|| (_type) == TDMT_VND_DROP_TABLE || (_type) == TDMT_VND_DROP_STB)
#define NEED_SCHEDULER_RETRY_ERROR(_code) \
((_code) == TSDB_CODE_RPC_REDIRECT || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL)
...
...
source/client/src/clientImpl.c
浏览文件 @
733d2216
...
...
@@ -345,6 +345,10 @@ int32_t validateSversion(SRequestObj* pRequest, void* res) {
for
(
int32_t
i
=
0
;
i
<
pRsp
->
nBlocks
;
++
i
)
{
SSubmitBlkRsp
*
blk
=
pRsp
->
pBlocks
+
i
;
if
(
NULL
==
blk
->
tblFName
||
0
==
blk
->
tblFName
[
0
])
{
continue
;
}
STbSVersion
tbSver
=
{.
tbFName
=
blk
->
tblFName
,
.
sver
=
blk
->
sver
};
taosArrayPush
(
pArray
,
&
tbSver
);
}
...
...
@@ -499,6 +503,23 @@ int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest) {
return
code
;
}
int32_t
removeMeta
(
STscObj
*
pTscObj
,
SArray
*
tbList
)
{
SCatalog
*
pCatalog
=
NULL
;
int32_t
tbNum
=
taosArrayGetSize
(
tbList
);
int32_t
code
=
catalogGetHandle
(
pTscObj
->
pAppInfo
->
clusterId
,
&
pCatalog
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
SName
*
pTbName
=
taosArrayGet
(
tbList
,
i
);
catalogRemoveTableMeta
(
pCatalog
,
pTbName
);
}
return
TSDB_CODE_SUCCESS
;
}
SRequestObj
*
execQuery
(
STscObj
*
pTscObj
,
const
char
*
sql
,
int
sqlLen
)
{
SRequestObj
*
pRequest
=
NULL
;
int32_t
retryNum
=
0
;
...
...
@@ -518,6 +539,10 @@ SRequestObj* execQuery(STscObj* pTscObj, const char* sql, int sqlLen) {
}
}
while
(
retryNum
++
<
REQUEST_MAX_TRY_TIMES
);
if
(
NEED_CLIENT_RM_TBLMETA_REQ
(
pRequest
->
type
))
{
removeMeta
(
pTscObj
,
pRequest
->
tableList
);
}
return
pRequest
;
}
...
...
source/client/src/clientStmt.c
浏览文件 @
733d2216
...
...
@@ -47,8 +47,14 @@ int32_t stmtSwitchStatus(STscStmt* pStmt, STMT_STATUS newStatus) {
}
break
;
case
STMT_EXECUTE
:
if
(
STMT_STATUS_NE
(
ADD_BATCH
)
&&
STMT_STATUS_NE
(
FETCH_FIELDS
))
{
code
=
TSDB_CODE_TSC_STMT_API_ERROR
;
if
(
STMT_TYPE_QUERY
==
pStmt
->
sql
.
type
)
{
if
(
STMT_STATUS_NE
(
ADD_BATCH
)
&&
STMT_STATUS_NE
(
FETCH_FIELDS
)
&&
STMT_STATUS_NE
(
BIND
)
&&
STMT_STATUS_NE
(
BIND_COL
))
{
code
=
TSDB_CODE_TSC_STMT_API_ERROR
;
}
}
else
{
if
(
STMT_STATUS_NE
(
ADD_BATCH
)
&&
STMT_STATUS_NE
(
FETCH_FIELDS
))
{
code
=
TSDB_CODE_TSC_STMT_API_ERROR
;
}
}
break
;
default:
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
733d2216
...
...
@@ -2800,6 +2800,7 @@ int32_t catalogRemoveTableMeta(SCatalog* pCtg, const SName* pTableName) {
CTG_ERR_JRET
(
ctgPushRmTblMsgInQueue
(
pCtg
,
dbFName
,
dbId
,
pTableName
->
tname
,
true
));
}
ctgDebug
(
"table meta %s.%s removed"
,
dbFName
,
pTableName
->
tname
);
_return:
...
...
@@ -2974,6 +2975,10 @@ int32_t catalogChkTbMetaVersion(SCatalog* pCtg, void *pTrans, const SEpSet* pMgm
int32_t
tbNum
=
taosArrayGetSize
(
pTables
);
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
STbSVersion
*
pTb
=
(
STbSVersion
*
)
taosArrayGet
(
pTables
,
i
);
if
(
NULL
==
pTb
->
tbFName
||
0
==
pTb
->
tbFName
[
0
])
{
continue
;
}
tNameFromString
(
&
name
,
pTb
->
tbFName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
if
(
CTG_IS_SYS_DBNAME
(
name
.
dbname
))
{
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
733d2216
...
...
@@ -2726,6 +2726,7 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm
SName
tableName
;
tNameExtractFullName
(
toName
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
tableName
),
pReq
->
name
);
collectUseTable
(
&
tableName
,
pCxt
->
pTables
);
return
buildRollupAst
(
pCxt
,
pStmt
,
pReq
);
}
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
733d2216
...
...
@@ -725,7 +725,11 @@ void qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx) {
qGetQueriedTableSchemaVersion
(
pTaskInfo
,
dbFName
,
tbName
,
&
ctx
->
tbInfo
.
sversion
,
&
ctx
->
tbInfo
.
tversion
);
sprintf
(
ctx
->
tbInfo
.
tbFName
,
"%s.%s"
,
dbFName
,
tbName
);
if
(
dbFName
[
0
]
&&
tbName
[
0
])
{
sprintf
(
ctx
->
tbInfo
.
tbFName
,
"%s.%s"
,
dbFName
,
tbName
);
}
else
{
ctx
->
tbInfo
.
tbFName
[
0
]
=
0
;
}
}
int32_t
qwHandlePrePhaseEvents
(
QW_FPARAMS_DEF
,
int8_t
phase
,
SQWPhaseInput
*
input
,
SQWPhaseOutput
*
output
)
{
...
...
tests/script/api/batchprepare.c
浏览文件 @
733d2216
...
...
@@ -1825,10 +1825,12 @@ int queryColumnTest(TAOS_STMT *stmt, TAOS *taos) {
if
(
bpBindParam
(
stmt
,
data
.
pBind
+
n
*
gCurCase
->
bindColNum
))
{
exit
(
1
);
}
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
if
(
rand
()
%
2
==
0
)
{
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
}
}
if
(
taos_stmt_execute
(
stmt
)
!=
0
)
{
...
...
@@ -1871,10 +1873,12 @@ int queryMiscTest(TAOS_STMT *stmt, TAOS *taos) {
if
(
bpBindParam
(
stmt
,
data
.
pBind
+
n
*
gCurCase
->
bindColNum
))
{
exit
(
1
);
}
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
if
(
rand
()
%
2
==
0
)
{
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
}
}
if
(
taos_stmt_execute
(
stmt
)
!=
0
)
{
...
...
tests/system-test/0-others/udfTest.py
浏览文件 @
733d2216
...
...
@@ -14,7 +14,7 @@ class TDTestCase:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
()
,
logSql
)
def
getBuildPath
(
self
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录