Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fb34af91
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
fb34af91
编写于
2月 14, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
serialize retrieve request
上级
b5099117
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
17 deletion
+23
-17
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+8
-7
source/dnode/mgmt/impl/test/sut/src/sut.cpp
source/dnode/mgmt/impl/test/sut/src/sut.cpp
+7
-5
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+8
-5
未找到文件。
source/client/src/clientMsgHandler.c
浏览文件 @
fb34af91
...
...
@@ -97,14 +97,15 @@ SMsgSendInfo* buildMsgInfoImpl(SRequestObj *pRequest) {
if
(
pRequest
->
type
==
TDMT_MND_SHOW_RETRIEVE
||
pRequest
->
type
==
TDMT_VND_SHOW_TABLES_FETCH
)
{
if
(
pRequest
->
type
==
TDMT_MND_SHOW_RETRIEVE
)
{
SRetrieveTableReq
*
pRetrieveMsg
=
calloc
(
1
,
sizeof
(
SRetrieveTableReq
));
if
(
pRetrieveMsg
==
NULL
)
{
return
NULL
;
}
SRetrieveTableReq
retrieveReq
=
{
0
};
retrieveReq
.
showId
=
pRequest
->
body
.
showInfo
.
execId
;
int32_t
contLen
=
tSerializeSRetrieveTableReq
(
NULL
,
0
,
&
retrieveReq
);
void
*
pReq
=
malloc
(
contLen
);
tSerializeSRetrieveTableReq
(
pReq
,
contLen
,
&
retrieveReq
);
pRetrieveMsg
->
showId
=
htobe64
(
pRequest
->
body
.
showInfo
.
execId
);
pMsgSendInfo
->
msgInfo
.
pData
=
pRetrieveMsg
;
pMsgSendInfo
->
msgInfo
.
len
=
sizeof
(
SRetrieveTableReq
);
pMsgSendInfo
->
msgInfo
.
pData
=
pReq
;
pMsgSendInfo
->
msgInfo
.
len
=
contLen
;
}
else
{
SVShowTablesFetchReq
*
pFetchMsg
=
calloc
(
1
,
sizeof
(
SVShowTablesFetchReq
));
if
(
pFetchMsg
==
NULL
)
{
...
...
source/dnode/mgmt/impl/test/sut/src/sut.cpp
浏览文件 @
fb34af91
...
...
@@ -132,13 +132,15 @@ int32_t Testbase::GetMetaNum() { return pMeta->numOfColumns; }
const
char
*
Testbase
::
GetMetaTbName
()
{
return
pMeta
->
tbName
;
}
void
Testbase
::
SendShowRetrieveReq
()
{
int32_t
contLen
=
sizeof
(
SRetrieveTableReq
);
SRetrieveTableReq
retrieveReq
=
{
0
};
retrieveReq
.
showId
=
showId
;
retrieveReq
.
free
=
0
;
SRetrieveTableReq
*
pRetrieve
=
(
SRetrieveTableReq
*
)
rpcMallocCont
(
contLen
);
pRetrieve
->
showId
=
htobe64
(
showId
);
pRetrieve
->
free
=
0
;
int32_t
contLen
=
tSerializeSRetrieveTableReq
(
NULL
,
0
,
&
retrieveReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeSRetrieveTableReq
(
pReq
,
contLen
,
&
retrieveReq
)
;
SRpcMsg
*
pRsp
=
SendReq
(
TDMT_MND_SHOW_RETRIEVE
,
pRe
trieve
,
contLen
);
SRpcMsg
*
pRsp
=
SendReq
(
TDMT_MND_SHOW_RETRIEVE
,
pRe
q
,
contLen
);
pRetrieveRsp
=
(
SRetrieveTableRsp
*
)
pRsp
->
pCont
;
pRetrieveRsp
->
numOfRows
=
htonl
(
pRetrieveRsp
->
numOfRows
);
pRetrieveRsp
->
useconds
=
htobe64
(
pRetrieveRsp
->
useconds
);
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
fb34af91
...
...
@@ -180,10 +180,13 @@ static int32_t mndProcessRetrieveReq(SMnodeMsg *pReq) {
int32_t
size
=
0
;
int32_t
rowsRead
=
0
;
SRetrieveTableReq
*
pRetrieve
=
pReq
->
rpcMsg
.
pCont
;
int64_t
showId
=
htobe64
(
pRetrieve
->
showId
);
SRetrieveTableReq
retrieveReq
=
{
0
};
if
(
tDeserializeSRetrieveTableReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
retrieveReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
SShowObj
*
pShow
=
mndAcquireShowObj
(
pMnode
,
showId
);
SShowObj
*
pShow
=
mndAcquireShowObj
(
pMnode
,
retrieveReq
.
showId
);
if
(
pShow
==
NULL
)
{
terrno
=
TSDB_CODE_MND_INVALID_SHOWOBJ
;
mError
(
"failed to process show-retrieve req:%p since %s"
,
pShow
,
terrstr
());
...
...
@@ -207,7 +210,7 @@ static int32_t mndProcessRetrieveReq(SMnodeMsg *pReq) {
pShow
->
numOfReads
=
pShow
->
numOfRows
;
}
if
((
pRetrieve
->
free
&
TSDB_QUERY_TYPE_FREE_RESOURCE
)
!=
TSDB_QUERY_TYPE_FREE_RESOURCE
)
{
if
((
retrieveReq
.
free
&
TSDB_QUERY_TYPE_FREE_RESOURCE
)
!=
TSDB_QUERY_TYPE_FREE_RESOURCE
)
{
rowsToRead
=
pShow
->
numOfRows
-
pShow
->
numOfReads
;
}
...
...
@@ -231,7 +234,7 @@ static int32_t mndProcessRetrieveReq(SMnodeMsg *pReq) {
}
// if free flag is set, client wants to clean the resources
if
((
pRetrieve
->
free
&
TSDB_QUERY_TYPE_FREE_RESOURCE
)
!=
TSDB_QUERY_TYPE_FREE_RESOURCE
)
{
if
((
retrieveReq
.
free
&
TSDB_QUERY_TYPE_FREE_RESOURCE
)
!=
TSDB_QUERY_TYPE_FREE_RESOURCE
)
{
rowsRead
=
(
*
retrieveFp
)(
pReq
,
pShow
,
pRsp
->
data
,
rowsToRead
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录