Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
82a3dcab
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看板
提交
82a3dcab
编写于
5月 28, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-430] fix bug while client does not retrieve or paritally retrieve result from vnode.
上级
f71c5aea
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
18 addition
and
18 deletion
+18
-18
src/client/src/tscServer.c
src/client/src/tscServer.c
+5
-3
src/client/src/tscSql.c
src/client/src/tscSql.c
+11
-15
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-0
未找到文件。
src/client/src/tscServer.c
浏览文件 @
82a3dcab
...
@@ -217,10 +217,12 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
...
@@ -217,10 +217,12 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
STscObj
*
pObj
=
pSql
->
pTscObj
;
STscObj
*
pObj
=
pSql
->
pTscObj
;
// tscTrace("%p msg:%s is received from server", pSql, taosMsg[rpcMsg->msgType]);
// tscTrace("%p msg:%s is received from server", pSql, taosMsg[rpcMsg->msgType]);
if
(
p
Sql
->
freed
||
p
Obj
->
signature
!=
pObj
)
{
if
(
pObj
->
signature
!=
pObj
)
{
tscTrace
(
"%p sql is already released or DB connection is closed, freed:%d pObj:%p signature:%p"
,
pSql
,
pSql
->
freed
,
tscTrace
(
"%p sql is already released or DB connection is closed, freed:%d pObj:%p signature:%p"
,
pSql
,
pSql
->
freed
,
pObj
,
pObj
->
signature
);
pObj
,
pObj
->
signature
);
if
(
pSql
!=
pObj
->
pSql
)
{
tscFreeSqlObj
(
pSql
);
tscFreeSqlObj
(
pSql
);
}
rpcFreeCont
(
rpcMsg
->
pCont
);
rpcFreeCont
(
rpcMsg
->
pCont
);
return
;
return
;
}
}
...
@@ -1867,8 +1869,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
...
@@ -1867,8 +1869,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
}
}
free
(
pTableMeta
);
tscTrace
(
"%p recv table meta: %"
PRId64
", tid:%d, name:%s"
,
pSql
,
pTableMeta
->
uid
,
pTableMeta
->
sid
,
pTableMetaInfo
->
name
);
tscTrace
(
"%p recv table meta: %"
PRId64
", tid:%d, name:%s"
,
pSql
,
pTableMeta
->
uid
,
pTableMeta
->
sid
,
pTableMetaInfo
->
name
);
free
(
pTableMeta
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/client/src/tscSql.c
浏览文件 @
82a3dcab
...
@@ -576,26 +576,22 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
...
@@ -576,26 +576,22 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
* for each subquery. Because the failure of execution tsProcessSql may trigger the callback function
* for each subquery. Because the failure of execution tsProcessSql may trigger the callback function
* be executed, and the retry efforts may result in double free the resources, e.g.,SRetrieveSupport
* be executed, and the retry efforts may result in double free the resources, e.g.,SRetrieveSupport
*/
*/
if
((
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_RETRIEVE
||
if
((
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_RETRIEVE
||
pCmd
->
command
==
TSDB_SQL_FETCH
)
&&
pCmd
->
command
==
TSDB_SQL_FETCH
)
&&
(
pRes
->
code
!=
TSDB_CODE_QUERY_CANCELLED
&&
((
pRes
->
numOfRows
>
0
&&
pCmd
->
command
<
TSDB_SQL_LOCAL
&&
pRes
->
completed
==
false
)
||
(
pRes
->
code
!=
TSDB_CODE_QUERY_CANCELLED
&&
((
pCmd
->
command
<
TSDB_SQL_LOCAL
&&
pRes
->
completed
==
false
)
||
(
pRes
->
code
==
TSDB_CODE_SUCCESS
&&
pRes
->
numOfRows
==
0
&&
pCmd
->
command
==
TSDB_SQL_SELECT
&&
(
pRes
->
code
==
TSDB_CODE_SUCCESS
&&
pCmd
->
command
==
TSDB_SQL_SELECT
&&
pSql
->
pStream
==
NULL
&&
pTableMetaInfo
->
pTableMeta
!=
NULL
))))
{
pSql
->
pStream
==
NULL
&&
pTableMetaInfo
->
pTableMeta
!=
NULL
))))
{
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
tscTrace
(
"%p code:%d, numOfRows:%d, command:%d"
,
pSql
,
pRes
->
code
,
pRes
->
numOfRows
,
pCmd
->
command
);
tscTrace
(
"%p send msg to free qhandle in vnode, code:%d, numOfRows:%d, command:%s"
,
pSql
,
pRes
->
code
,
pRes
->
numOfRows
,
sqlCmd
[
pCmd
->
command
]);
pSql
->
freed
=
1
;
pSql
->
freed
=
1
;
tscProcessSql
(
pSql
);
tscProcessSql
(
pSql
);
/*
// waits for response and then goes on
* If release connection msg is sent to vnode, the corresponding SqlObj for async query can not be freed instantly,
sem_wait
(
&
pSql
->
rspSem
);
* since its free operation is delegated to callback function, which is tscProcessMsgFromServer.
*/
STscObj
*
pObj
=
pSql
->
pTscObj
;
if
(
pObj
->
pSql
==
pSql
)
{
pObj
->
pSql
=
NULL
;
}
}
else
{
// if no free resource msg is sent to vnode, we free this object immediately.
}
else
{
// if no free resource msg is sent to vnode, we free this object immediately.
STscObj
*
pTscObj
=
pSql
->
pTscObj
;
STscObj
*
pTscObj
=
pSql
->
pTscObj
;
...
...
src/client/src/tscUtil.c
浏览文件 @
82a3dcab
...
@@ -423,6 +423,8 @@ void tscFreeSqlObj(SSqlObj* pSql) {
...
@@ -423,6 +423,8 @@ void tscFreeSqlObj(SSqlObj* pSql) {
tfree
(
pCmd
->
payload
);
tfree
(
pCmd
->
payload
);
pCmd
->
allocSize
=
0
;
pCmd
->
allocSize
=
0
;
tfree
(
pSql
->
sqlstr
);
free
(
pSql
);
free
(
pSql
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录