Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8e4c6ccb
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看板
提交
8e4c6ccb
编写于
2月 01, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): move the reset to other place.
上级
c4531512
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
8 deletion
+19
-8
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+15
-4
source/util/src/talgo.c
source/util/src/talgo.c
+4
-4
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
8e4c6ccb
...
...
@@ -2693,10 +2693,6 @@ static void extractOrderedTableUidList(SUidOrderCheckInfo* pOrderCheckInfo, SRea
void
*
p
=
taosHashIterate
(
pStatus
->
pTableMap
,
NULL
);
while
(
p
!=
NULL
)
{
STableBlockScanInfo
*
pScanInfo
=
*
(
STableBlockScanInfo
**
)
p
;
// reset the last del file index
pScanInfo
->
lastBlockDelIndex
=
getInitialDelIndex
(
pScanInfo
->
delSkyline
,
order
);
pOrderCheckInfo
->
tableUidList
[
index
++
]
=
pScanInfo
->
uid
;
p
=
taosHashIterate
(
pStatus
->
pTableMap
,
p
);
}
...
...
@@ -2704,6 +2700,18 @@ static void extractOrderedTableUidList(SUidOrderCheckInfo* pOrderCheckInfo, SRea
taosSort
(
pOrderCheckInfo
->
tableUidList
,
total
,
sizeof
(
uint64_t
),
uidComparFunc
);
}
// reset the last del file index
static
void
resetScanBlockLastBlockDelIndex
(
SReaderStatus
*
pStatus
,
int32_t
order
)
{
void
*
p
=
taosHashIterate
(
pStatus
->
pTableMap
,
NULL
);
while
(
p
!=
NULL
)
{
STableBlockScanInfo
*
pScanInfo
=
*
(
STableBlockScanInfo
**
)
p
;
// reset the last del file index
pScanInfo
->
lastBlockDelIndex
=
getInitialDelIndex
(
pScanInfo
->
delSkyline
,
order
);
p
=
taosHashIterate
(
pStatus
->
pTableMap
,
p
);
}
}
static
int32_t
initOrderCheckInfo
(
SUidOrderCheckInfo
*
pOrderCheckInfo
,
STsdbReader
*
pReader
)
{
SReaderStatus
*
pStatus
=
&
pReader
->
status
;
...
...
@@ -3052,6 +3060,7 @@ static int32_t buildBlockFromFiles(STsdbReader* pReader) {
// this file does not have data files, let's start check the last block file if exists
if
(
pBlockIter
->
numOfBlocks
==
0
)
{
resetScanBlockLastBlockDelIndex
(
&
pReader
->
status
,
pReader
->
order
);
goto
_begin
;
}
}
...
...
@@ -3083,6 +3092,7 @@ static int32_t buildBlockFromFiles(STsdbReader* pReader) {
// data blocks in current file are exhausted, let's try the next file now
tBlockDataReset
(
&
pReader
->
status
.
fileBlockData
);
resetDataBlockIterator
(
pBlockIter
,
pReader
->
order
);
resetScanBlockLastBlockDelIndex
(
&
pReader
->
status
,
pReader
->
order
);
goto
_begin
;
}
else
{
code
=
initForFirstBlockInFile
(
pReader
,
pBlockIter
);
...
...
@@ -3094,6 +3104,7 @@ static int32_t buildBlockFromFiles(STsdbReader* pReader) {
// this file does not have blocks, let's start check the last block file
if
(
pBlockIter
->
numOfBlocks
==
0
)
{
resetScanBlockLastBlockDelIndex
(
&
pReader
->
status
,
pReader
->
order
);
goto
_begin
;
}
}
...
...
source/util/src/talgo.c
浏览文件 @
8e4c6ccb
...
...
@@ -28,14 +28,14 @@ static void median(void *src, int64_t size, int64_t s, int64_t e, const void *pa
void
*
buf
)
{
int32_t
mid
=
((
int32_t
)(
e
-
s
)
>>
1u
)
+
(
int32_t
)
s
;
if
(
comparFn
(
elePtrAt
(
src
,
size
,
mid
),
elePtrAt
(
src
,
size
,
s
),
param
)
==
1
)
{
if
(
comparFn
(
elePtrAt
(
src
,
size
,
mid
),
elePtrAt
(
src
,
size
,
s
),
param
)
>
0
)
{
doswap
(
elePtrAt
(
src
,
size
,
mid
),
elePtrAt
(
src
,
size
,
s
),
size
,
buf
);
}
if
(
comparFn
(
elePtrAt
(
src
,
size
,
mid
),
elePtrAt
(
src
,
size
,
e
),
param
)
==
1
)
{
if
(
comparFn
(
elePtrAt
(
src
,
size
,
mid
),
elePtrAt
(
src
,
size
,
e
),
param
)
>
0
)
{
doswap
(
elePtrAt
(
src
,
size
,
mid
),
elePtrAt
(
src
,
size
,
s
),
size
,
buf
);
doswap
(
elePtrAt
(
src
,
size
,
mid
),
elePtrAt
(
src
,
size
,
e
),
size
,
buf
);
}
else
if
(
comparFn
(
elePtrAt
(
src
,
size
,
s
),
elePtrAt
(
src
,
size
,
e
),
param
)
==
1
)
{
}
else
if
(
comparFn
(
elePtrAt
(
src
,
size
,
s
),
elePtrAt
(
src
,
size
,
e
),
param
)
>
0
)
{
doswap
(
elePtrAt
(
src
,
size
,
s
),
elePtrAt
(
src
,
size
,
e
),
size
,
buf
);
}
...
...
@@ -47,7 +47,7 @@ static void tInsertSort(void *src, int64_t size, int32_t s, int32_t e, const voi
void
*
buf
)
{
for
(
int32_t
i
=
s
+
1
;
i
<=
e
;
++
i
)
{
for
(
int32_t
j
=
i
;
j
>
s
;
--
j
)
{
if
(
comparFn
(
elePtrAt
(
src
,
size
,
j
),
elePtrAt
(
src
,
size
,
j
-
1
),
param
)
==
-
1
)
{
if
(
comparFn
(
elePtrAt
(
src
,
size
,
j
),
elePtrAt
(
src
,
size
,
j
-
1
),
param
)
<
0
)
{
doswap
(
elePtrAt
(
src
,
size
,
j
),
elePtrAt
(
src
,
size
,
j
-
1
),
size
,
buf
);
}
else
{
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录