Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2723faf0
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看板
提交
2723faf0
编写于
10月 21, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10700]<enhance>: add column name escape sim test cases
上级
022ec6b0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
391 addition
and
0 deletion
+391
-0
tests/script/fullGeneralSuite.sim
tests/script/fullGeneralSuite.sim
+1
-0
tests/script/general/parser/columnName_escape.sim
tests/script/general/parser/columnName_escape.sim
+390
-0
未找到文件。
tests/script/fullGeneralSuite.sim
浏览文件 @
2723faf0
...
...
@@ -228,4 +228,5 @@ run general/db/show_create_table.sim
run general/parser/like.sim
run general/parser/regex.sim
run general/parser/tbname_escape.sim
run general/parser/columnName_escape.sim
run general/parser/interp_blocks.sim
tests/script/general/parser/columnName_escape.sim
0 → 100644
浏览文件 @
2723faf0
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 colesc;
sql use colesc;
print ======================= test create table/stable
sql create table tb0 (ts timestamp, `123` int, `123 456` int, `123.abc` int)
sql create table tb1 (ts timestamp, `!%^&*()` int)
sql create table tb2 (ts timestamp, `int` int, `bool` int, `double` int, `INTO` int, `COLUMN` int)
sql create table stb0 (ts timestamp, `123` int, `123 456` int, `123.abc` int) tags (t1 int)
sql create table stb1 (ts timestamp, `!%^&*()` int) tags (t2 int)
sql create table stb2 (ts timestamp, `int` int, `bool` int, `double` int, `INTO` int, `COLUMN` int) tags (t3 int)
sql create table ctb0 using stb0 tags (1)
sql create table ctb1 using stb1 tags (1)
sql create table ctb2 using stb2 tags (1)
##check table
sql describe tb0;
if $rows != 4 then
return -1
endi
if $data10 != @123@ then
return -1
endi
if $data20 != @123 456@ then
return -1
endi
if $data30 != @123.abc@ then
return -1
endi
sql describe tb1;
if $rows != 2 then
return -1
endi
if $data10 != @!%^&*()@ then
return -1
endi
sql describe tb2;
if $rows != 6 then
return -1
endi
if $data10 != @int@ then
return -1
endi
if $data20 != @bool@ then
return -1
endi
if $data30 != @double@ then
return -1
endi
if $data40 != @INTO@ then
return -1
endi
if $data50 != @COLUMN@ then
return -1
endi
##check stable
sql describe stb0;
if $rows != 5 then
return -1
endi
if $data10 != @123@ then
return -1
endi
if $data20 != @123 456@ then
return -1
endi
if $data30 != @123.abc@ then
return -1
endi
sql describe stb1;
if $rows != 3 then
return -1
endi
if $data10 != @!%^&*()@ then
return -1
endi
sql describe stb2;
if $rows != 7 then
return -1
endi
if $data10 != @int@ then
return -1
endi
if $data20 != @bool@ then
return -1
endi
if $data30 != @double@ then
return -1
endi
if $data40 != @INTO@ then
return -1
endi
if $data50 != @COLUMN@ then
return -1
endi
print ======================= test Alter columns for table/stable
sql_error alter table tb0 add column `123` int
sql_error alter table tb0 add column `123 456` int
sql_error alter table tb0 add column `123.abc` int
sql_error alter table ctb0 add column `1234`
sql alter table tb0 add column `!%^&*()` int
sql alter table tb0 add column `int` int
sql alter table tb0 add column `bool` bool
sql alter table tb0 add column `double` bool
sql alter table tb0 add column `INTO` bool
sql alter table tb0 add column `COLUMN` bool
sql alter table stb0 add column `!%^&*()` int
sql alter table stb0 add column `int` int
sql alter table stb0 add column `bool` bool
sql alter table stb0 add column `double` bool
sql alter table stb0 add column `INTO` bool
sql alter table stb0 add column `COLUMN` bool
##check table
sql describe tb0;
if $rows != 10 then
return -1
endi
if $data40 != @!%^&*()@ then
return -1
endi
if $data50 != @int@ then
return -1
endi
if $data60 != @bool@ then
return -1
endi
if $data70 != @double@ then
return -1
endi
if $data80 != @INTO@ then
return -1
endi
if $data90 != @COLUMN@ then
return -1
endi
#check stable
sql describe stb0;
if $rows != 11 then
return -1
endi
if $data40 != @!%^&*()@ then
return -1
endi
if $data50 != @int@ then
return -1
endi
if $data60 != @bool@ then
return -1
endi
if $data70 != @double@ then
return -1
endi
if $data80 != @INTO@ then
return -1
endi
if $data90 != @COLUMN@ then
return -1
endi
##############
sql_error alter table ctb0 drop column `123`
sql_error alter table ctb0 drop column `123 456`
sql_error alter table ctb0 drop column `123.abc`
sql alter table tb0 drop column `!%^&*()`
sql alter table tb0 drop column `int`
sql alter table tb0 drop column `bool`
sql alter table tb0 drop column `double`
sql alter table tb0 drop column `INTO`
sql alter table tb0 drop column `COLUMN`
sql alter table stb0 drop column `!%^&*()`
sql alter table stb0 drop column `int`
sql alter table stb0 drop column `bool`
sql alter table stb0 drop column `double`
sql alter table stb0 drop column `INTO`
sql alter table stb0 drop column `COLUMN`
##check table
sql describe tb0;
if $rows != 4 then
return -1
endi
if $data10 != @123@ then
return -1
endi
if $data20 != @123 456@ then
return -1
endi
if $data30 != @123.abc@ then
return -1
endi
##check stable
sql describe stb0;
if $rows != 5 then
return -1
endi
if $data10 != @123@ then
return -1
endi
if $data20 != @123 456@ then
return -1
endi
if $data30 != @123.abc@ then
return -1
endi
print ======================= test insert columns for table/stable
sql insert into tb0 (ts, `123`, `123 456`, `123.abc`) values (now, 1, 1, 1)
sql insert into tb1 (ts, `!%^&*()`) values (now, 1)
sql insert into tb2 (ts, `int`, `bool`, `double`, `INTO`, `COLUMN`) values (now, 1, 1, 1, 1, 1)
sql insert into ctb0 (ts, `123`, `123 456`, `123.abc`) values (now, 1, 1, 1)
sql insert into ctb1 (ts, `!%^&*()`) values (now, 1)
sql insert into ctb2 (ts, `int`, `bool`, `double`, `INTO`, `COLUMN`) values (now, 1, 1, 1, 1, 1)
sql select * from tb0;
if $rows != 1 then
return -1
endi
sql select * from tb1;
if $rows != 1 then
return -1
endi
sql select * from tb2;
if $rows != 1 then
return -1
endi
sql select * from ctb0;
if $rows != 1 then
return -1
endi
sql select * from ctb1;
if $rows != 1 then
return -1
endi
sql select * from ctb2;
if $rows != 1 then
return -1
endi
print ======================= test select columns for table/stable
sql select `123`,`123 456`,`123.abc` from tb0;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
sql select `!%^&*()` from tb1;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
sql select `int`,`bool`,`double`,`INTO`,`COLUMN` from tb2;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 1 then
return -1
endi
sql select `123`,`123 456`,`123.abc` from stb0;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
sql select `!%^&*()` from stb1;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
sql select `int`,`bool`,`double`,`INTO`,`COLUMN` from stb2;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 1 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录