Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
bdc83f02
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
bdc83f02
编写于
8月 02, 2021
作者:
H
Haojun Liao
提交者:
GitHub
8月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7072 from taosdata/fix/TD-5584
[TD-5631]<fix>fix functionCompatList array overflow access
上级
a9db4f82
1f1510b8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
4 deletion
+11
-4
src/inc/tsdb.h
src/inc/tsdb.h
+1
-0
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+6
-4
src/query/src/qUtil.c
src/query/src/qUtil.c
+2
-0
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+2
-0
未找到文件。
src/inc/tsdb.h
浏览文件 @
bdc83f02
...
...
@@ -240,6 +240,7 @@ typedef struct {
int32_t
minRows
;
int32_t
firstSeekTimeUs
;
uint32_t
numOfRowsInMemTable
;
uint32_t
numOfSmallBlocks
;
SArray
*
dataBlockInfos
;
}
STableBlockDist
;
...
...
src/query/src/qAggMain.c
浏览文件 @
bdc83f02
...
...
@@ -4018,6 +4018,7 @@ static void mergeTableBlockDist(SResultRowCellInfo* pResInfo, const STableBlockD
pDist
->
numOfTables
+=
pSrc
->
numOfTables
;
pDist
->
numOfRowsInMemTable
+=
pSrc
->
numOfRowsInMemTable
;
pDist
->
numOfSmallBlocks
+=
pSrc
->
numOfSmallBlocks
;
pDist
->
numOfFiles
+=
pSrc
->
numOfFiles
;
pDist
->
totalSize
+=
pSrc
->
totalSize
;
pDist
->
totalRows
+=
pSrc
->
totalRows
;
...
...
@@ -4130,18 +4131,19 @@ void generateBlockDistResult(STableBlockDist *pTableBlockDist, char* result) {
uint64_t
totalLen
=
pTableBlockDist
->
totalSize
;
int32_t
rowSize
=
pTableBlockDist
->
rowSize
;
int32_t
smallBlocks
=
pTableBlockDist
->
numOfSmallBlocks
;
double
compRatio
=
(
totalRows
>
0
)
?
((
double
)(
totalLen
)
/
(
rowSize
*
totalRows
))
:
1
;
int
sz
=
sprintf
(
result
+
VARSTR_HEADER_SIZE
,
"summary:
\n\t
"
"5th=[%d], 10th=[%d], 20th=[%d], 30th=[%d], 40th=[%d], 50th=[%d]
\n\t
"
"60th=[%d], 70th=[%d], 80th=[%d], 90th=[%d], 95th=[%d], 99th=[%d]
\n\t
"
"Min=[%"
PRId64
"(Rows)] Max=[%"
PRId64
"(Rows)] Avg=[%"
PRId64
"(Rows)] Stddev=[%.2f]
\n\t
"
"Rows=[%"
PRIu64
"], Blocks=[%"
PRId64
"], Size=[%.3f(Kb)] Comp=[%.2f]
\n\t
"
"Rows=[%"
PRIu64
"], Blocks=[%"
PRId64
"], S
mallBlocks=[%d], S
ize=[%.3f(Kb)] Comp=[%.2f]
\n\t
"
"RowsInMem=[%d]
\n\t
"
,
percentiles
[
0
],
percentiles
[
1
],
percentiles
[
2
],
percentiles
[
3
],
percentiles
[
4
],
percentiles
[
5
],
percentiles
[
6
],
percentiles
[
7
],
percentiles
[
8
],
percentiles
[
9
],
percentiles
[
10
],
percentiles
[
11
],
min
,
max
,
avg
,
stdDev
,
totalRows
,
totalBlocks
,
totalLen
/
1024
.
0
,
compRatio
,
totalRows
,
totalBlocks
,
smallBlocks
,
totalLen
/
1024
.
0
,
compRatio
,
pTableBlockDist
->
numOfRowsInMemTable
);
varDataSetLen
(
result
,
sz
);
UNUSED
(
sz
);
...
...
@@ -4184,8 +4186,8 @@ int32_t functionCompatList[] = {
4
,
-
1
,
-
1
,
1
,
1
,
1
,
1
,
1
,
1
,
-
1
,
// tag, colprj, tagprj, arithmetic, diff, first_dist, last_dist, stddev_dst, interp rate irate
1
,
1
,
1
,
1
,
-
1
,
1
,
1
,
1
,
5
,
1
,
1
,
// tid_tag, blk_info
6
,
7
// tid_tag,
derivative,
blk_info
6
,
8
,
7
,
};
SAggFunctionInfo
aAggs
[]
=
{{
...
...
src/query/src/qUtil.c
浏览文件 @
bdc83f02
...
...
@@ -583,6 +583,7 @@ void blockDistInfoToBinary(STableBlockDist* pDist, struct SBufferWriter* bw) {
tbufWriteInt32
(
bw
,
pDist
->
maxRows
);
tbufWriteInt32
(
bw
,
pDist
->
minRows
);
tbufWriteUint32
(
bw
,
pDist
->
numOfRowsInMemTable
);
tbufWriteUint32
(
bw
,
pDist
->
numOfSmallBlocks
);
tbufWriteUint64
(
bw
,
taosArrayGetSize
(
pDist
->
dataBlockInfos
));
// compress the binary string
...
...
@@ -621,6 +622,7 @@ void blockDistInfoFromBinary(const char* data, int32_t len, STableBlockDist* pDi
pDist
->
maxRows
=
tbufReadInt32
(
&
br
);
pDist
->
minRows
=
tbufReadInt32
(
&
br
);
pDist
->
numOfRowsInMemTable
=
tbufReadUint32
(
&
br
);
pDist
->
numOfSmallBlocks
=
tbufReadUint32
(
&
br
);
int64_t
numSteps
=
tbufReadUint64
(
&
br
);
bool
comp
=
tbufReadUint8
(
&
br
);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
bdc83f02
...
...
@@ -2435,6 +2435,7 @@ int32_t tsdbGetFileBlocksDistInfo(TsdbQueryHandleT* queryHandle, STableBlockDist
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
numOfBlocks
=
0
;
int32_t
numOfTables
=
(
int32_t
)
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
int
defaultRows
=
TSDB_DEFAULT_BLOCK_ROWS
(
pCfg
->
maxRowsPerFileBlock
);
STimeWindow
win
=
TSWINDOW_INITIALIZER
;
while
(
true
)
{
...
...
@@ -2494,6 +2495,7 @@ int32_t tsdbGetFileBlocksDistInfo(TsdbQueryHandleT* queryHandle, STableBlockDist
pTableBlockInfo
->
totalRows
+=
numOfRows
;
if
(
numOfRows
>
pTableBlockInfo
->
maxRows
)
pTableBlockInfo
->
maxRows
=
numOfRows
;
if
(
numOfRows
<
pTableBlockInfo
->
minRows
)
pTableBlockInfo
->
minRows
=
numOfRows
;
if
(
numOfRows
<
defaultRows
)
pTableBlockInfo
->
numOfSmallBlocks
+=
1
;
int32_t
stepIndex
=
(
numOfRows
-
1
)
/
TSDB_BLOCK_DIST_STEP_ROWS
;
SFileBlockInfo
*
blockInfo
=
(
SFileBlockInfo
*
)
taosArrayGet
(
pTableBlockInfo
->
dataBlockInfos
,
stepIndex
);
blockInfo
->
numBlocksOfStep
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录