Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f6a262ee
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看板
提交
f6a262ee
编写于
2月 11, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix invalid write.
上级
38df6316
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
13 deletion
+20
-13
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+5
-4
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+14
-8
tests/script/tsim/parser/regressiontest.sim
tests/script/tsim/parser/regressiontest.sim
+1
-1
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
f6a262ee
...
@@ -694,10 +694,12 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFReader* pFileReader,
...
@@ -694,10 +694,12 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFReader* pFileReader,
continue
;
continue
;
}
}
if
(
pBlockIdx
->
uid
==
pList
->
tableUidList
[
j
])
{
if
(
pBlockIdx
->
uid
>
pList
->
tableUidList
[
j
])
{
i
+=
1
;
j
+=
1
;
j
+=
1
;
continue
;
}
if
(
pBlockIdx
->
uid
==
pList
->
tableUidList
[
j
])
{
// this block belongs to a table that is not queried.
// this block belongs to a table that is not queried.
void
*
p
=
taosHashGet
(
pReader
->
status
.
pTableMap
,
&
pBlockIdx
->
uid
,
sizeof
(
uint64_t
));
void
*
p
=
taosHashGet
(
pReader
->
status
.
pTableMap
,
&
pBlockIdx
->
uid
,
sizeof
(
uint64_t
));
if
(
p
==
NULL
)
{
if
(
p
==
NULL
)
{
...
@@ -711,9 +713,8 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFReader* pFileReader,
...
@@ -711,9 +713,8 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFReader* pFileReader,
}
}
taosArrayPush
(
pIndexList
,
pBlockIdx
);
taosArrayPush
(
pIndexList
,
pBlockIdx
);
}
if
(
pBlockIdx
->
uid
>
pList
->
tableUidList
[
j
])
{
i
+=
1
;
j
+=
1
;
j
+=
1
;
}
}
}
}
...
...
source/libs/executor/src/executil.c
浏览文件 @
f6a262ee
...
@@ -127,23 +127,29 @@ void initGroupedResultInfo(SGroupResInfo* pGroupResInfo, SSHashObj* pHashmap, in
...
@@ -127,23 +127,29 @@ void initGroupedResultInfo(SGroupResInfo* pGroupResInfo, SSHashObj* pHashmap, in
pGroupResInfo
->
pRows
=
taosArrayInit
(
size
,
POINTER_BYTES
);
pGroupResInfo
->
pRows
=
taosArrayInit
(
size
,
POINTER_BYTES
);
size_t
keyLen
=
0
;
size_t
keyLen
=
0
;
int32_t
num
=
0
,
iter
=
0
,
itemSize
=
0
;
int32_t
iter
=
0
;
int32_t
bufLen
=
0
,
offset
=
0
;
// todo move away and record this during create window
while
((
pData
=
tSimpleHashIterate
(
pHashmap
,
pData
,
&
iter
))
!=
NULL
)
{
while
((
pData
=
tSimpleHashIterate
(
pHashmap
,
pData
,
&
iter
))
!=
NULL
)
{
void
*
key
=
tSimpleHashGetKey
(
pData
,
&
keyLen
);
/*void* key = */
tSimpleHashGetKey
(
pData
,
&
keyLen
);
bufLen
+=
keyLen
+
sizeof
(
SResultRowPosition
);
}
if
(
pGroupResInfo
->
pBuf
==
NULL
)
{
pGroupResInfo
->
pBuf
=
taosMemoryMalloc
(
bufLen
);
itemSize
=
keyLen
+
sizeof
(
SResultRowPosition
);
pGroupResInfo
->
pBuf
=
taosMemoryMalloc
(
size
*
itemSize
);
}
SResKeyPos
*
p
=
(
SResKeyPos
*
)(
pGroupResInfo
->
pBuf
+
num
*
itemSize
);
iter
=
0
;
while
((
pData
=
tSimpleHashIterate
(
pHashmap
,
pData
,
&
iter
))
!=
NULL
)
{
void
*
key
=
tSimpleHashGetKey
(
pData
,
&
keyLen
);
SResKeyPos
*
p
=
(
SResKeyPos
*
)
(
pGroupResInfo
->
pBuf
+
offset
);
p
->
groupId
=
*
(
uint64_t
*
)
key
;
p
->
groupId
=
*
(
uint64_t
*
)
key
;
p
->
pos
=
*
(
SResultRowPosition
*
)
pData
;
p
->
pos
=
*
(
SResultRowPosition
*
)
pData
;
memcpy
(
p
->
key
,
(
char
*
)
key
+
sizeof
(
uint64_t
),
keyLen
-
sizeof
(
uint64_t
));
memcpy
(
p
->
key
,
(
char
*
)
key
+
sizeof
(
uint64_t
),
keyLen
-
sizeof
(
uint64_t
));
taosArrayPush
(
pGroupResInfo
->
pRows
,
&
p
);
taosArrayPush
(
pGroupResInfo
->
pRows
,
&
p
);
num
+=
1
;
offset
+=
keyLen
+
sizeof
(
struct
SResultRowPosition
);
}
}
if
(
order
==
TSDB_ORDER_ASC
||
order
==
TSDB_ORDER_DESC
)
{
if
(
order
==
TSDB_ORDER_ASC
||
order
==
TSDB_ORDER_DESC
)
{
...
...
tests/script/tsim/parser/regressiontest.sim
浏览文件 @
f6a262ee
...
@@ -165,7 +165,7 @@ if $data00 != 10 then
...
@@ -165,7 +165,7 @@ if $data00 != 10 then
return -1
return -1
endi
endi
sql select last_row(*) from st1 group by a
sql select last_row(*) from st1 group by a
order by a desc
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录