Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
713ebff1
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看板
提交
713ebff1
编写于
5月 30, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-437] fix crash in client, while mnode return unexpceted msg
上级
87e4d500
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
12 deletion
+29
-12
src/client/src/tscSql.c
src/client/src/tscSql.c
+3
-3
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+25
-7
未找到文件。
src/client/src/tscSql.c
浏览文件 @
713ebff1
...
...
@@ -579,9 +579,9 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
if
((
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_RETRIEVE
||
pCmd
->
command
==
TSDB_SQL_FETCH
)
&&
(
pRes
->
code
!=
TSDB_CODE_QUERY_CANCELLED
&&
(
(
pCmd
->
command
<
TSDB_SQL_LOCAL
&&
pRes
->
completed
==
false
)
||
(
p
Res
->
code
==
TSDB_CODE_SUCCESS
&&
pCmd
->
command
==
TSDB_SQL_SELECT
&&
pSql
->
pStream
==
NULL
&&
pTableMetaInfo
->
pTableMeta
!=
NULL
)
)))
{
pCmd
->
command
==
TSDB_SQL_FETCH
)
&&
pRes
->
code
==
TSDB_CODE_SUCCESS
&&
((
pCmd
->
command
<
TSDB_SQL_LOCAL
&&
pRes
->
completed
==
false
)
||
(
p
Cmd
->
command
==
TSDB_SQL_SELECT
&&
pSql
->
pStream
==
NULL
&&
pTableMetaInfo
->
pTableMeta
!=
NULL
)))
{
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
tscTrace
(
"%p send msg to free qhandle in vnode, code:%d, numOfRows:%d, command:%s"
,
pSql
,
pRes
->
code
,
pRes
->
numOfRows
,
...
...
src/client/src/tscUtil.c
浏览文件 @
713ebff1
...
...
@@ -1850,8 +1850,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
STableMetaInfo
*
pFinalInfo
=
NULL
;
if
(
pPrevSql
==
NULL
)
{
STableMeta
*
pTableMeta
=
taosCacheAcquireByName
(
tscCacheHandle
,
name
);
// todo handle error
STableMeta
*
pTableMeta
=
taosCacheAcquireByData
(
tscCacheHandle
,
pTableMetaInfo
->
pTableMeta
);
// get by name may failed due to the cache cleanup
assert
(
pTableMeta
!=
NULL
);
pFinalInfo
=
tscAddTableMetaInfo
(
pNewQueryInfo
,
name
,
pTableMeta
,
pTableMetaInfo
->
vgroupList
,
pTableMetaInfo
->
tagColList
);
}
else
{
// transfer the ownership of pTableMeta to the newly create sql object.
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
713ebff1
...
...
@@ -1269,9 +1269,9 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
for
(
int32_t
i
=
0
;
i
<
numOfTable
;
++
i
)
{
char
*
stableName
=
(
char
*
)
pInfo
+
sizeof
(
SCMSTableVgroupMsg
)
+
(
TSDB_TABLE_ID_LEN
)
*
i
;
SSuperTableObj
*
pTable
=
mnodeGetSuperTable
(
stableName
);
if
(
pTable
->
vgHash
!=
NULL
)
{
if
(
pTable
!=
NULL
&&
pTable
->
vgHash
!=
NULL
)
{
contLen
+=
(
taosHashGetSize
(
pTable
->
vgHash
)
*
sizeof
(
SCMVgroupInfo
)
+
sizeof
(
SVgroupsInfo
));
}
}
mnodeDecTableRef
(
pTable
);
}
...
...
@@ -1280,12 +1280,23 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
}
pRsp
->
numOfTables
=
htonl
(
numOfTable
)
;
pRsp
->
numOfTables
=
0
;
char
*
msg
=
(
char
*
)
pRsp
+
sizeof
(
SCMSTableVgroupRspMsg
);
for
(
int32_t
i
=
0
;
i
<
numOfTable
;
++
i
)
{
char
*
stableName
=
(
char
*
)
pInfo
+
sizeof
(
SCMSTableVgroupMsg
)
+
(
TSDB_TABLE_ID_LEN
)
*
i
;
SSuperTableObj
*
pTable
=
mnodeGetSuperTable
(
stableName
);
if
(
pTable
==
NULL
)
{
mError
(
"stable:%s, not exist while get stable vgroup info"
,
stableName
);
mnodeDecTableRef
(
pTable
);
continue
;
}
if
(
pTable
->
vgHash
==
NULL
)
{
mError
(
"stable:%s, not vgroup exist while get stable vgroup info"
,
stableName
);
mnodeDecTableRef
(
pTable
);
continue
;
}
SVgroupsInfo
*
pVgroupInfo
=
(
SVgroupsInfo
*
)
msg
;
SHashMutableIterator
*
pIter
=
taosHashCreateIter
(
pTable
->
vgHash
);
...
...
@@ -1317,12 +1328,19 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
// one table is done, try the next table
msg
+=
sizeof
(
SVgroupsInfo
)
+
vgSize
*
sizeof
(
SCMVgroupInfo
);
pRsp
->
numOfTables
++
;
}
pMsg
->
rpcRsp
.
rsp
=
pRsp
;
pMsg
->
rpcRsp
.
len
=
msg
-
(
char
*
)
pRsp
;
if
(
pRsp
->
numOfTables
!=
numOfTable
)
{
rpcFreeCont
(
pRsp
);
return
TSDB_CODE_INVALID_TABLE_ID
;
}
else
{
pRsp
->
numOfTables
=
htonl
(
pRsp
->
numOfTables
);
pMsg
->
rpcRsp
.
rsp
=
pRsp
;
pMsg
->
rpcRsp
.
len
=
msg
-
(
char
*
)
pRsp
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
void
mnodeProcessDropSuperTableRsp
(
SRpcMsg
*
rpcMsg
)
{
...
...
@@ -1423,7 +1441,7 @@ static SChildTableObj* mnodeDoCreateChildTable(SCMCreateTableMsg *pCreate, SVgOb
SSuperTableObj
*
pSuperTable
=
mnodeGetSuperTable
(
pTagData
->
name
);
if
(
pSuperTable
==
NULL
)
{
mError
(
"table:%s, corresponding super table:%s does not exist"
,
pCreate
->
tableId
,
pTagData
->
name
);
fre
e
(
pTable
);
mnodeDestroyChildTabl
e
(
pTable
);
terrno
=
TSDB_CODE_INVALID_TABLE
;
return
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录