Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
2ba89e21
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2ba89e21
编写于
7月 17, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] fix error in calculate the qualified block
上级
14a86b4b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
51 addition
and
44 deletion
+51
-44
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-3
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+49
-41
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
2ba89e21
...
...
@@ -26,7 +26,6 @@
#include "query.h"
#include "queryLog.h"
#include "qast.h"
#include "tfile.h"
#include "tlosertree.h"
#include "tscompression.h"
#include "ttime.h"
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
2ba89e21
...
...
@@ -515,7 +515,7 @@ static int32_t binarySearchForBlock(SCompBlock* pBlock, int32_t numOfBlocks, TSK
return
midSlot
;
}
static
int32_t
getFileCompInfo
(
STsdbQueryHandle
*
pQueryHandle
,
int32_t
*
numOfBlocks
,
int32_t
type
)
{
static
int32_t
getFileCompInfo
(
STsdbQueryHandle
*
pQueryHandle
,
int32_t
*
numOfBlocks
)
{
SFileGroup
*
fileGroup
=
pQueryHandle
->
pFileGroup
;
assert
(
fileGroup
->
files
[
TSDB_FILE_TYPE_HEAD
].
fname
>
0
);
...
...
@@ -532,13 +532,15 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo
for
(
int32_t
i
=
0
;
i
<
numOfTables
;
++
i
)
{
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
i
);
pCheckInfo
->
numOfBlocks
=
0
;
SCompIdx
*
compIndex
=
&
pQueryHandle
->
rhelper
.
pCompIdx
[
pCheckInfo
->
tableId
.
tid
];
if
(
compIndex
->
len
==
0
||
compIndex
->
numOfBlocks
==
0
||
compIndex
->
uid
!=
pCheckInfo
->
tableId
.
uid
)
{
// no data block in this file, try next file
pCheckInfo
->
numOfBlocks
=
0
;
// no data block in this file, try next file
if
(
compIndex
->
len
==
0
||
compIndex
->
numOfBlocks
==
0
||
compIndex
->
uid
!=
pCheckInfo
->
tableId
.
uid
)
{
continue
;
// no data blocks in the file belongs to pCheckInfo->pTable
}
else
{
}
if
(
pCheckInfo
->
compSize
<
compIndex
->
len
)
{
assert
(
compIndex
->
len
>
0
);
...
...
@@ -554,8 +556,16 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo
tsdbLoadCompInfo
(
&
(
pQueryHandle
->
rhelper
),
(
void
*
)(
pCheckInfo
->
pCompInfo
));
SCompInfo
*
pCompInfo
=
pCheckInfo
->
pCompInfo
;
TSKEY
s
=
MIN
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
TSKEY
e
=
MAX
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
TSKEY
s
=
TSKEY_INITIAL_VAL
,
e
=
TSKEY_INITIAL_VAL
;
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
assert
(
pCheckInfo
->
lastKey
>=
pQueryHandle
->
window
.
ekey
&&
pQueryHandle
->
window
.
skey
<=
pQueryHandle
->
window
.
ekey
);
}
else
{
assert
(
pCheckInfo
->
lastKey
<=
pQueryHandle
->
window
.
ekey
&&
pQueryHandle
->
window
.
skey
>=
pQueryHandle
->
window
.
ekey
);
}
s
=
MIN
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
e
=
MAX
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
// discard the unqualified data block based on the query time window
int32_t
start
=
binarySearchForBlock
(
pCompInfo
->
blocks
,
compIndex
->
numOfBlocks
,
s
,
TSDB_ORDER_ASC
);
...
...
@@ -578,7 +588,6 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo
(
*
numOfBlocks
)
+=
pCheckInfo
->
numOfBlocks
;
}
}
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1378,8 +1387,7 @@ static int32_t getDataBlocksInFilesImpl(STsdbQueryHandle* pQueryHandle, bool* ex
int32_t
numOfTables
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
while
((
pQueryHandle
->
pFileGroup
=
tsdbGetFileGroupNext
(
&
pQueryHandle
->
fileIter
))
!=
NULL
)
{
int32_t
type
=
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
?
QUERY_RANGE_GREATER_EQUAL
:
QUERY_RANGE_LESS_EQUAL
;
if
((
code
=
getFileCompInfo
(
pQueryHandle
,
&
numOfBlocks
,
type
))
!=
TSDB_CODE_SUCCESS
)
{
if
((
code
=
getFileCompInfo
(
pQueryHandle
,
&
numOfBlocks
))
!=
TSDB_CODE_SUCCESS
)
{
break
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录