Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7d4464bd
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
7d4464bd
编写于
10月 21, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10700]<enhance>: add tag name escape sim test cases
上级
2723faf0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
187 addition
and
0 deletion
+187
-0
tests/script/general/parser/tagName_escape.sim
tests/script/general/parser/tagName_escape.sim
+187
-0
未找到文件。
tests/script/general/parser/tagName_escape.sim
0 → 100644
浏览文件 @
7d4464bd
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 100
sql connect
print ======================== dnode1 start
sql create database tagesc;
sql use tagesc;
print ======================= test create table/stable
sql create stable stb0 (ts timestamp, c0 int) tags (`123` int, `123 456` int, `123.abc` int)
sql create stable stb1 (ts timestamp, c1 int) tags (`!%^&*()` int)
sql create stable stb2 (ts timestamp, c2 int) tags (`int` int, `bool` int, `double` int, `INTO` int, `COLUMN` int)
sql create table ctb0 using stb0 (`123`, `123 456`, `123.abc`) tags (1, 1, 1)
sql create table ctb1 using stb1 (`!%^&*()`) tags (1)
sql create table ctb2 using stb2 (`int`, `bool`, `double`, `INTO`, `COLUMN`) tags (1, 1, 1, 1, 1)
##check table
sql describe ctb0;
if $rows != 5 then
return -1
endi
if $data20 != @123@ then
return -1
endi
if $data30 != @123 456@ then
return -1
endi
if $data40 != @123.abc@ then
return -1
endi
sql describe ctb1;
if $rows != 3 then
return -1
endi
if $data20 != @!%^&*()@ then
return -1
endi
sql describe ctb2;
if $rows != 7 then
return -1
endi
if $data20 != @int@ then
return -1
endi
if $data30 != @bool@ then
return -1
endi
if $data40 != @double@ then
return -1
endi
if $data50 != @INTO@ then
return -1
endi
if $data60 != @COLUMN@ then
return -1
endi
print ======================= test Alter tags for stable
##ADD TAG
sql_error alter stable stb0 add tag `123` int
sql_error alter stable stb0 add tag `123 456` int
sql_error alter stable stb0 add tag `123.abc` int
sql alter stable stb0 add tag `!%^&*()` int
sql alter stable stb0 add tag `int` int
sql alter stable stb0 add tag `bool` int
sql alter stable stb0 add tag `double` int
sql alter stable stb0 add tag `INTO` int
sql alter stable stb0 add tag `COLUMN` int
sql describe stb0;
if $rows != 11 then
return -1
endi
if $data50 != @!%^&*()@ then
return -1
endi
if $data60 != @int@ then
return -1
endi
if $data70 != @bool@ then
return -1
endi
if $data80 != @double@ then
return -1
endi
if $data90 != @INTO@ then
return -1
endi
##DROP TAG
sql alter stable stb0 drop tag `!%^&*()`
sql alter stable stb0 drop tag `int`
sql alter stable stb0 drop tag `bool`
sql alter stable stb0 drop tag `double`
sql alter stable stb0 drop tag `INTO`
sql alter stable stb0 drop tag `COLUMN`
sql describe stb0;
if $rows != 5 then
return -1
endi
if $data20 != @123@ then
return -1
endi
if $data30 != @123 456@ then
return -1
endi
if $data40 != @123.abc@ then
return -1
endi
##CHANGE TAG
sql alter stable stb0 change tag `123` `321`
sql alter stable stb0 change tag `123 456` `456 123`
#sql alter stable stb0 change tag `123.abc` `abc.123`
#change tag has bug when using dot in tagname
sql describe stb0;
if $rows != 5 then
return -1
endi
if $data20 != @321@ then
return -1
endi
if $data30 != @456 123@ then
return -1
endi
##SET TAG
sql insert into ctb0 values (now, 1)
sql insert into ctb1 values (now, 1)
sql insert into ctb2 values (now, 1)
sql alter table ctb0 set tag `321`=2
sql alter table ctb0 set tag `456 123`=2
#sql alter table ctb0 set tag `abc.123`=2
#change tag has bug when using dot in tagname
print ======================= test insert specific tags automatically create table
sql alter table ctb0 set tag `321`=2
sql alter table ctb0 set tag `321`=2
sql insert into ctb0_0 using stb0 (`321`, `456 123`, `123.abc`) tags (1, 1, 1) values (now + 10s, 5)
sql insert into ctb1_0 using stb1 (`!%^&*()`) tags (1) values (now + 10s, 5)
sql insert into ctb2_0 using stb2 (`int`, `bool`, `double`, `INTO`, `COLUMN`) tags (1, 1, 1, 1, 1) values (now + 10s, 5)
sql insert into ctb2_1 using stb2 (`int`, `bool`, `INTO`, `COLUMN`) tags (1, 1, 1, 1) values (now + 10s, 5)
sql select * from stb0;
if $rows != 2 then
return -1
endi
sql select * from stb1;
if $rows != 2 then
return -1
endi
sql select * from stb2;
if $rows != 3 then
return -1
endi
if $data24 != NULL 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录