Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a170796f
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a170796f
编写于
9月 02, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix invalid read/write.
上级
cac1fd36
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
12 deletion
+17
-12
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+6
-7
source/libs/executor/inc/executil.h
source/libs/executor/inc/executil.h
+1
-3
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+9
-2
tests/script/tsim/parser/slimit_alter_tags.sim
tests/script/tsim/parser/slimit_alter_tags.sim
+1
-0
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
a170796f
...
...
@@ -2244,9 +2244,12 @@ static void extractOrderedTableUidList(SUidOrderCheckInfo* pOrderCheckInfo, SRea
}
static
int32_t
initOrderCheckInfo
(
SUidOrderCheckInfo
*
pOrderCheckInfo
,
SReaderStatus
*
pStatus
)
{
if
(
pOrderCheckInfo
->
tableUidList
==
NULL
)
{
int32_t
total
=
taosHashGetSize
(
pStatus
->
pTableMap
);
int32_t
total
=
taosHashGetSize
(
pStatus
->
pTableMap
);
if
(
total
==
0
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
pOrderCheckInfo
->
tableUidList
==
NULL
)
{
pOrderCheckInfo
->
currentIndex
=
0
;
pOrderCheckInfo
->
tableUidList
=
taosMemoryMalloc
(
total
*
sizeof
(
uint64_t
));
if
(
pOrderCheckInfo
->
tableUidList
==
NULL
)
{
...
...
@@ -2254,21 +2257,17 @@ static int32_t initOrderCheckInfo(SUidOrderCheckInfo* pOrderCheckInfo, SReaderSt
}
extractOrderedTableUidList
(
pOrderCheckInfo
,
pStatus
);
uint64_t
uid
=
pOrderCheckInfo
->
tableUidList
[
0
];
pStatus
->
pTableIter
=
taosHashGet
(
pStatus
->
pTableMap
,
&
uid
,
sizeof
(
uid
));
}
else
{
if
(
pStatus
->
pTableIter
==
NULL
)
{
// it is the last block of a new file
// ASSERT(pOrderCheckInfo->currentIndex == taosHashGetSize(pStatus->pTableMap));
pOrderCheckInfo
->
currentIndex
=
0
;
uint64_t
uid
=
pOrderCheckInfo
->
tableUidList
[
pOrderCheckInfo
->
currentIndex
];
pStatus
->
pTableIter
=
taosHashGet
(
pStatus
->
pTableMap
,
&
uid
,
sizeof
(
uid
));
// the tableMap has already updated
if
(
pStatus
->
pTableIter
==
NULL
)
{
void
*
p
=
taosMemoryRealloc
(
pOrderCheckInfo
->
tableUidList
,
taosHashGetSize
(
pStatus
->
pTableMap
)
*
sizeof
(
uint64_t
));
void
*
p
=
taosMemoryRealloc
(
pOrderCheckInfo
->
tableUidList
,
total
*
sizeof
(
uint64_t
));
if
(
p
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
source/libs/executor/inc/executil.h
浏览文件 @
a170796f
...
...
@@ -87,9 +87,7 @@ struct SqlFunctionCtx;
size_t
getResultRowSize
(
struct
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
);
void
initResultRowInfo
(
SResultRowInfo
*
pResultRowInfo
);
void
initResultRow
(
SResultRow
*
pResultRow
);
void
closeResultRow
(
SResultRow
*
pResultRow
);
void
closeResultRow
(
SResultRow
*
pResultRow
);
struct
SResultRowEntryInfo
*
getResultEntryInfo
(
const
SResultRow
*
pRow
,
int32_t
index
,
const
int32_t
*
offset
);
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
a170796f
...
...
@@ -609,6 +609,7 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num
while
(
1
)
{
SListNode
*
pn
=
tdListGetHead
(
pResultRowInfo
->
openWindow
);
SOpenWindowInfo
*
pOpenWin
=
(
SOpenWindowInfo
*
)
pn
->
data
;
uint64_t
groupId
=
pOpenWin
->
groupId
;
SResultRowPosition
*
p1
=
&
pOpenWin
->
pos
;
if
(
p
->
pageId
==
p1
->
pageId
&&
p
->
offset
==
p1
->
offset
)
{
...
...
@@ -621,7 +622,8 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num
if
(
pr
->
closed
)
{
ASSERT
(
isResultRowInterpolated
(
pr
,
RESULT_ROW_START_INTERP
)
&&
isResultRowInterpolated
(
pr
,
RESULT_ROW_END_INTERP
));
tdListPopHead
(
pResultRowInfo
->
openWindow
);
SListNode
*
pNode
=
tdListPopHead
(
pResultRowInfo
->
openWindow
);
taosMemoryFree
(
pNode
);
continue
;
}
...
...
@@ -650,7 +652,8 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num
if
(
isResultRowInterpolated
(
pResult
,
RESULT_ROW_END_INTERP
))
{
closeResultRow
(
pr
);
tdListPopHead
(
pResultRowInfo
->
openWindow
);
SListNode
*
pNode
=
tdListPopHead
(
pResultRowInfo
->
openWindow
);
taosMemoryFree
(
pNode
);
}
else
{
// the remains are can not be closed yet.
break
;
}
...
...
@@ -1730,6 +1733,10 @@ void destroyIntervalOperatorInfo(void* param) {
SIntervalAggOperatorInfo
*
pInfo
=
(
SIntervalAggOperatorInfo
*
)
param
;
cleanupBasicInfo
(
&
pInfo
->
binfo
);
cleanupAggSup
(
&
pInfo
->
aggSup
);
cleanupExprSupp
(
&
pInfo
->
scalarSupp
);
tdListFree
(
pInfo
->
binfo
.
resultRowInfo
.
openWindow
);
pInfo
->
pRecycledPages
=
taosArrayDestroy
(
pInfo
->
pRecycledPages
);
pInfo
->
pInterpCols
=
taosArrayDestroy
(
pInfo
->
pInterpCols
);
taosArrayDestroyEx
(
pInfo
->
pPrevValues
,
freeItem
);
...
...
tests/script/tsim/parser/slimit_alter_tags.sim
浏览文件 @
a170796f
...
...
@@ -128,6 +128,7 @@ if $rows != 5 then
return -1
endi
if $data00 != $rowNum then
print expect $rowNum , actual: $data00
return -1
endi
if $data10 != $rowNum then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录