Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a3ffddba
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看板
未验证
提交
a3ffddba
编写于
3月 01, 2023
作者:
H
Haojun Liao
提交者:
GitHub
3月 01, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20204 from taosdata/fix/3_coverity
fix(query): fix coverity issue.
上级
968cc52d
744a942a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
9 deletion
+25
-9
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+15
-6
source/libs/executor/src/dataSinkMgt.c
source/libs/executor/src/dataSinkMgt.c
+4
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+5
-0
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+1
-1
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
a3ffddba
...
...
@@ -916,8 +916,10 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockN
pBlockNum
->
numOfBlocks
+=
1
;
}
if
((
pScanInfo
->
pBlockList
!=
NULL
)
&&
(
taosArrayGetSize
(
pScanInfo
->
pBlockList
)
>
0
))
{
numOfQTable
+=
1
;
if
(
pScanInfo
->
pBlockList
!=
NULL
)
{
if
(
taosArrayGetSize
(
pScanInfo
->
pBlockList
)
>
0
)
{
numOfQTable
+=
1
;
}
}
}
...
...
@@ -4720,8 +4722,13 @@ int32_t tsdbReaderReset(STsdbReader* pReader, SQueryTableDataCond* pCond) {
return
code
;
}
static
int32_t
getBucketIndex
(
int32_t
startRow
,
int32_t
bucketRange
,
int32_t
numOfRows
)
{
return
(
numOfRows
-
startRow
)
/
bucketRange
;
static
int32_t
getBucketIndex
(
int32_t
startRow
,
int32_t
bucketRange
,
int32_t
numOfRows
,
int32_t
numOfBucket
)
{
int32_t
bucketIndex
=
((
numOfRows
-
startRow
)
/
bucketRange
);
if
(
bucketIndex
==
numOfBucket
)
{
bucketIndex
-=
1
;
}
return
bucketIndex
;
}
int32_t
tsdbGetFileBlocksDistInfo
(
STsdbReader
*
pReader
,
STableBlockDistInfo
*
pTableBlockInfo
)
{
...
...
@@ -4730,6 +4737,8 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo
->
totalRows
=
0
;
pTableBlockInfo
->
numOfVgroups
=
1
;
const
int32_t
numOfBuckets
=
20
.
0
;
// find the start data block in file
tsdbAcquireReader
(
pReader
);
...
...
@@ -4742,7 +4751,7 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo
->
defMinRows
=
pc
->
minRows
;
pTableBlockInfo
->
defMaxRows
=
pc
->
maxRows
;
int32_t
bucketRange
=
ceil
((
pc
->
maxRows
-
pc
->
minRows
)
/
20
.
0
);
int32_t
bucketRange
=
ceil
((
pc
->
maxRows
-
pc
->
minRows
)
/
numOfBuckets
);
pTableBlockInfo
->
numOfFiles
+=
1
;
...
...
@@ -4780,7 +4789,7 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo
->
totalSize
+=
pBlock
->
aSubBlock
[
0
].
szBlock
;
int32_t
bucketIndex
=
getBucketIndex
(
pTableBlockInfo
->
defMinRows
,
bucketRange
,
numOfRows
);
int32_t
bucketIndex
=
getBucketIndex
(
pTableBlockInfo
->
defMinRows
,
bucketRange
,
numOfRows
,
numOfBuckets
);
pTableBlockInfo
->
blockRowsHisto
[
bucketIndex
]
++
;
hasNext
=
blockIteratorNext
(
&
pStatus
->
blockIter
,
pReader
->
idStr
);
...
...
source/libs/executor/src/dataSinkMgt.c
浏览文件 @
a3ffddba
...
...
@@ -37,10 +37,12 @@ int32_t dsCreateDataSinker(const SDataSinkNode* pDataSink, DataSinkHandle* pHand
switch
((
int
)
nodeType
(
pDataSink
))
{
case
QUERY_NODE_PHYSICAL_PLAN_DISPATCH
:
return
createDataDispatcher
(
&
gDataSinkManager
,
pDataSink
,
pHandle
);
case
QUERY_NODE_PHYSICAL_PLAN_DELETE
:
case
QUERY_NODE_PHYSICAL_PLAN_DELETE
:
{
return
createDataDeleter
(
&
gDataSinkManager
,
pDataSink
,
pHandle
,
pParam
);
case
QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT
:
}
case
QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT
:
{
return
createDataInserter
(
&
gDataSinkManager
,
pDataSink
,
pHandle
,
pParam
);
}
}
qError
(
"invalid input node type:%d, %s"
,
nodeType
(
pDataSink
),
id
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
a3ffddba
...
...
@@ -1996,6 +1996,11 @@ SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode);
int32_t
extractTableSchemaInfo
(
SReadHandle
*
pHandle
,
SScanPhysiNode
*
pScanNode
,
SExecTaskInfo
*
pTaskInfo
)
{
SMetaReader
mr
=
{
0
};
if
(
pHandle
==
NULL
)
{
terrno
=
TSDB_CODE_INVALID_PARA
;
return
terrno
;
}
metaReaderInit
(
&
mr
,
pHandle
->
meta
,
0
);
int32_t
code
=
metaGetTableEntryByUidCache
(
&
mr
,
pScanNode
->
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
a3ffddba
...
...
@@ -5579,7 +5579,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
int32_t
bucketRange
=
(
pData
->
defMaxRows
-
pData
->
defMinRows
)
/
numOfBuckets
;
for
(
int32_t
i
=
0
;
i
<
tListLen
(
pData
->
blockRowsHisto
);
++
i
)
{
len
=
sprintf
(
st
+
VARSTR_HEADER_SIZE
,
"%04d |"
,
pData
->
defMinRows
+
bucketRange
*
i
);
len
=
sprintf
(
st
+
VARSTR_HEADER_SIZE
,
"%04d |"
,
pData
->
defMinRows
+
bucketRange
*
(
i
+
1
)
);
int32_t
num
=
0
;
if
(
pData
->
blockRowsHisto
[
i
]
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录