Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5f376274
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看板
提交
5f376274
编写于
3月 12, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-13039] fix bug in project query.
上级
c62dfe64
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
10 deletion
+25
-10
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+2
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+23
-9
未找到文件。
source/libs/executor/inc/executorimpl.h
浏览文件 @
5f376274
...
...
@@ -334,9 +334,10 @@ typedef struct SOperatorInfo {
struct
SOperatorInfo
**
pDownstream
;
// downstram pointer list
int32_t
numOfDownstream
;
// number of downstream. The value is always ONE expect for join operator
__optr_open_fn_t
openFn
;
__optr_fn_t
getNextFn
;
__optr_fn_t
cleanupFn
;
__optr_close_fn_t
closeFn
;
__optr_open_fn_t
_openFn
;
// DO NOT invoke this function directly
}
SOperatorInfo
;
typedef
struct
{
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
5f376274
...
...
@@ -224,9 +224,12 @@ static void doSetOperatorCompleted(SOperatorInfo* pOperator) {
}
}
#define OPTR_IS_OPENED(_optr) (((_optr)->status & OP_OPENED) == OP_OPENED)
#define OPTR_SET_OPENED(_optr) ((_optr)->status |= OP_OPENED)
static
int32_t
operatorDummyOpenFn
(
void
*
param
)
{
SOperatorInfo
*
pOperator
=
(
SOperatorInfo
*
)
param
;
pOperator
->
status
=
OP_OPENED
;
OPTR_SET_OPENED
(
pOperator
)
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -4734,6 +4737,11 @@ static SSDataBlock* doTableScan(void* param, bool *newgroup) {
STableScanInfo
*
pTableScanInfo
=
pOperator
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
pTaskInfo
->
code
=
pOperator
->
_openFn
(
pOperator
);
if
(
pTaskInfo
->
code
!=
TSDB_CODE_SUCCESS
)
{
return
NULL
;
}
// The read handle is not initialized yet, since no qualified tables exists
if
(
pTableScanInfo
->
pTsdbReadHandle
==
NULL
)
{
return
NULL
;
...
...
@@ -4851,6 +4859,11 @@ static SSDataBlock* doStreamBlockScan(void* param, bool* newgroup) {
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SStreamBlockScanInfo
*
pInfo
=
pOperator
->
info
;
pTaskInfo
->
code
=
pOperator
->
_openFn
(
pOperator
);
if
(
pTaskInfo
->
code
!=
TSDB_CODE_SUCCESS
)
{
return
NULL
;
}
SDataBlockInfo
*
pBlockInfo
=
&
pInfo
->
pRes
->
info
;
pBlockInfo
->
rows
=
0
;
...
...
@@ -5159,7 +5172,7 @@ static SSDataBlock* seqLoadRemoteData(SOperatorInfo *pOperator) {
static
int32_t
prepareLoadRemoteData
(
void
*
param
)
{
SOperatorInfo
*
pOperator
=
(
SOperatorInfo
*
)
param
;
if
(
(
pOperator
->
status
&
OP_OPENED
)
==
OP_OPENED
)
{
if
(
OPTR_IS_OPENED
(
pOperator
)
)
{
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -5173,7 +5186,7 @@ static int32_t prepareLoadRemoteData(void* param) {
}
}
pOperator
->
status
=
OP_OPENED
;
OPTR_SET_OPENED
(
pOperator
)
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -5183,12 +5196,13 @@ static SSDataBlock* doLoadRemoteData(void* param, bool* newgroup) {
SExchangeInfo
*
pExchangeInfo
=
pOperator
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
size_t
totalSources
=
taosArrayGetSize
(
pExchangeInfo
->
pSources
);
if
(
(
pOperator
->
status
&
OP_OPENED
)
!=
OP_OPENED
)
{
pTaskInfo
->
code
=
TSDB_CODE_QRY_IN_EXEC
;
// TODO add a new error code
int32_t
code
=
pOperator
->
_openFn
(
pOperator
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pTaskInfo
->
code
=
code
;
return
NULL
;
}
size_t
totalSources
=
taosArrayGetSize
(
pExchangeInfo
->
pSources
);
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
qDebug
(
"%s all %"
PRIzu
" source(s) are exhausted, total rows:%"
PRIu64
" bytes:%"
PRIu64
", elapsed:%.2f ms"
,
GET_TASKID
(
pTaskInfo
),
totalSources
,
pExchangeInfo
->
totalRows
,
pExchangeInfo
->
totalSize
,
pExchangeInfo
->
totalElapsed
/
1000
.
0
);
...
...
@@ -5286,7 +5300,7 @@ SOperatorInfo* createExchangeOperatorInfo(const SNodeList* pSources, SSDataBlock
pOperator
->
info
=
pInfo
;
pOperator
->
numOfOutput
=
size
;
pOperator
->
pTaskInfo
=
pTaskInfo
;
pOperator
->
openFn
=
prepareLoadRemoteData
;
// assign a dummy function.
pOperator
->
_openFn
=
prepareLoadRemoteData
;
// assign a dummy function.
pOperator
->
getNextFn
=
doLoadRemoteData
;
pOperator
->
closeFn
=
destroyExchangeOperatorInfo
;
...
...
@@ -5377,7 +5391,7 @@ SOperatorInfo* createTableScanOperatorInfo(void* pTsdbReadHandle, int32_t order,
pOperator
->
status
=
OP_NOT_OPENED
;
pOperator
->
info
=
pInfo
;
pOperator
->
numOfOutput
=
numOfOutput
;
pOperator
->
openFn
=
operatorDummyOpenFn
;
pOperator
->
_openFn
=
operatorDummyOpenFn
;
pOperator
->
getNextFn
=
doTableScan
;
pOperator
->
closeFn
=
operatorDummyCloseFn
;
pOperator
->
pTaskInfo
=
pTaskInfo
;
...
...
@@ -5461,7 +5475,7 @@ SOperatorInfo* createStreamScanOperatorInfo(void *streamReadHandle, SSDataBlock*
pOperator
->
status
=
OP_NOT_OPENED
;
pOperator
->
info
=
pInfo
;
pOperator
->
numOfOutput
=
pResBlock
->
info
.
numOfCols
;
pOperator
->
openFn
=
operatorDummyOpenFn
;
pOperator
->
_openFn
=
operatorDummyOpenFn
;
pOperator
->
getNextFn
=
doStreamBlockScan
;
pOperator
->
closeFn
=
operatorDummyCloseFn
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录