Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7e1521ba
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看板
未验证
提交
7e1521ba
编写于
10月 17, 2022
作者:
H
Haojun Liao
提交者:
GitHub
10月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17401 from taosdata/fix/liao_cov
fix(query): fix coverity issues.
上级
079087dc
6d965b8b
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
61 addition
and
20 deletion
+61
-20
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+56
-13
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+0
-2
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-2
source/libs/executor/src/tsimplehash.c
source/libs/executor/src/tsimplehash.c
+3
-2
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
7e1521ba
...
...
@@ -1506,8 +1506,13 @@ static FORCE_INLINE STSchema* doGetSchemaForTSRow(int32_t sversion, STsdbReader*
if
(
pReader
->
pMemSchema
==
NULL
)
{
int32_t
code
=
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pReader
->
suid
,
uid
,
sversion
,
&
pReader
->
pMemSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
return
NULL
;
}
else
{
return
pReader
->
pMemSchema
;
}
}
if
(
pReader
->
pMemSchema
->
version
==
sversion
)
{
return
pReader
->
pMemSchema
;
...
...
@@ -1518,9 +1523,9 @@ static FORCE_INLINE STSchema* doGetSchemaForTSRow(int32_t sversion, STsdbReader*
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
return
NULL
;
}
}
else
{
return
pReader
->
pMemSchema
;
}
}
static
int32_t
doMergeBufAndFileRows
(
STsdbReader
*
pReader
,
STableBlockScanInfo
*
pBlockScanInfo
,
TSDBROW
*
pRow
,
...
...
@@ -1816,7 +1821,11 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
if
(
minKey
==
key
)
{
init
=
true
;
TSDBROW
fRow
=
tsdbRowFromBlockData
(
pBlockData
,
pDumpInfo
->
rowIndex
);
tRowMergerInit
(
&
merge
,
&
fRow
,
pReader
->
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
&
fRow
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
doMergeRowsInFileBlocks
(
pBlockData
,
pBlockScanInfo
,
pReader
,
&
merge
);
}
...
...
@@ -1826,8 +1835,12 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
tRowMerge
(
&
merge
,
&
fRow1
);
}
else
{
init
=
true
;
tRowMergerInit
(
&
merge
,
&
fRow1
,
pReader
->
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
&
fRow1
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
doMergeRowsInLastBlock
(
pLastBlockReader
,
pBlockScanInfo
,
tsLast
,
&
merge
);
}
...
...
@@ -1837,7 +1850,10 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
}
else
{
init
=
true
;
STSchema
*
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
piRow
),
pReader
,
pBlockScanInfo
->
uid
);
tRowMergerInit
(
&
merge
,
piRow
,
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
piRow
,
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
doMergeRowsInBuf
(
&
pBlockScanInfo
->
iiter
,
pBlockScanInfo
->
uid
,
ik
.
ts
,
pBlockScanInfo
->
delSkyline
,
&
merge
,
pReader
);
}
...
...
@@ -1847,7 +1863,10 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
tRowMerge
(
&
merge
,
pRow
);
}
else
{
STSchema
*
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
pRow
),
pReader
,
pBlockScanInfo
->
uid
);
tRowMergerInit
(
&
merge
,
pRow
,
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
pRow
,
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
doMergeRowsInBuf
(
&
pBlockScanInfo
->
iter
,
pBlockScanInfo
->
uid
,
k
.
ts
,
pBlockScanInfo
->
delSkyline
,
&
merge
,
pReader
);
}
...
...
@@ -1855,7 +1874,11 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
if
(
minKey
==
k
.
ts
)
{
init
=
true
;
STSchema
*
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
pRow
),
pReader
,
pBlockScanInfo
->
uid
);
tRowMergerInit
(
&
merge
,
pRow
,
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
pRow
,
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
doMergeRowsInBuf
(
&
pBlockScanInfo
->
iter
,
pBlockScanInfo
->
uid
,
k
.
ts
,
pBlockScanInfo
->
delSkyline
,
&
merge
,
pReader
);
}
...
...
@@ -1865,7 +1888,10 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
}
else
{
init
=
true
;
STSchema
*
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
piRow
),
pReader
,
pBlockScanInfo
->
uid
);
tRowMergerInit
(
&
merge
,
piRow
,
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
piRow
,
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
doMergeRowsInBuf
(
&
pBlockScanInfo
->
iiter
,
pBlockScanInfo
->
uid
,
ik
.
ts
,
pBlockScanInfo
->
delSkyline
,
&
merge
,
pReader
);
}
...
...
@@ -1876,7 +1902,10 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
tRowMerge
(
&
merge
,
&
fRow1
);
}
else
{
init
=
true
;
tRowMergerInit
(
&
merge
,
&
fRow1
,
pReader
->
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
&
fRow1
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
doMergeRowsInLastBlock
(
pLastBlockReader
,
pBlockScanInfo
,
tsLast
,
&
merge
);
}
...
...
@@ -1884,7 +1913,10 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
if
(
minKey
==
key
)
{
TSDBROW
fRow
=
tsdbRowFromBlockData
(
pBlockData
,
pDumpInfo
->
rowIndex
);
if
(
!
init
)
{
tRowMergerInit
(
&
merge
,
&
fRow
,
pReader
->
pSchema
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
&
fRow
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
else
{
tRowMerge
(
&
merge
,
&
fRow
);
}
...
...
@@ -3046,19 +3078,30 @@ int32_t doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter,
SRowMerger
merge
=
{
0
};
// get the correct schema for data in memory
terrno
=
0
;
STSchema
*
pTSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
&
current
),
pReader
,
uid
);
if
(
pTSchema
==
NULL
)
{
return
terrno
;
}
if
(
pReader
->
pSchema
==
NULL
)
{
pReader
->
pSchema
=
pTSchema
;
}
tRowMergerInit2
(
&
merge
,
pReader
->
pSchema
,
&
current
,
pTSchema
);
int32_t
code
=
tRowMergerInit2
(
&
merge
,
pReader
->
pSchema
,
&
current
,
pTSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
STSchema
*
pTSchema1
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
pNextRow
),
pReader
,
uid
);
if
(
pTSchema1
==
NULL
)
{
return
terrno
;
}
tRowMergerAdd
(
&
merge
,
pNextRow
,
pTSchema1
);
doMergeRowsInBuf
(
pIter
,
uid
,
current
.
pTSRow
->
ts
,
pDelList
,
&
merge
,
pReader
);
int32_t
code
=
tRowMergerGetRow
(
&
merge
,
pTSRow
);
code
=
tRowMergerGetRow
(
&
merge
,
pTSRow
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
7e1521ba
...
...
@@ -719,8 +719,6 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) {
}
pMerger
->
version
=
key
.
version
;
_exit:
return
code
;
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
7e1521ba
...
...
@@ -294,7 +294,7 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo
if (!exists) {
#endif
taosArrayPush
(
pTaskInfo
->
tableqinfoList
.
pTableList
,
&
keyInfo
);
taosHashPut
(
pTaskInfo
->
tableqinfoList
.
map
,
uid
,
sizeof
(
uid
),
&
keyInfo
.
groupId
,
sizeof
(
keyInfo
.
groupId
));
taosHashPut
(
pTaskInfo
->
tableqinfoList
.
map
,
uid
,
sizeof
(
*
uid
),
&
keyInfo
.
groupId
,
sizeof
(
keyInfo
.
groupId
));
}
/*}*/
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
7e1521ba
...
...
@@ -942,8 +942,7 @@ static FORCE_INLINE void doClearBufferedBlocks(SStreamScanInfo* pInfo) {
}
static
bool
isSessionWindow
(
SStreamScanInfo
*
pInfo
)
{
return
pInfo
->
windowSup
.
parentType
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION
||
pInfo
->
windowSup
.
parentType
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION
;
return
pInfo
->
windowSup
.
parentType
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION
;
}
static
bool
isStateWindow
(
SStreamScanInfo
*
pInfo
)
{
...
...
source/libs/executor/src/tsimplehash.c
浏览文件 @
7e1521ba
...
...
@@ -16,6 +16,7 @@
#include "tsimplehash.h"
#include "taoserror.h"
#include "tlog.h"
#include "tdef.h"
#define SHASH_DEFAULT_LOAD_FACTOR 0.75
#define HASH_MAX_CAPACITY (1024 * 1024 * 16L)
...
...
@@ -110,14 +111,14 @@ static void tSimpleHashTableResize(SSHashObj *pHashObj) {
}
int64_t
st
=
taosGetTimestampUs
();
void
*
pNewEntryList
=
taosMemoryRealloc
(
pHashObj
->
hashList
,
sizeof
(
void
*
)
*
newCapacity
);
void
*
pNewEntryList
=
taosMemoryRealloc
(
pHashObj
->
hashList
,
POINTER_BYTES
*
newCapacity
);
if
(
!
pNewEntryList
)
{
uWarn
(
"hash resize failed due to out of memory, capacity remain:%zu"
,
pHashObj
->
capacity
);
return
;
}
size_t
inc
=
newCapacity
-
pHashObj
->
capacity
;
memset
((
char
*
)
pNewEntryList
+
pHashObj
->
capacity
*
sizeof
(
void
*
)
,
0
,
inc
*
sizeof
(
void
*
));
memset
((
char
*
)
pNewEntryList
+
pHashObj
->
capacity
*
POINTER_BYTES
,
0
,
inc
*
sizeof
(
void
*
));
pHashObj
->
hashList
=
pNewEntryList
;
pHashObj
->
capacity
=
newCapacity
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录