Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a1dbd25c
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看板
未验证
提交
a1dbd25c
编写于
5月 24, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
5月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12930 from taosdata/fix/tsim
test: case for alter stable column
上级
8f795a63
c12db4a7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
592 addition
and
0 deletion
+592
-0
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+2
-0
tests/script/tsim/stable/column_add.sim
tests/script/tsim/stable/column_add.sim
+303
-0
tests/script/tsim/stable/column_drop.sim
tests/script/tsim/stable/column_drop.sim
+209
-0
tests/script/tsim/stable/column_modify.sim
tests/script/tsim/stable/column_modify.sim
+78
-0
未找到文件。
tests/script/jenkins/basic.txt
浏览文件 @
a1dbd25c
...
...
@@ -92,6 +92,8 @@
#./test.sh -f tsim/stable/show.sim
./test.sh -f tsim/stable/values.sim
./test.sh -f tsim/stable/vnode3.sim
./test.sh -f tsim/stable/column_add.sim
./test.sh -f tsim/stable/column_drop.sim
# --- for multi process mode
...
...
tests/script/tsim/stable/
add_column
.sim
→
tests/script/tsim/stable/
column_add
.sim
浏览文件 @
a1dbd25c
...
...
@@ -66,7 +66,13 @@ if $data[0][3] != 101 then
return -1
endi
print ========== add column c3
sql_error alter table db.stb add column ts int
sql_error alter table db.stb add column t1 int
sql_error alter table db.stb add column t2 int
sql_error alter table db.stb add column t3 int
sql_error alter table db.stb add column c1 int
print ========== step1 add column c3
sql alter table db.stb add column c3 int
sql show db.stables
if $data[0][3] != 4 then
...
...
@@ -130,12 +136,168 @@ if $data[1][4] != 101 then
return -1
endi
print ========== add column c4
print ==========
step2
add column c4
sql alter table db.stb add column c4 bigint
sql select * from db.stb
sql insert into db.ctb values(now+2s, 1, 2, 3, 4)
sql select * from db.stb
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6]
if $rows != 3 then
return -1
endi
if $data[0][1] != 1 then
return -1
endi
if $data[0][2] != 2 then
return -1
endi
if $data[0][3] != NULL then
return -1
endi
if $data[0][4] != NULL then
return -1
endi
if $data[0][5] != 101 then
return -1
endi
if $data[1][1] != 1 then
return -1
endi
if $data[1][2] != 2 then
return -1
endi
if $data[1][3] != 3 then
return -1
endi
if $data[1][4] != NULL then
return -1
endi
if $data[1][5] != 101 then
return -1
endi
if $data[2][1] != 1 then
return -1
endi
if $data[2][2] != 2 then
return -1
endi
if $data[2][3] != 3 then
return -1
endi
if $data[2][4] != 4 then
return -1
endi
if $data[2][5] != 101 then
return -1
endi
print ========== step3 add column c5
sql alter table db.stb add column c5 int
sql insert into db.ctb values(now+3s, 1, 2, 3, 4, 5)
sql select * from db.stb
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6]
if $rows != 4 then
return -1
endi
if $data[2][1] != 1 then
return -1
endi
if $data[2][2] != 2 then
return -1
endi
if $data[2][3] != 3 then
return -1
endi
if $data[2][4] != 4 then
return -1
endi
if $data[2][5] != NULL then
return -1
endi
if $data[2][6] != 101 then
return -1
endi
if $data[3][1] != 1 then
return -1
endi
if $data[3][2] != 2 then
return -1
endi
if $data[3][3] != 3 then
return -1
endi
if $data[3][4] != 4 then
return -1
endi
if $data[3][5] != 5 then
return -1
endi
if $data[3][6] != 101 then
return -1
endi
print ========== step4 add column c6
sql alter table db.stb add column c6 int
sql insert into db.ctb values(now+4s, 1, 2, 3, 4, 5, 6)
sql select * from db.stb
if $rows != 5 then
return -1
endi
if $data[3][1] != 1 then
return -1
endi
if $data[3][2] != 2 then
return -1
endi
if $data[3][3] != 3 then
return -1
endi
if $data[3][4] != 4 then
return -1
endi
if $data[3][5] != 5 then
return -1
endi
if $data[3][6] != NULL then
return -1
endi
if $data[3][7] != 101 then
return -1
endi
if $data[4][1] != 1 then
return -1
endi
if $data[4][2] != 2 then
return -1
endi
if $data[4][3] != 3 then
return -1
endi
if $data[4][4] != 4 then
return -1
endi
if $data[4][5] != 5 then
return -1
endi
if $data[4][6] != 6 then
return -1
endi
if $data[4][7] != 101 then
return -1
endi
print ========== step5 describe
sql describe db.ctb
if $rows != 10 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/stable/column_drop.sim
0 → 100644
浏览文件 @
a1dbd25c
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== prepare stb and ctb
sql create database db vgroups 1
sql create table db.stb (ts timestamp, c1 int, c2 binary(4), c3 int, c4 bigint, c5 int, c6 int) tags(t1 int, t2 float, t3 binary(16)) comment "abd"
sql create table db.ctb using db.stb tags(101, 102, "103")
sql insert into db.ctb values(now, 1, "2", 3, 4, 5, 6)
sql show db.stables
if $rows != 1 then
return -1
endi
if $data[0][0] != stb then
return -1
endi
if $data[0][1] != db then
return -1
endi
if $data[0][3] != 7 then
return -1
endi
if $data[0][4] != 3 then
return -1
endi
if $data[0][6] != abd then
return -1
endi
sql show db.tables
if $rows != 1 then
return -1
endi
if $data[0][0] != ctb then
return -1
endi
if $data[0][1] != db then
return -1
endi
if $data[0][3] != 7 then
return -1
endi
if $data[0][4] != stb then
return -1
endi
if $data[0][6] != 2 then
return -1
endi
if $data[0][9] != CHILD_TABLE then
return -1
endi
sql select * from db.stb
if $rows != 1 then
return -1
endi
if $data[0][1] != 1 then
return -1
endi
if $data[0][2] != 2 then
return -1
endi
if $data[0][3] != 3 then
return -1
endi
if $data[0][4] != 4 then
return -1
endi
if $data[0][5] != 5 then
return -1
endi
if $data[0][6] != 6 then
return -1
endi
if $data[0][7] != 101 then
return -1
endi
sql_error alter table db.stb drop column ts
sql_error alter table db.stb drop column t1
sql_error alter table db.stb drop column t2
sql_error alter table db.stb drop column t3
sql_error alter table db.stb drop column c9
print ========== step1 drop column c6
sql alter table db.stb drop column c6
sql show db.stables
if $data[0][3] != 6 then
return -1
endi
sql show db.tables
if $data[0][3] != 6 then
return -1
endi
sql select * from db.stb
sql select * from db.stb
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6]
if $rows != 1 then
return -1
endi
if $data[0][1] != 1 then
return -1
endi
if $data[0][2] != 2 then
return -1
endi
if $data[0][3] != 3 then
return -1
endi
if $data[0][4] != 4 then
return -1
endi
if $data[0][5] != 5 then
return -1
endi
if $data[0][6] != 101 then
return -1
endi
sql insert into db.ctb values(now+1s, 1, 2, 3, 4, 5)
sql select * from db.stb
if $rows != 2 then
return -1
endi
print ========== step2 drop column c5
sql alter table db.stb drop column c5
sql insert into db.ctb values(now+2s, 1, 2, 3, 4, 5)
sql insert into db.ctb values(now+3s, 1, 2, 3, 4)
sql_error insert into db.ctb values(now+2s, 1, 2, 3, 4, 5)
sql select * from db.stb
if $rows != 4 then
return -1
endi
print ========== step3 drop column c4
sql alter table db.stb drop column c4
sql select * from db.stb
sql_error insert into db.ctb values(now+2s, 1, 2, 3, 4, 5)
sql_error insert into db.ctb values(now+2s, 1, 2, 3, 4)
sql insert into db.ctb values(now+3s, 1, 2, 3)
sql select * from db.stb
if $rows != 5 then
return -1
endi
print ========== step4 add column c4
sql alter table db.stb add column c4 binary(13)
sql insert into db.ctb values(now+4s, 1, 2, 3, '4')
sql select * from db.stb
if $rows != 6 then
return -1
endi
if $data[1][4] != NULL then
return -1
endi
if $data[2][4] != NULL then
return -1
endi
if $data[3][4] != NULL then
return -1
endi
if $data[5][4] != 4 then
return -1
endi
print ========== step5 describe
sql describe db.ctb
if $rows != 8 then
return -1
endi
if $data[0][0] != ts then
return -1
endi
if $data[1][0] != c1 then
return -1
endi
if $data[2][0] != c2 then
return -1
endi
if $data[3][0] != c3 then
return -1
endi
if $data[4][0] != c4 then
return -1
endi
if $data[4][1] != VARCHAR then
return -1
endi
if $data[4][2] != 13 then
return -1
endi
if $data[5][0] != t1 then
return -1
endi
if $data[6][0] != t2 then
return -1
endi
if $data[7][0] != t3 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/stable/column_modify.sim
0 → 100644
浏览文件 @
a1dbd25c
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== prepare stb and ctb
sql create database db vgroups 1
sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 float, t3 binary(16)) comment "abd"
sql create table db.ctb using db.stb tags(101, 102, "103")
sql insert into db.ctb values(now, 1, "1234")
sql_error alter table db.stb MODIFY column c2 binary(3)
sql_error alter table db.stb MODIFY column c2 int
sql_error alter table db.stb MODIFY column c1 int
sql_error alter table db.stb MODIFY column ts int
sql_error insert into db.ctb values(now, 1, "12345")
print ========== step1 modify column
sql alter table db.stb MODIFY column c2 binary(5)
sql insert into db.ctb values(now, 1, "12345")
sql select * from db.stb
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6]
if $rows != 2 then
return -1
endi
if $data[0][1] != 1 then
return -1
endi
if $data[0][2] != 1234 then
return -1
endi
if $data[0][3] != 101 then
return -1
endi
if $data[1][1] != 1 then
return -1
endi
if $data[1][2] != 12345 then
return -1
endi
if $data[1][3] != 101 then
return -1
endi
print ========== step2 describe
sql describe db.ctb
if $rows != 7 then
return -1
endi
if $data[0][0] != ts then
return -1
endi
if $data[1][0] != c1 then
return -1
endi
if $data[2][0] != c2 then
return -1
endi
if $data[2][1] != VARCHAR then
return -1
endi
if $data[2][2] != 5 then
return -1
endi
if $data[3][0] != t1 then
return -1
endi
if $data[4][0] != t2 then
return -1
endi
if $data[5][0] != t3 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录