Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
af5b304f
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看板
提交
af5b304f
编写于
3月 24, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-32] fix bugs in returning data to client
上级
e49bd8a7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
42 deletion
+30
-42
src/client/src/tscServer.c
src/client/src/tscServer.c
+7
-7
src/dnode/src/dnodeRead.c
src/dnode/src/dnodeRead.c
+15
-29
src/query/src/queryExecutor.c
src/query/src/queryExecutor.c
+5
-6
src/vnode/tsdb/src/tsdbRead.c
src/vnode/tsdb/src/tsdbRead.c
+3
-0
未找到文件。
src/client/src/tscServer.c
浏览文件 @
af5b304f
...
...
@@ -273,8 +273,8 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg) {
}
pSql
->
retry
=
0
;
pRes
->
rspLen
=
0
;
if
(
pRes
->
code
!=
TSDB_CODE_QUERY_CANCELLED
)
{
pRes
->
code
=
(
rpcMsg
->
code
!=
TSDB_CODE_SUCCESS
)
?
rpcMsg
->
code
:
TSDB_CODE_NETWORK_UNAVAIL
;
}
else
{
...
...
@@ -283,9 +283,9 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg) {
if
(
pRes
->
code
!=
TSDB_CODE_QUERY_CANCELLED
)
{
assert
(
rpcMsg
->
msgType
==
pCmd
->
msgType
+
1
);
pRes
->
code
=
(
int32_t
)
rpcMsg
->
code
;
pRes
->
code
=
rpcMsg
->
code
;
pRes
->
rspType
=
rpcMsg
->
msgType
;
pRes
->
rspLen
=
rpcMsg
->
contLen
;
pRes
->
rspLen
=
rpcMsg
->
contLen
;
char
*
tmp
=
(
char
*
)
realloc
(
pRes
->
pRsp
,
pRes
->
rspLen
);
if
(
tmp
==
NULL
)
{
...
...
@@ -389,7 +389,7 @@ int tscProcessSql(SSqlObj *pSql) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
STableMetaInfo
*
pTableMetaInfo
=
NULL
;
uint16_t
type
=
0
;
uint16_t
type
=
0
;
if
(
pQueryInfo
!=
NULL
)
{
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
...
...
@@ -2302,9 +2302,9 @@ int tscProcessRetrieveRspFromVnode(SSqlObj *pSql) {
pRes
->
numOfRows
=
htonl
(
pRetrieve
->
numOfRows
);
pRes
->
precision
=
htons
(
pRetrieve
->
precision
);
pRes
->
offset
=
htobe64
(
pRetrieve
->
offset
);
pRes
->
useconds
=
htobe64
(
pRetrieve
->
useconds
);
pRes
->
data
=
pRetrieve
->
data
;
pRes
->
offset
=
htobe64
(
pRetrieve
->
offset
);
pRes
->
useconds
=
htobe64
(
pRetrieve
->
useconds
);
pRes
->
data
=
pRetrieve
->
data
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
tscSetResultPointer
(
pQueryInfo
,
pRes
);
...
...
src/dnode/src/dnodeRead.c
浏览文件 @
af5b304f
...
...
@@ -254,7 +254,7 @@ static void dnodeProcessQueryMsg(SReadMsg *pMsg) {
static
void
dnodeProcessRetrieveMsg
(
SReadMsg
*
pMsg
)
{
SRetrieveTableMsg
*
pRetrieve
=
pMsg
->
pCont
;
void
*
pQInfo
=
htobe64
(
pRetrieve
->
qhandle
);
void
*
pQInfo
=
(
void
*
)
htobe64
(
pRetrieve
->
qhandle
);
dTrace
(
"QInfo:%p vgId:%d, retrieve msg is received"
,
pQInfo
,
pRetrieve
->
header
.
vgId
);
...
...
@@ -263,40 +263,26 @@ static void dnodeProcessRetrieveMsg(SReadMsg *pMsg) {
int32_t
contLen
=
0
;
SRpcMsg
rpcRsp
=
{
0
};
SRetrieveTableRsp
*
pRsp
=
NULL
;
int32_t
code
=
qRetrieveQueryResultInfo
(
pQInfo
,
&
numOfRows
,
&
rowSize
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
contLen
=
sizeof
(
SRetrieveTableRsp
);
SRetrieveTableRsp
*
pRsp
=
(
SRetrieveTableRsp
*
)
rpcMallocCont
(
contLen
);
pRsp
->
numOfRows
=
0
;
pRsp
->
precision
=
0
;
pRsp
->
offset
=
0
;
pRsp
->
useconds
=
0
;
rpcRsp
=
(
SRpcMsg
)
{
.
handle
=
pMsg
->
rpcMsg
.
handle
,
.
pCont
=
pRsp
,
.
contLen
=
contLen
,
.
code
=
code
,
.
msgType
=
0
};
//todo free qinfo
pRsp
=
(
SRetrieveTableRsp
*
)
rpcMallocCont
(
contLen
);
memset
(
pRsp
,
0
,
sizeof
(
SRetrieveTableRsp
));
}
else
{
SRetrieveTableRsp
*
pRsp
=
NULL
;
int32_t
code
=
qDumpRetrieveResult
(
pQInfo
,
&
pRsp
,
&
contLen
);
//todo check code
rpcRsp
=
(
SRpcMsg
)
{
.
handle
=
pMsg
->
rpcMsg
.
handle
,
.
pCont
=
pRsp
,
.
contLen
=
contLen
,
.
code
=
code
,
.
msgType
=
0
};
// todo check code and handle error in build result set
code
=
qDumpRetrieveResult
(
pQInfo
,
&
pRsp
,
&
contLen
);
}
rpcRsp
=
(
SRpcMsg
)
{
.
handle
=
pMsg
->
rpcMsg
.
handle
,
.
pCont
=
pRsp
,
.
contLen
=
contLen
,
.
code
=
code
,
.
msgType
=
0
};
rpcSendResponse
(
&
rpcRsp
);
}
src/query/src/queryExecutor.c
浏览文件 @
af5b304f
...
...
@@ -2698,10 +2698,8 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
int32_t
forwardStep
=
tableApplyFunctionsOnBlock
(
pRuntimeEnv
,
&
blockInfo
,
pStatis
,
binarySearchForKey
,
&
numOfRes
,
&
pRuntimeEnv
->
windowResInfo
,
pDataBlock
);
// dTrace("QInfo:%p check data block, brange:%" PRId64 "-%" PRId64 ", fileId:%d, slot:%d, pos:%d, rows:%d,
// checked:%d",
// GET_QINFO_ADDR(pQuery), blockInfo.window.skey, blockInfo.window.ekey, pQueryHandle->cur.fileId,
// pQueryHandle->cur.slot, pQuery->pos, blockInfo.size, forwardStep);
dTrace
(
"QInfo:%p check data block, brange:%"
PRId64
"-%"
PRId64
", rows:%d"
,
GET_QINFO_ADDR
(
pRuntimeEnv
),
blockInfo
.
window
.
skey
,
blockInfo
.
window
.
ekey
,
blockInfo
.
size
);
// save last access position
cnt
+=
forwardStep
;
...
...
@@ -6189,12 +6187,13 @@ int32_t qRetrieveQueryResultInfo(SQInfo *pQInfo, int32_t *numOfRows, int32_t *ro
}
sem_wait
(
&
pQInfo
->
dataReady
);
SQuery
*
pQuery
=
pQInfo
->
runtimeEnv
.
pQuery
;
*
numOfRows
=
pQInfo
->
rec
.
pointsRead
;
*
rowsize
=
pQuery
->
rowSize
;
dTrace
(
"QInfo:%p
, retrieve res
info, rowsize:%d, rows:%d, code:%d"
,
pQInfo
,
*
rowsize
,
*
numOfRows
,
pQInfo
->
code
);
dTrace
(
"QInfo:%p
retrieve result
info, rowsize:%d, rows:%d, code:%d"
,
pQInfo
,
*
rowsize
,
*
numOfRows
,
pQInfo
->
code
);
if
(
pQInfo
->
code
<
0
)
{
// less than 0 means there are error existed.
return
-
pQInfo
->
code
;
...
...
src/vnode/tsdb/src/tsdbRead.c
浏览文件 @
af5b304f
...
...
@@ -379,6 +379,9 @@ SDataBlockInfo tsdbRetrieveDataBlockInfo(tsdb_query_handle_t *pQueryHandle) {
.
window
=
{.
skey
=
skey
,
.
ekey
=
ekey
}
};
// update the last key value
pHandle
->
pTableQueryInfo
->
lastKey
=
ekey
+
1
;
return
blockInfo
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录