Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
47665e56
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
47665e56
编写于
7月 12, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] fix bug in error process.
上级
9e0ac1eb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
43 deletion
+26
-43
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+19
-26
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-2
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-12
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+5
-3
未找到文件。
src/client/src/tscAsync.c
浏览文件 @
47665e56
...
...
@@ -420,15 +420,15 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
pRes
->
code
=
code
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRes
->
code
=
code
;
tscQueueAsyncRes
(
pSql
);
return
;
tscError
(
"%p ge tableMeta failed, code:%s"
,
pSql
,
tstrerror
(
code
));
goto
_error
;
}
else
{
tscDebug
(
"%p get tableMeta successfully"
,
pSql
);
}
tscDebug
(
"%p get tableMeta successfully"
,
pSql
);
if
(
pSql
->
pStream
==
NULL
)
{
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
...
...
@@ -453,11 +453,9 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
assert
(
pParObj
->
signature
==
pParObj
&&
trs
->
subqueryIndex
==
pTableMetaInfo
->
vgroupIndex
&&
pTableMetaInfo
->
vgroupIndex
>=
0
&&
pTableMetaInfo
->
vgroupList
!=
NULL
);
if
((
code
=
tscProcessSql
(
pSql
))
==
TSDB_CODE_SUCCESS
)
{
return
;
}
goto
_error
;
// tscProcessSql can add error into async res
tscProcessSql
(
pSql
);
return
;
}
else
{
// continue to process normal async query
if
(
pCmd
->
parseFinished
)
{
tscDebug
(
"%p update table meta in local cache, continue to process sql and send corresponding query"
,
pSql
);
...
...
@@ -481,26 +479,21 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
return
;
}
else
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
if
(
code
==
TSDB_CODE_SUCCESS
)
{
/*
* Discard previous built submit blocks, and then parse the sql string again and build up all submit blocks,
* and send the required submit block according to index value in supporter to server.
*/
pSql
->
fp
=
pSql
->
fetchFp
;
// restore the fp
if
((
code
=
tscHandleInsertRetry
(
pSql
))
==
TSDB_CODE_SUCCESS
)
{
return
;
}
}
/*
* Discard previous built submit blocks, and then parse the sql string again and build up all submit blocks,
* and send the required submit block according to index value in supporter to server.
*/
pSql
->
fp
=
pSql
->
fetchFp
;
// restore the fp
tscHandleInsertRetry
(
pSql
);
}
else
{
// in case of other query type, continue
if
((
code
=
tscProcessSql
(
pSql
))
==
TSDB_CODE_SUCCESS
)
{
return
;
}
tscProcessSql
(
pSql
);
}
goto
_error
;
return
;
}
else
{
tscDebug
(
"%p continue parse sql after get table meta"
,
pSql
);
...
...
@@ -538,7 +531,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
goto
_error
;
}
if
(
code
==
TSDB_CODE_SUCCESS
&&
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
))
{
code
=
tscGetSTableVgroupInfo
(
pSql
,
pCmd
->
clauseIndex
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
return
;
...
...
src/client/src/tscServer.c
浏览文件 @
47665e56
...
...
@@ -412,7 +412,7 @@ int tscProcessSql(SSqlObj *pSql) {
return
pSql
->
res
.
code
;
}
}
else
if
(
pCmd
->
command
<
TSDB_SQL_LOCAL
)
{
pSql
->
ipList
=
tscMgmtIpSet
;
//?
pSql
->
ipList
=
tscMgmtIpSet
;
}
else
{
// local handler
return
(
*
tscProcessMsgRsp
[
pCmd
->
command
])(
pSql
);
}
...
...
@@ -1372,7 +1372,6 @@ static int tscLocalResultCommonBuilder(SSqlObj *pSql, int32_t numOfRes) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
pRes
->
code
=
TSDB_CODE_SUCCESS
;
if
(
pRes
->
rspType
==
0
)
{
pRes
->
numOfRows
=
numOfRes
;
pRes
->
row
=
0
;
...
...
src/client/src/tscSql.c
浏览文件 @
47665e56
...
...
@@ -487,19 +487,8 @@ static bool tscFreeQhandleInVnode(SSqlObj* pSql) {
(
pCmd
->
command
==
TSDB_SQL_SELECT
&&
pSql
->
pStream
==
NULL
&&
pTableMetaInfo
->
pTableMeta
!=
NULL
))
{
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
tscDebug
(
"%p send msg to dnode to free qhandle ASAP, command:%s"
,
pSql
,
sqlCmd
[
pCmd
->
command
]);
tscDebug
(
"%p send msg to dnode to free qhandle ASAP, command:%s
,
"
,
pSql
,
sqlCmd
[
pCmd
->
command
]);
tscProcessSql
(
pSql
);
// in case of sync model query, waits for response and then goes on
// if (pSql->fp == waitForQueryRsp || pSql->fp == waitForRetrieveRsp) {
// sem_wait(&pSql->rspSem);
// tscFreeSqlObj(pSql);
// tscDebug("%p sqlObj is freed by app", pSql);
// } else {
tscDebug
(
"%p sqlObj will be freed while rsp received"
,
pSql
);
// }
return
true
;
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
47665e56
...
...
@@ -1895,9 +1895,11 @@ int32_t tscHandleInsertRetry(SSqlObj* pSql) {
assert
(
pSupporter
->
index
<
pSupporter
->
pState
->
numOfTotal
);
STableDataBlocks
*
pTableDataBlock
=
taosArrayGetP
(
pCmd
->
pDataBlocks
,
pSupporter
->
index
);
pRes
->
code
=
tscCopyDataBlockToPayload
(
pSql
,
pTableDataBlock
);
if
(
pRes
->
code
!=
TSDB_CODE_SUCCESS
)
{
return
pRes
->
code
;
int32_t
code
=
tscCopyDataBlockToPayload
(
pSql
,
pTableDataBlock
);
if
((
pRes
->
code
=
code
)
!=
TSDB_CODE_SUCCESS
)
{
tscQueueAsyncRes
(
pSql
);
return
code
;
// here the pSql may have been released already.
}
return
tscProcessSql
(
pSql
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录