Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
499a266d
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看板
未验证
提交
499a266d
编写于
11月 03, 2022
作者:
D
dapan1121
提交者:
GitHub
11月 03, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17855 from taosdata/fix/TD-20087
fix: fix tbname in crash issue
上级
e6182985
d2a29ed7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
117 addition
and
1 deletion
+117
-1
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+14
-1
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-0
tests/script/tsim/tag/tbNameIn.sim
tests/script/tsim/tag/tbNameIn.sim
+102
-0
未找到文件。
source/libs/executor/src/executil.c
浏览文件 @
499a266d
...
...
@@ -925,6 +925,15 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray*
SArray
*
pTbList
=
getTableNameList
(
pList
);
int32_t
numOfTables
=
taosArrayGetSize
(
pTbList
);
SHashObj
*
uHash
=
NULL
;
size_t
listlen
=
taosArrayGetSize
(
list
);
// len > 0 means there already have uids
if
(
listlen
>
0
)
{
uHash
=
taosHashInit
(
32
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
for
(
int
i
=
0
;
i
<
listlen
;
i
++
)
{
int64_t
*
uid
=
taosArrayGet
(
list
,
i
);
taosHashPut
(
uHash
,
uid
,
sizeof
(
int64_t
),
&
i
,
sizeof
(
i
));
}
}
for
(
int
i
=
0
;
i
<
numOfTables
;
i
++
)
{
char
*
name
=
taosArrayGetP
(
pTbList
,
i
);
...
...
@@ -933,9 +942,12 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray*
if
(
metaGetTableUidByName
(
metaHandle
,
name
,
&
uid
)
==
0
)
{
ETableType
tbType
=
TSDB_TABLE_MAX
;
if
(
metaGetTableTypeByName
(
metaHandle
,
name
,
&
tbType
)
==
0
&&
tbType
==
TSDB_CHILD_TABLE
)
{
taosArrayPush
(
list
,
&
uid
);
if
(
NULL
==
uHash
||
taosHashGet
(
uHash
,
&
uid
,
sizeof
(
uid
))
==
NULL
)
{
taosArrayPush
(
list
,
&
uid
);
}
}
else
{
taosArrayDestroy
(
pTbList
);
taosHashCleanup
(
uHash
);
return
-
1
;
}
}
else
{
...
...
@@ -944,6 +956,7 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray*
}
}
taosHashCleanup
(
uHash
);
taosArrayDestroy
(
pTbList
);
return
0
;
}
...
...
tests/script/jenkins/basic.txt
浏览文件 @
499a266d
...
...
@@ -449,6 +449,7 @@
./test.sh -f tsim/tag/smallint.sim
./test.sh -f tsim/tag/tinyint.sim
./test.sh -f tsim/tag/drop_tag.sim
./test.sh -f tsim/tag/tbNameIn.sim
./test.sh -f tmp/monitor.sim
#======================b1-end===============
tests/script/tsim/tag/tbNameIn.sim
0 → 100644
浏览文件 @
499a266d
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ======== step1
sql drop database if exists db1;
sql create database db1 vgroups 3;
sql use db1;
sql create stable st1 (ts timestamp, f1 int) tags(tg1 int);
sql create table tb1 using st1 tags(1);
sql create table tb2 using st1 tags(2);
sql create table tb3 using st1 tags(3);
sql create table tb4 using st1 tags(4);
sql create table tb5 using st1 tags(5);
sql create table tb6 using st1 tags(6);
sql create table tb7 using st1 tags(7);
sql create table tb8 using st1 tags(8);
sql insert into tb1 values ('2022-07-10 16:31:01', 1);
sql insert into tb2 values ('2022-07-10 16:31:02', 2);
sql insert into tb3 values ('2022-07-10 16:31:03', 3);
sql insert into tb4 values ('2022-07-10 16:31:04', 4);
sql insert into tb5 values ('2022-07-10 16:31:05', 5);
sql insert into tb6 values ('2022-07-10 16:31:06', 6);
sql insert into tb7 values ('2022-07-10 16:31:07', 7);
sql insert into tb8 values ('2022-07-10 16:31:08', 8);
sql select * from tb1 where tbname in ('tb1');
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from tb1 where tbname in ('tb1','tb1');
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from tb1 where tbname in ('tb1','tb2','tb1');
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from tb1 where tbname in ('tb1','tb2','st1');
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from tb1 where tbname = 'tb1';
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from tb1 where tbname > 'tb1';
if $rows != 0 then
return -1
endi
sql select * from st1 where tbname in ('tb1');
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from st1 where tbname in ('tb1','tb1');
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from st1 where tbname in ('tb1','tb2','tb1');
if $rows != 2 then
return -1
endi
sql select * from st1 where tbname in ('tb1','tb2','st1');
if $rows != 2 then
return -1
endi
sql select * from st1 where tbname = 'tb1';
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from st1 where tbname > 'tb1';
if $rows != 7 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录