Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
9da28fad
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9da28fad
编写于
6月 10, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-589] count error in show command
上级
fef006ad
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
7 deletion
+13
-7
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+13
-7
未找到文件。
src/mnode/src/mnodeShow.c
浏览文件 @
9da28fad
...
...
@@ -138,15 +138,16 @@ static int32_t mnodeProcessShowMsg(SMnodeMsg *pMsg) {
}
pShowRsp
->
qhandle
=
htobe64
((
uint64_t
)
pShow
);
mTrace
(
"%p, show type:%s, start to get meta"
,
pShow
,
mnodeGetShowType
(
pShowMsg
->
type
));
int32_t
code
=
(
*
tsMnodeShowMetaFp
[
pShowMsg
->
type
])(
&
pShowRsp
->
tableMeta
,
pShow
,
pMsg
->
rpcMsg
.
handle
);
if
(
code
==
0
)
{
mTrace
(
"%p, show type:%s index:%d, get meta finished, rows:%d cols:%d result:%s"
,
pShow
,
mnodeGetShowType
(
pShowMsg
->
type
),
pShow
->
index
,
pShow
->
numOfRows
,
pShow
->
numOfColumns
,
tstrerror
(
code
));
if
(
code
==
TSDB_CODE_SUCCESS
)
{
pMsg
->
rpcRsp
.
rsp
=
pShowRsp
;
pMsg
->
rpcRsp
.
len
=
sizeof
(
SCMShowRsp
)
+
sizeof
(
SSchema
)
*
pShow
->
numOfColumns
;
mnodeReleaseShowObj
(
pShow
,
false
);
return
TSDB_CODE_SUCCESS
;
}
else
{
mError
(
"%p, show type:%s, failed to get meta, reason:%s"
,
pShow
,
mnodeGetShowType
(
pShowMsg
->
type
),
tstrerror
(
code
));
rpcFreeCont
(
pShowRsp
);
mnodeReleaseShowObj
(
pShow
,
true
);
return
code
;
...
...
@@ -161,8 +162,7 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
pRetrieve
->
qhandle
=
htobe64
(
pRetrieve
->
qhandle
);
SShowObj
*
pShow
=
(
SShowObj
*
)
pRetrieve
->
qhandle
;
mTrace
(
"%p, show type:%s, retrieve data"
,
pShow
,
mnodeGetShowType
(
pShow
->
type
));
/*
* in case of server restart, apps may hold qhandle created by server before
* restart, which is actually invalid, therefore, signature check is required.
...
...
@@ -171,7 +171,10 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
mError
(
"%p, show is invalid"
,
pShow
);
return
TSDB_CODE_MND_INVALID_SHOWOBJ
;
}
mTrace
(
"%p, show type:%s index:%d, start retrieve data, numOfReads:%d numOfRows:%d"
,
pShow
,
mnodeGetShowType
(
pShow
->
type
),
pShow
->
index
,
pShow
->
numOfReads
,
pShow
->
numOfRows
);
if
(
mnodeCheckShowFinished
(
pShow
))
{
mTrace
(
"%p, show is already read finished, numOfReads:%d numOfRows:%d"
,
pShow
,
pShow
->
numOfReads
,
pShow
->
numOfRows
);
pShow
->
numOfReads
=
pShow
->
numOfRows
;
...
...
@@ -198,6 +201,9 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
if
((
pRetrieve
->
free
&
TSDB_QUERY_TYPE_FREE_RESOURCE
)
!=
TSDB_QUERY_TYPE_FREE_RESOURCE
)
rowsRead
=
(
*
tsMnodeShowRetrieveFp
[
pShow
->
type
])(
pShow
,
pRsp
->
data
,
rowsToRead
,
pMsg
->
rpcMsg
.
handle
);
mTrace
(
"%p, show type:%s index:%d, stop retrieve data, rowsRead:%d rowsToRead:%d"
,
pShow
,
mnodeGetShowType
(
pShow
->
type
),
pShow
->
index
,
rowsRead
,
rowsToRead
);
if
(
rowsRead
<
0
)
{
rpcFreeCont
(
pRsp
);
mnodeReleaseShowObj
(
pShow
,
false
);
...
...
@@ -211,7 +217,7 @@ static int32_t mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
pMsg
->
rpcRsp
.
rsp
=
pRsp
;
pMsg
->
rpcRsp
.
len
=
size
;
if
(
rowsToRead
==
0
||
(
rowsRead
==
rowsToRead
&&
pShow
->
numOfRows
-
pShow
->
numOfReads
==
rowsToRead
))
{
if
(
rowsToRead
==
0
||
(
rowsRead
==
rowsToRead
&&
pShow
->
numOfRows
==
pShow
->
numOfReads
))
{
pRsp
->
completed
=
1
;
mnodeReleaseShowObj
(
pShow
,
true
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录