Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
65f53993
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
65f53993
编写于
7月 06, 2022
作者:
H
Haojun Liao
提交者:
GitHub
7月 06, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14606 from taosdata/feature/3_liaohj
fix(query): set results for local query in async APIs.
上级
7aebf056
1e18ba19
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
17 deletion
+21
-17
include/libs/command/command.h
include/libs/command/command.h
+4
-1
source/client/src/clientMain.c
source/client/src/clientMain.c
+17
-11
source/libs/command/src/command.c
source/libs/command/src/command.c
+0
-2
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+0
-3
未找到文件。
include/libs/command/command.h
浏览文件 @
65f53993
...
...
@@ -13,6 +13,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_COMMAND_H
#define TDENGINE_COMMAND_H
#include "cmdnodes.h"
#include "tmsg.h"
#include "plannodes.h"
...
...
@@ -27,4 +30,4 @@ int32_t qExecExplainEnd(SExplainCtx *pCtx, SRetrieveTableRsp **pRsp);
int32_t
qExplainUpdateExecInfo
(
SExplainCtx
*
pCtx
,
SExplainRsp
*
pRspMsg
,
int32_t
groupId
,
SRetrieveTableRsp
**
pRsp
);
void
qExplainFreeCtx
(
SExplainCtx
*
pCtx
);
#endif
source/client/src/clientMain.c
浏览文件 @
65f53993
...
...
@@ -843,19 +843,25 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
pRequest
->
body
.
param
=
param
;
SReqResultInfo
*
pResultInfo
=
&
pRequest
->
body
.
resInfo
;
if
(
taos_num_fields
(
pRequest
)
==
0
)
{
// this query has no results or error exists, return directly
if
(
taos_num_fields
(
pRequest
)
==
0
||
pRequest
->
code
!=
TSDB_CODE_SUCCESS
)
{
pResultInfo
->
numOfRows
=
0
;
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
return
;
}
if
(
pResultInfo
->
pData
==
NULL
||
pResultInfo
->
current
>=
pResultInfo
->
numOfRows
)
{
// All data has returned to App already, no need to try again
if
(
pResultInfo
->
completed
)
{
pResultInfo
->
numOfRows
=
0
;
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
return
;
}
// all data has returned to App already, no need to try again
if
((
pResultInfo
->
pData
==
NULL
||
pResultInfo
->
current
>=
pResultInfo
->
numOfRows
)
&&
pResultInfo
->
completed
)
{
pResultInfo
->
numOfRows
=
0
;
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
return
;
}
// it is a local executed query, no need to do async fetch
if
(
pResultInfo
->
current
<
pResultInfo
->
numOfRows
&&
pRequest
->
body
.
queryJob
==
0
)
{
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
return
;
}
SSchedulerReq
req
=
{
...
...
@@ -869,14 +875,14 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
void
taos_fetch_raw_block_a
(
TAOS_RES
*
res
,
__taos_async_fn_t
fp
,
void
*
param
)
{
ASSERT
(
res
!=
NULL
&&
fp
!=
NULL
);
ASSERT
(
TD_RES_QUERY
(
res
));
SRequestObj
*
pRequest
=
res
;
pRequest
->
body
.
resInfo
.
convertUcs4
=
false
;
SRequestObj
*
pRequest
=
res
;
SReqResultInfo
*
pResultInfo
=
&
pRequest
->
body
.
resInfo
;
// set the current block is all consumed
pResultInfo
->
current
=
pResultInfo
->
numOfRows
;
pResultInfo
->
convertUcs4
=
false
;
taos_fetch_rows_a
(
res
,
fp
,
param
);
}
...
...
source/libs/command/src/command.c
浏览文件 @
65f53993
...
...
@@ -565,7 +565,6 @@ static int32_t createSelectResultDataBlock(SNodeList* pProjects, SSDataBlock** p
}
int32_t
buildSelectResultDataBlock
(
SNodeList
*
pProjects
,
SSDataBlock
*
pBlock
)
{
int32_t
numOfCols
=
LIST_LENGTH
(
pProjects
);
blockDataEnsureCapacity
(
pBlock
,
1
);
int32_t
index
=
0
;
...
...
@@ -579,7 +578,6 @@ int32_t buildSelectResultDataBlock(SNodeList* pProjects, SSDataBlock* pBlock) {
}
pBlock
->
info
.
rows
=
1
;
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
65f53993
...
...
@@ -13,13 +13,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalog.h"
#include "command.h"
#include "query.h"
#include "schInt.h"
#include "tmsg.h"
#include "tref.h"
#include "trpc.h"
SSchedulerMgmt
schMgmt
=
{
.
jobRef
=
-
1
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录