Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ddc4a966
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ddc4a966
编写于
5月 07, 2022
作者:
H
Haojun Liao
提交者:
GitHub
5月 07, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12177 from taosdata/feature/3.0_liaohj
fix(query): add some check for null pointer.
上级
dcfa1dcf
2b803d8b
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
31 addition
and
19 deletion
+31
-19
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-2
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+6
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+17
-14
source/libs/executor/src/sortoperator.c
source/libs/executor/src/sortoperator.c
+4
-0
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+1
-1
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
ddc4a966
...
...
@@ -126,7 +126,7 @@ int tqReadHandleSetTbUidList(STqReadHandle *pHandle, const SArray *tbUidList
int
tqReadHandleAddTbUidList
(
STqReadHandle
*
pHandle
,
const
SArray
*
tbUidList
);
int32_t
tqReadHandleSetMsg
(
STqReadHandle
*
pHandle
,
SSubmitReq
*
pMsg
,
int64_t
ver
);
bool
tqNextDataBlock
(
STqReadHandle
*
pHandle
);
int32_t
tqRetrieveDataBlock
(
SArray
**
ppCols
,
STqReadHandle
*
pHandle
,
uint64_t
*
pGroupId
,
int32_t
*
pNumOfRows
,
int32_t
tqRetrieveDataBlock
(
SArray
**
ppCols
,
STqReadHandle
*
pHandle
,
uint64_t
*
pGroupId
,
uint64_t
*
pUid
,
int32_t
*
pNumOfRows
,
int16_t
*
pNumOfCols
);
// need to reposition
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
ddc4a966
...
...
@@ -161,7 +161,7 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
tqReadHandleSetMsg
(
pReader
,
pReq
,
0
);
while
(
tqNextDataBlock
(
pReader
))
{
SSDataBlock
block
=
{
0
};
if
(
tqRetrieveDataBlock
(
&
block
.
pDataBlock
,
pReader
,
&
block
.
info
.
groupId
,
&
block
.
info
.
rows
,
if
(
tqRetrieveDataBlock
(
&
block
.
pDataBlock
,
pReader
,
&
block
.
info
.
groupId
,
&
block
.
info
.
uid
,
&
block
.
info
.
rows
,
&
block
.
info
.
numOfCols
)
<
0
)
{
ASSERT
(
0
);
}
...
...
@@ -540,7 +540,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
tqReadHandleSetMsg
(
pReader
,
pCont
,
0
);
while
(
tqNextDataBlock
(
pReader
))
{
SSDataBlock
block
=
{
0
};
if
(
tqRetrieveDataBlock
(
&
block
.
pDataBlock
,
pReader
,
&
block
.
info
.
groupId
,
&
block
.
info
.
rows
,
if
(
tqRetrieveDataBlock
(
&
block
.
pDataBlock
,
pReader
,
&
block
.
info
.
groupId
,
&
block
.
info
.
uid
,
&
block
.
info
.
rows
,
&
block
.
info
.
numOfCols
)
<
0
)
{
ASSERT
(
0
);
}
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
ddc4a966
...
...
@@ -84,10 +84,12 @@ bool tqNextDataBlock(STqReadHandle* pHandle) {
return
false
;
}
int32_t
tqRetrieveDataBlock
(
SArray
**
ppCols
,
STqReadHandle
*
pHandle
,
uint64_t
*
pGroupId
,
int32_t
*
pNumOfRows
,
int32_t
tqRetrieveDataBlock
(
SArray
**
ppCols
,
STqReadHandle
*
pHandle
,
uint64_t
*
pGroupId
,
uint64_t
*
pUid
,
int32_t
*
pNumOfRows
,
int16_t
*
pNumOfCols
)
{
/*int32_t sversion = pHandle->pBlock->sversion;*/
// TODO set to real sversion
*
pUid
=
0
;
int32_t
sversion
=
0
;
if
(
pHandle
->
sver
!=
sversion
)
{
pHandle
->
pSchema
=
metaGetTbTSchema
(
pHandle
->
pVnodeMeta
,
pHandle
->
msgIter
.
uid
,
sversion
);
...
...
@@ -169,7 +171,10 @@ int32_t tqRetrieveDataBlock(SArray** ppCols, STqReadHandle* pHandle, uint64_t* p
tdSTSRowIterInit
(
&
iter
,
pTschema
);
STSRow
*
row
;
int32_t
curRow
=
0
;
tInitSubmitBlkIter
(
&
pHandle
->
msgIter
,
pHandle
->
pBlock
,
&
pHandle
->
blkIter
);
*
pUid
=
pHandle
->
pBlock
->
uid
;
// set the uid of table for submit block
while
((
row
=
tGetSubmitBlkNext
(
&
pHandle
->
blkIter
))
!=
NULL
)
{
tdSTSRowIterReset
(
&
iter
,
row
);
// get all wanted col of that block
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
ddc4a966
...
...
@@ -539,10 +539,12 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
while
(
tqNextDataBlock
(
pInfo
->
readerHandle
))
{
SArray
*
pCols
=
NULL
;
uint64_t
groupId
;
int32_t
numOfRows
;
int16_t
outputCol
;
int32_t
code
=
tqRetrieveDataBlock
(
&
pCols
,
pInfo
->
readerHandle
,
&
groupId
,
&
numOfRows
,
&
outputCol
);
uint64_t
groupId
=
0
;
uint64_t
uid
=
0
;
int32_t
numOfRows
=
0
;
int16_t
outputCol
=
0
;
int32_t
code
=
tqRetrieveDataBlock
(
&
pCols
,
pInfo
->
readerHandle
,
&
groupId
,
&
uid
,
&
numOfRows
,
&
outputCol
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
numOfRows
==
0
)
{
pTaskInfo
->
code
=
code
;
...
...
@@ -551,6 +553,7 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
pInfo
->
pRes
->
info
.
groupId
=
groupId
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
uid
=
uid
;
int32_t
numOfCols
=
pInfo
->
pRes
->
info
.
numOfCols
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
...
...
@@ -606,10 +609,8 @@ SOperatorInfo* createStreamScanOperatorInfo(void* streamReadHandle, SSDataBlock*
SStreamBlockScanInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamBlockScanInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pOperator
);
terrno
=
TSDB_CODE_QRY_OUT_OF_MEMORY
;
return
NULL
;
goto
_error
;
}
int32_t
numOfOutput
=
taosArrayGetSize
(
pColList
);
...
...
@@ -626,16 +627,13 @@ SOperatorInfo* createStreamScanOperatorInfo(void* streamReadHandle, SSDataBlock*
tqReadHandleSetColIdList
((
STqReadHandle
*
)
streamReadHandle
,
pColIds
);
int32_t
code
=
tqReadHandleSetTbUidList
(
streamReadHandle
,
pTableIdList
);
if
(
code
!=
0
)
{
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pOperator
);
return
NULL
;
goto
_error
;
}
pInfo
->
pBlockLists
=
taosArrayInit
(
4
,
POINTER_BYTES
);
if
(
pInfo
->
pBlockLists
==
NULL
)
{
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pOperator
);
return
NULL
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_error
;
}
pInfo
->
readerHandle
=
streamReadHandle
;
...
...
@@ -656,6 +654,11 @@ SOperatorInfo* createStreamScanOperatorInfo(void* streamReadHandle, SSDataBlock*
pOperator
->
fpSet
=
createOperatorFpSet
(
operatorDummyOpenFn
,
doStreamBlockScan
,
NULL
,
NULL
,
operatorDummyCloseFn
,
NULL
,
NULL
,
NULL
);
return
pOperator
;
_error:
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pOperator
);
return
NULL
;
}
static
void
destroySysScanOperator
(
void
*
param
,
int32_t
numOfOutput
)
{
...
...
source/libs/executor/src/sortoperator.c
浏览文件 @
ddc4a966
...
...
@@ -67,6 +67,10 @@ SSDataBlock* getSortedBlockData(SSortHandle* pHandle, SSDataBlock* pDataBlock, i
ASSERT
(
taosArrayGetSize
(
pColMatchInfo
)
==
pDataBlock
->
info
.
numOfCols
);
SSDataBlock
*
p
=
tsortGetSortedDataBlock
(
pHandle
);
if
(
p
==
NULL
)
{
return
NULL
;
}
blockDataEnsureCapacity
(
p
,
capacity
);
while
(
1
)
{
...
...
source/libs/executor/src/tsort.c
浏览文件 @
ddc4a966
...
...
@@ -553,7 +553,7 @@ static int32_t createInitialSortedMultiSources(SSortHandle* pHandle) {
}
}
if
(
pHandle
->
pDataBlock
->
info
.
rows
>
0
)
{
if
(
pHandle
->
pDataBlock
!=
NULL
&&
pHandle
->
pDataBlock
->
info
.
rows
>
0
)
{
size_t
size
=
blockDataGetSize
(
pHandle
->
pDataBlock
);
// Perform the in-memory sort and then flush data in the buffer into disk.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录