Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
74305814
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
74305814
编写于
10月 19, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix coverity issues.
上级
2e4dca11
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
60 addition
and
22 deletion
+60
-22
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+5
-0
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+1
-0
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+6
-0
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+3
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-0
source/libs/executor/src/groupoperator.c
source/libs/executor/src/groupoperator.c
+7
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+22
-9
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+3
-1
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+10
-7
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+2
-1
未找到文件。
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
74305814
...
...
@@ -687,7 +687,12 @@ int32_t metaGetTbTSchemaEx(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sv
SSchema
*
pSchema
=
pSchemaWrapper
->
pSchema
+
i
;
tdAddColToSchema
(
&
sb
,
pSchema
->
type
,
pSchema
->
flags
,
pSchema
->
colId
,
pSchema
->
bytes
);
}
STSchema
*
pTSchema
=
tdGetSchemaFromBuilder
(
&
sb
);
if
(
pTSchema
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
tdDestroyTSchemaBuilder
(
&
sb
);
*
ppTSchema
=
pTSchema
;
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
74305814
...
...
@@ -84,6 +84,7 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, SArray* pTableIdList
p
->
transferBuf
=
taosMemoryCalloc
(
p
->
pSchema
->
numOfCols
,
POINTER_BYTES
);
if
(
p
->
transferBuf
==
NULL
)
{
tsdbCacherowsReaderClose
(
p
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
74305814
...
...
@@ -2554,6 +2554,12 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
pScanInfo
=
pReader
->
status
.
pTableIter
;
}
if
(
pScanInfo
==
NULL
)
{
tsdbError
(
"failed to get table, uid:"
PRIu64
", %s"
,
pBlockInfo
->
uid
,
pReader
->
idStr
);
code
=
TSDB_CODE_INVALID_PARA
;
return
code
;
}
if
(
pBlockInfo
!=
NULL
)
{
pBlock
=
getCurrentBlock
(
pBlockIter
);
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
74305814
...
...
@@ -250,6 +250,7 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo
qDebug
(
" %d qualified child tables added into stream scanner"
,
(
int32_t
)
taosArrayGetSize
(
qa
));
code
=
tqReaderAddTbUidList
(
pScanInfo
->
tqReader
,
qa
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
taosArrayDestroy
(
qa
);
return
code
;
}
...
...
@@ -261,6 +262,7 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo
assignUid
=
groupbyTbname
(
pScanInfo
->
pGroupTags
);
keyBuf
=
taosMemoryMalloc
(
bufLen
);
if
(
keyBuf
==
NULL
)
{
taosArrayDestroy
(
qa
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
...
@@ -277,6 +279,7 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo
&
keyInfo
.
groupId
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
taosMemoryFree
(
keyBuf
);
taosArrayDestroy
(
qa
);
return
code
;
}
}
...
...
@@ -298,8 +301,6 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo
taosHashPut
(
pTaskInfo
->
tableqinfoList
.
map
,
uid
,
sizeof
(
*
uid
),
&
keyInfo
.
groupId
,
sizeof
(
keyInfo
.
groupId
));
}
/*}*/
if
(
keyBuf
!=
NULL
)
{
taosMemoryFree
(
keyBuf
);
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
74305814
...
...
@@ -462,6 +462,7 @@ static int32_t doCreateConstantValColumnInfo(SInputColumnInfoData* pInput, SFunc
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
++
i
)
{
colDataAppend
(
pColInfo
,
i
,
tmp
,
false
);
}
taosMemoryFree
(
tmp
);
}
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/executor/src/groupoperator.c
浏览文件 @
74305814
...
...
@@ -757,7 +757,6 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
goto
_error
;
}
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pPartNode
->
node
.
pOutputDataBlockDesc
);
int32_t
numOfCols
=
0
;
SExprInfo
*
pExprInfo
=
createExprInfo
(
pPartNode
->
pTargets
,
NULL
,
&
numOfCols
);
...
...
@@ -781,14 +780,18 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
uint32_t
defaultPgsz
=
0
;
uint32_t
defaultBufsz
=
0
;
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pPartNode
->
node
.
pOutputDataBlockDesc
);
getBufferPgSize
(
pResBlock
->
info
.
rowSize
,
&
defaultPgsz
,
&
defaultBufsz
);
if
(
!
osTempSpaceAvailable
())
{
terrno
=
TSDB_CODE_NO_AVAIL_DISK
;
pTaskInfo
->
code
=
terrno
;
qError
(
"Create partition operator info failed since %s"
,
terrstr
(
terrno
));
blockDataDestroy
(
pResBlock
);
goto
_error
;
}
int32_t
code
=
createDiskbasedBuf
(
&
pInfo
->
pBuf
,
defaultPgsz
,
defaultBufsz
,
pTaskInfo
->
id
.
str
,
tsTempDir
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
...
...
@@ -819,7 +822,9 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
_error:
pTaskInfo
->
code
=
TSDB_CODE_OUT_OF_MEMORY
;
taosMemoryFreeClear
(
pInfo
);
if
(
pInfo
!=
NULL
)
{
destroyPartitionOperatorInfo
(
pInfo
);
}
taosMemoryFreeClear
(
pOperator
);
return
NULL
;
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
74305814
...
...
@@ -737,7 +737,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
SDataBlockDescNode
*
pDescNode
=
pTableScanNode
->
scan
.
node
.
pOutputDataBlockDesc
;
int32_t
numOfCols
=
0
;
SArray
*
pColList
=
extractColMatchInfo
(
pTableScanNode
->
scan
.
pScanCols
,
pDescNode
,
&
numOfCols
,
COL_MATCH_FROM_COL_ID
);
pInfo
->
pColMatchInfo
=
extractColMatchInfo
(
pTableScanNode
->
scan
.
pScanCols
,
pDescNode
,
&
numOfCols
,
COL_MATCH_FROM_COL_ID
);
int32_t
code
=
initQueryTableDataCond
(
&
pInfo
->
cond
,
pTableScanNode
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -765,7 +765,6 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
}
pInfo
->
scanFlag
=
MAIN_SCAN
;
pInfo
->
pColMatchInfo
=
pColList
;
pInfo
->
currentGroupId
=
-
1
;
pInfo
->
assignBlockUid
=
pTableScanNode
->
assignBlockUid
;
...
...
@@ -1769,8 +1768,9 @@ FETCH_NEXT_BLOCK:
generateDeleteResultBlock
(
pInfo
,
pDelBlock
,
pInfo
->
pDeleteDataRes
);
pInfo
->
pDeleteDataRes
->
info
.
type
=
STREAM_DELETE_RESULT
;
printDataBlock
(
pDelBlock
,
"stream scan delete result"
);
blockDataDestroy
(
pDelBlock
);
if
(
pInfo
->
pDeleteDataRes
->
info
.
rows
>
0
)
{
blockDataDestroy
(
pDelBlock
);
return
pInfo
->
pDeleteDataRes
;
}
else
{
goto
FETCH_NEXT_BLOCK
;
...
...
@@ -2091,24 +2091,30 @@ SOperatorInfo* createRawScanOperatorInfo(SReadHandle* pHandle, SExecTaskInfo* pT
// create meta reader
// create tq reader
int32_t
code
=
TSDB_CODE_SUCCESS
;
SStreamRawScanInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamRawScanInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
terrno
=
TSDB_CODE_QRY
_OUT_OF_MEMORY
;
return
NULL
;
code
=
TSDB_CODE
_OUT_OF_MEMORY
;
goto
_end
;
}
pInfo
->
vnode
=
pHandle
->
vnode
;
pInfo
->
sContext
=
pHandle
->
sContext
;
pOperator
->
name
=
"RawStreamScanOperator"
;
// pOperator->blocking = false;
// pOperator->status = OP_NOT_OPENED;
pOperator
->
info
=
pInfo
;
pOperator
->
pTaskInfo
=
pTaskInfo
;
pOperator
->
fpSet
=
createOperatorFpSet
(
NULL
,
doRawScan
,
NULL
,
NULL
,
destroyRawScanOperatorInfo
,
NULL
,
NULL
,
NULL
);
return
pOperator
;
_end:
taosMemoryFree
(
pInfo
);
taosMemoryFree
(
pOperator
);
pTaskInfo
->
code
=
code
;
return
NULL
;
}
static
void
destroyStreamScanOperatorInfo
(
void
*
param
)
{
...
...
@@ -2286,7 +2292,14 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys
return
pOperator
;
_error:
taosMemoryFreeClear
(
pInfo
);
if
(
pColIds
!=
NULL
)
{
taosArrayDestroy
(
pColIds
);
}
if
(
pInfo
!=
NULL
)
{
destroyStreamScanOperatorInfo
(
pInfo
);
}
taosMemoryFreeClear
(
pOperator
);
return
NULL
;
}
...
...
@@ -3334,7 +3347,7 @@ int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags
int64_t
st
=
taosGetTimestampUs
();
if
(
pHandle
==
NULL
)
{
qError
(
"invalid handle, in creating operator tree"
,
idStr
);
qError
(
"invalid handle, in creating operator tree
, %s
"
,
idStr
);
return
TSDB_CODE_INVALID_PARA
;
}
...
...
source/libs/executor/src/tfill.c
浏览文件 @
74305814
...
...
@@ -467,9 +467,11 @@ struct SFillInfo* taosCreateFillInfo(TSKEY skey, int32_t numOfFillCols, int32_t
case
FILL_MODE_VALUE
:
pFillInfo
->
type
=
TSDB_FILL_SET_VALUE
;
break
;
default:
default:
{
taosMemoryFree
(
pFillInfo
);
terrno
=
TSDB_CODE_INVALID_PARA
;
return
NULL
;
}
}
pFillInfo
->
type
=
fillType
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
74305814
...
...
@@ -2774,14 +2774,13 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWi
int32_t
num
=
0
;
SExprInfo
*
pExprInfo
=
createExprInfo
(
pStateNode
->
window
.
pFuncs
,
NULL
,
&
num
);
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pStateNode
->
window
.
node
.
pOutputDataBlockDesc
);
initResultSizeInfo
(
&
pOperator
->
resultInfo
,
4096
);
int32_t
code
=
initAggInfo
(
&
pOperator
->
exprSupp
,
&
pInfo
->
aggSup
,
pExprInfo
,
num
,
keyBufSize
,
pTaskInfo
->
id
.
str
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pStateNode
->
window
.
node
.
pOutputDataBlockDesc
);
initBasicInfo
(
&
pInfo
->
binfo
,
pResBlock
);
initResultRowInfo
(
&
pInfo
->
binfo
.
resultRowInfo
);
...
...
@@ -2809,7 +2808,10 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWi
return
pOperator
;
_error:
destroyStateWindowOperatorInfo
(
pInfo
);
if
(
pInfo
!=
NULL
)
{
destroyStateWindowOperatorInfo
(
pInfo
);
}
taosMemoryFreeClear
(
pOperator
);
pTaskInfo
->
code
=
code
;
return
NULL
;
...
...
@@ -5306,9 +5308,7 @@ SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream,
goto
_error
;
}
int32_t
num
=
0
;
SExprInfo
*
pExprInfo
=
createExprInfo
(
pNode
->
window
.
pFuncs
,
NULL
,
&
num
);
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pNode
->
window
.
node
.
pOutputDataBlockDesc
);
SInterval
interval
=
{.
interval
=
pNode
->
interval
,
.
sliding
=
pNode
->
sliding
,
...
...
@@ -5332,11 +5332,14 @@ SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream,
size_t
keyBufSize
=
sizeof
(
int64_t
)
+
sizeof
(
int64_t
)
+
POINTER_BYTES
;
initResultSizeInfo
(
&
pOperator
->
resultInfo
,
4096
);
int32_t
code
=
initAggInfo
(
&
pOperator
->
exprSupp
,
&
iaInfo
->
aggSup
,
pExprInfo
,
num
,
keyBufSize
,
pTaskInfo
->
id
.
str
);
int32_t
num
=
0
;
SExprInfo
*
pExprInfo
=
createExprInfo
(
pNode
->
window
.
pFuncs
,
NULL
,
&
num
);
int32_t
code
=
initAggInfo
(
&
pOperator
->
exprSupp
,
&
iaInfo
->
aggSup
,
pExprInfo
,
num
,
keyBufSize
,
pTaskInfo
->
id
.
str
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pNode
->
window
.
node
.
pOutputDataBlockDesc
);
initBasicInfo
(
&
iaInfo
->
binfo
,
pResBlock
);
initExecTimeWindowInfo
(
&
iaInfo
->
twAggSup
.
timeWindowData
,
&
iaInfo
->
win
);
...
...
source/libs/executor/src/tsort.c
浏览文件 @
74305814
...
...
@@ -181,6 +181,7 @@ static int32_t doAddToBuf(SSDataBlock* pDataBlock, SSortHandle* pHandle) {
blockDataSplitRows
(
pDataBlock
,
pDataBlock
->
info
.
hasVarCol
,
start
,
&
stop
,
pHandle
->
pageSize
);
SSDataBlock
*
p
=
blockDataExtractBlock
(
pDataBlock
,
start
,
stop
-
start
+
1
);
if
(
p
==
NULL
)
{
taosArrayDestroy
(
pPageIdList
);
return
terrno
;
}
...
...
@@ -422,7 +423,7 @@ int32_t msortComparFn(const void* pLeft, const void* pRight, void* param) {
SColumnInfoData
*
pRightColInfoData
=
TARRAY_GET_ELEM
(
pRightBlock
->
pDataBlock
,
pOrder
->
slotId
);
bool
rightNull
=
false
;
if
(
pRightColInfoData
->
hasNull
)
{
if
(
p
Lef
tBlock
->
pBlockAgg
==
NULL
)
{
if
(
p
Righ
tBlock
->
pBlockAgg
==
NULL
)
{
rightNull
=
colDataIsNull_s
(
pRightColInfoData
,
pRightSource
->
src
.
rowIndex
);
}
else
{
rightNull
=
colDataIsNull
(
pRightColInfoData
,
pRightBlock
->
info
.
rows
,
pRightSource
->
src
.
rowIndex
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录