Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
c60cf345
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c60cf345
编写于
5月 27, 2021
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4243]<fix>:fix coredump when select _block_dist() from table
上级
7946d97e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
120 addition
and
22 deletion
+120
-22
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-0
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+21
-22
tests/script/fullGeneralSuite.sim
tests/script/fullGeneralSuite.sim
+1
-0
tests/script/general/compute/block_dist.sim
tests/script/general/compute/block_dist.sim
+94
-0
tests/script/general/compute/testSuite.sim
tests/script/general/compute/testSuite.sim
+1
-0
tests/script/regressionSuite.sim
tests/script/regressionSuite.sim
+1
-0
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
c60cf345
...
...
@@ -2845,6 +2845,8 @@ static void doSetTagValueInParam(void* pTable, int32_t tagColId, tVariant *tag,
if
(
tagColId
==
TSDB_TBNAME_COLUMN_INDEX
)
{
val
=
tsdbGetTableName
(
pTable
);
assert
(
val
!=
NULL
);
}
else
if
(
tagColId
==
TSDB_BLOCK_DIST_COLUMN_INDEX
)
{
val
=
NULL
;
}
else
{
val
=
tsdbGetTableTagVal
(
pTable
,
tagColId
,
type
,
bytes
);
}
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
c60cf345
...
...
@@ -367,40 +367,39 @@ static STsdbQueryHandle* tsdbQueryTablesImpl(STsdbRepo* tsdb, STsdbQueryCond* pC
goto
out_of_memory
;
}
assert
(
pCond
!=
NULL
&&
p
Cond
->
numOfCols
>
0
&&
p
MemRef
!=
NULL
);
assert
(
pCond
!=
NULL
&&
pMemRef
!=
NULL
);
if
(
ASCENDING_TRAVERSE
(
pCond
->
order
))
{
assert
(
pQueryHandle
->
window
.
skey
<=
pQueryHandle
->
window
.
ekey
);
}
else
{
assert
(
pQueryHandle
->
window
.
skey
>=
pQueryHandle
->
window
.
ekey
);
}
if
(
pCond
->
numOfCols
>
0
)
{
// allocate buffer in order to load data blocks from file
pQueryHandle
->
statis
=
calloc
(
pCond
->
numOfCols
,
sizeof
(
SDataStatis
));
if
(
pQueryHandle
->
statis
==
NULL
)
{
goto
out_of_memory
;
}
// allocate buffer in order to load data blocks from file
pQueryHandle
->
statis
=
calloc
(
pCond
->
numOfCols
,
sizeof
(
SDataStatis
));
if
(
pQueryHandle
->
statis
==
NULL
)
{
goto
out_of_memory
;
}
pQueryHandle
->
pColumns
=
taosArrayInit
(
pCond
->
numOfCols
,
sizeof
(
SColumnInfoData
));
// todo: use list instead of array?
if
(
pQueryHandle
->
pColumns
==
NULL
)
{
goto
out_of_memory
;
}
pQueryHandle
->
pColumns
=
taosArrayInit
(
pCond
->
numOfCols
,
sizeof
(
SColumnInfoData
));
// todo: use list instead of array?
if
(
pQueryHandle
->
pColumns
==
NULL
)
{
goto
out_of_memory
;
}
for
(
int32_t
i
=
0
;
i
<
pCond
->
numOfCols
;
++
i
)
{
SColumnInfoData
colInfo
=
{{
0
},
0
};
for
(
int32_t
i
=
0
;
i
<
pCond
->
numOfCols
;
++
i
)
{
SColumnInfoData
colInfo
=
{{
0
},
0
};
colInfo
.
info
=
pCond
->
colList
[
i
];
colInfo
.
pData
=
calloc
(
1
,
EXTRA_BYTES
+
pQueryHandle
->
outputCapacity
*
pCond
->
colList
[
i
].
bytes
);
if
(
colInfo
.
pData
==
NULL
)
{
goto
out_of_memory
;
colInfo
.
info
=
pCond
->
colList
[
i
];
colInfo
.
pData
=
calloc
(
1
,
EXTRA_BYTES
+
pQueryHandle
->
outputCapacity
*
pCond
->
colList
[
i
].
bytes
);
if
(
colInfo
.
pData
==
NULL
)
{
goto
out_of_memory
;
}
taosArrayPush
(
pQueryHandle
->
pColumns
,
&
colInfo
);
pQueryHandle
->
statis
[
i
].
colId
=
colInfo
.
info
.
colId
;
}
taosArrayPush
(
pQueryHandle
->
pColumns
,
&
colInfo
);
pQueryHandle
->
statis
[
i
].
colId
=
colInfo
.
info
.
colId
;
}
if
(
pCond
->
numOfCols
>
0
)
{
pQueryHandle
->
defaultLoadColumn
=
getDefaultLoadColumns
(
pQueryHandle
,
true
);
}
STsdbMeta
*
pMeta
=
tsdbGetMeta
(
tsdb
);
assert
(
pMeta
!=
NULL
);
...
...
tests/script/fullGeneralSuite.sim
浏览文件 @
c60cf345
...
...
@@ -33,6 +33,7 @@ run general/compute/percentile.sim
run general/compute/stddev.sim
run general/compute/sum.sim
run general/compute/top.sim
run general/compute/block_dist.sim
run general/db/alter_option.sim
run general/db/alter_tables_d2.sim
run general/db/alter_tables_v1.sim
...
...
tests/script/general/compute/block_dist.sim
0 → 100644
浏览文件 @
c60cf345
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$dbPrefix = m_di_db
$tbPrefix = m_di_tb
$mtPrefix = m_di_mt
$ntPrefix = m_di_nt
$tbNum = 1
$rowNum = 2000
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$nt = $ntPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$cc = $x * 60000
$ms = 1601481600000 + $cc
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sql create table $nt (ts timestamp, tbcol int)
$x = 0
while $x < $rowNum
$cc = $x * 60000
$ms = 1601481600000 + $cc
sql insert into $nt values ($ms , $x )
$x = $x + 1
endw
sleep 100
print =============== step2
$i = 0
$tb = $tbPrefix . $i
sql select _block_dist() from $tb
if $rows != 1 then
print expect 1, actual:$rows
return -1
endi
print =============== step3
$i = 0
$mt = $mtPrefix . $i
sql select _block_dist() from $mt
if $rows != 1 then
print expect 1, actual:$rows
return -1
endi
print =============== step4
$i = 0
$nt = $ntPrefix . $i
sql select _block_dist() from $nt
if $rows != 1 then
print expect 1, actual:$rows
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/general/compute/testSuite.sim
浏览文件 @
c60cf345
...
...
@@ -14,3 +14,4 @@ run general/compute/percentile.sim
run general/compute/stddev.sim
run general/compute/sum.sim
run general/compute/top.sim
run general/compute/block_dist.sim
tests/script/regressionSuite.sim
浏览文件 @
c60cf345
...
...
@@ -32,6 +32,7 @@ run general/compute/percentile.sim
run general/compute/stddev.sim
run general/compute/sum.sim
run general/compute/top.sim
run general/compute/block_dist.sim
run general/db/alter_option.sim
run general/db/alter_tables_d2.sim
run general/db/alter_tables_v1.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录