未验证 提交 4aec7e12 编写于 作者: S slguan 提交者: GitHub

Merge pull request #1665 from taosdata/feature/mpeer

Feature/mpeer
#################################
run general/table/basic1.sim
run general/table/basic2.sim
run general/table/basic3.sim
run general/db/basic1.sim
run general/db/basic2.sim
run general/db/basic3.sim
run general/db/basic4.sim
run general/db/basic5.sim
run general/user/basic1.sim
run general/db/testSuite.sim
run general/insert/testSuite.sim
run general/table/testSuite.sim
run general/user/testSuite.sim
##################################
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
print ========== step1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/cfg.sh -n dnode1 -c monitor -v 1
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ========== step2
sql drop database log -x step21
return -1
step21:
sql drop table log.cpu -x step22
return -1
step22:
sql drop user log -x step23
return -1
step23:
print ========== step3
sleep 3000
sql select * from log.dn
if $rows == 0 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============= step1
sql create user read pass 'taosdata1'
sql create user write pass 'taosdata1'
sql alter user read pass 'taosdata'
sql alter user write pass 'taosdata'
sql show users
if $rows != 5 then
return -1
endi
print ============= step2
sql close
sql connect read
sleep 2000
sql alter user read pass 'taosdata'
sql alter user write pass 'taosdata1' -x step2
return -1
step2:
print ============= step3
sql close
sql connect write
sleep 2000
sql alter user write pass 'taosdata'
sql alter user read pass 'taosdata' -x step3
return -1
step3:
print ============= step4
sql close
sql connect
sleep 2000
sql create user oroot pass 'taosdata'
sql show users
if $rows != 6 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
$i = 0
$dbPrefix = apdb
$tbPrefix = aptb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$userPrefix = apusr
print =============== step1
$i = 0
$user = $userPrefix . $i
sql drop user $user -x step11
return -1
step11:
sql create user $user PASS -x step12
return -1
step12:
sql create user $user PASS 'taosdata'
sql show users
if $rows != 4 then
return -1
endi
print =============== step2
$i = 1
$user = $userPrefix . $i
sql drop user $user -x step2
step2:
sql create user $user PASS '1'
sql show users
if $rows != 5 then
return -1
endi
print =============== step3
$i = 2
$user = $userPrefix . $i
sql drop user $user -x step3
step3:
sql create user $user PASS 'abc0123456789'
sql show users
if $rows != 6 then
return -1
endi
print =============== step4
$i = 3
$user = $userPrefix . $i
sql create user $user PASS 'abcd012345678901234567891234567890' -x step4
return -1
step4:
sql show users
if $rows != 6 then
return -1
endi
$i = 0
while $i < 3
$user = $userPrefix . $i
sql drop user $user
$i = $i + 1
endw
sql show users
if $rows != 3 then
return -1
endi
run lite/account/pass_alter.sim
run lite/account/pass_len.sim
run lite/account/user_create.sim
run lite/account/user_len.sim
run lite/account/monitor.sim
\ No newline at end of file
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print =============== step1
sql show users
if $rows != 3 then
return -1
endi
sql create user read PASS 'pass123'
sql create user read PASS 'pass123' -x step1
return -1
step1:
sql show users
if $rows != 4 then
return -1
endi
sql alter user read PASS 'taosdata'
print =============== step2
sql close
sql connect read
sleep 2000
sql alter user read PASS 'taosdata'
print =============== step3
sql drop user read -x step31
return -1
step31:
sql drop user sys -x step32
return -1
step32:
sql drop user stream -x step33
return -1
step33:
print =============== step4
sql close
sql connect
sleep 2000
sql alter user read privilege read
sql show users
if $data1_read != read then
return -1
endi
sql_error alter user read privilege super
sql show users
if $data1_read != read then
return -1
endi
sql alter user read privilege write
sql show users
if $data1_read != write then
return -1
endi
sql alter user read privilege 1 -x step43
return -1
step43:
sql drop user sys -x step41
return -1
step41:
sql drop user stream -x step42
return -1
step42:
sql drop user read
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
$i = 0
$dbPrefix = lm_us_db
$tbPrefix = lm_us_tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql drop user ac -x step0
return -1
step0:
sql create user PASS '123' -x step1
return -1
step1:
sql show users
if $rows != 3 then
return -1
endi
print =============== step2
sql drop user a -x step2
step2:
sql create user a PASS '123'
sql show users
if $rows != 4 then
return -1
endi
sql drop user a
sql show users
if $rows != 3 then
return -1
endi
print =============== step3
sql drop user abc01234567890123456789 -x step3
step3:
sql create user abc01234567890123456789 PASS '123'
sql show users
if $rows != 4 then
return -1
endi
sql drop user abc01234567890123456789
sql show users
if $rows != 3 then
return -1
endi
print =============== step4
sql create user abcd0123456789012345678901234567890111 PASS '123' -x step4
return -1
step4:
sql show users
if $rows != 3 then
return -1
endi
print =============== step5
sql drop user 123 -x step5
step5:
sql create user 123 PASS '123' -x step61
return -1
step61:
sql create user a123 PASS '123'
sql show users
if $rows != 4 then
return -1
endi
sql drop user a123
sql show users
if $rows != 3 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print =================== step1
sql create database db
sql use db
sql create table mt (ts timestamp, k int, h binary(20), t bigint, s float, f double, x smallint, y tinyint, z bool) tags (a int, b binary(20), c bigint)
sql create table tb using mt tags (0, '1', 2)
sql insert into tb values(now -200d, 200, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -100d, 100, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -30d, 30, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -20d, 20, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -10d, 10, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -5d, 5, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now -1d, 1, '1', 2, 3, 4, 5, 6, true);
sql insert into tb values(now, 0, '1', 2, 3, 4, 5, 6, true);
sql select * from db.mt
if $rows != 8 then
return -1
endi
sql select * from db.tb
if $rows != 8 then
return -1
endi
sql select count(*) from db.mt
if $data00 != 8 then
return -1
endi
sql select count(*), last(ts), min(k), max(k), avg(k) from db.mt where a=0 and ts>="2016-4-29 8:0:0" and ts < "2018-7-18 8:9:0" interval(1d) fill(value, 1)
sql select count(*), last(ts), min(k), max(k), avg(k) from db.mt where a=0 and ts>="2016-4-29 8:0:0" and ts < "2018-7-18 8:9:0" interval(1d) fill(value, 1)
print =================== step2
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000
system sh/exec.sh -n dnode1 -s start
sleep 3000
print =================== step3
sql select * from db.mt
if $rows != 8 then
return -1
endi
sql select * from db.tb
if $rows != 8 then
return -1
endi
sql select count(*) from db.mt
if $data00 != 8 then
return -1
endi
此差异已折叠。
run lite/agg/fill.sim
run lite/agg/stream.sim
\ No newline at end of file
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
$db = csaa_db
$stb = csaastb
$tb1 = csaatb1
$tb2 = csaatb2
$ts0 = 1537146000000
$delta = 600000
print ========== cached_schema_after_alter.sim
sql drop database $db -x step1
step1:
sql create database $db
print ====== create tables
sql use $db
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
sql create table $tb1 using $stb tags( 1 )
sql create table $tb2 using $stb tags( 2 )
sql_error alter table $tb1 add column c0 int
sql alter table $stb add column c2 int
sql insert into $tb2 values ( $ts0 , 1, 1)
sql select * from $stb
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
sql select * from $tb2
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 2000
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sql connect
sleep 3000
sql use $db
sql select * from $stb
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
sql select * from $tb2
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
$ts = $ts0 + $delta
sql insert into $tb2 values ( $ts , 2, 2)
sql select * from $stb order by ts asc
if $rows != 2 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data11 != 2 then
return -1
endi
if $data12 != 2 then
return -1
endi
sql select * from $tb2 order by ts asc
if $rows != 2 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data11 != 2 then
return -1
endi
if $data12 != 2 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
print ========= start dnode1 as master
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d1 replica 1 days 7 keep 50
sql use d1
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-28d, -28)
sql insert into tb values(now-27d, -27)
sql insert into tb values(now-26d, -26)
sql select count(a) from tb
if $data00 != 3 then
return -1
endi
print ======== step2
sql alter table tb add column b smallint
sql insert into tb values(now-25d, -25, 0)
sql insert into tb values(now-24d, -24, 1)
sql insert into tb values(now-23d, -23, 2)
sql select count(b) from tb
if $data00 != 3 then
return -1
endi
print ======== step3
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint)
sql alter table tb add column c tinyint
sql insert into tb values(now-22d, -22, 3, 0)
sql insert into tb values(now-21d, -21, 4, 1)
sql insert into tb values(now-20d, -20, 5, 2)
sql select count(c) from tb
if $data00 != 3 then
return -1
endi
print ======== step4
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int)
sql alter table tb add column d int
sql insert into tb values(now-19d, -19, 6, 0, 0)
sql insert into tb values(now-18d, -18, 7, 1, 1)
sql insert into tb values(now-17d, -17, 8, 2, 2)
sql select count(d) from tb
if $data00 != 3 then
return -1
endi
print ======== step5
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint)
sql alter table tb add column e bigint
sql insert into tb values(now-16d, -16, 9, 0, 0, 0)
sql insert into tb values(now-15d, -15, 10, 1, 1, 1)
sql insert into tb values(now-14d, -14, 11, 2, 2, 2)
sql select count(e) from tb
if $data00 != 3 then
return -1
endi
print ======== step6
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float)
sql alter table tb add column f float
sql insert into tb values(now-13d, -13, 12, 0, 0, 0, 0)
sql insert into tb values(now-12d, -12, 13, 1, 1, 1, 1)
sql insert into tb values(now-11d, -11, 24, 2, 2, 2, 2)
sql select count(f) from tb
if $data00 != 3 then
return -1
endi
print ======== step7
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float, g double)
sql alter table tb add column g double
sql insert into tb values(now-10d, -10, 15, 0, 0, 0, 0, 0)
sql insert into tb values(now-9d, -9, 16, 1, 1, 1, 1, 1)
sql insert into tb values(now-8d, -8, 17, 2, 2, 2, 2, 2)
sql select count(g) from tb
if $data00 != 3 then
return -1
endi
print ======== step8
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float, g double, h binary(10) )
sql alter table tb add column h binary(10)
sql insert into tb values(now-7d, -7, 18, 0, 0, 0, 0, 0, '0')
sql insert into tb values(now-6d, -6, 19, 1, 1, 1, 1, 1, '1')
sql insert into tb values(now-5d, -5, 20, 2, 2, 2, 2, 2, '2')
sql select count(h) from tb
if $data00 != 3 then
return -1
endi
print ======== step9
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data00 != 24 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data01 != 21 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data02 != 18 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data03 != 15 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data04 != 12 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data05 != 9 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data06 != 6 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data07 != 3 then
return -1
endi
print ============= step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data00 != 24 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data01 != 21 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data02 != 18 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data03 != 15 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data04 != 12 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data05 != 9 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data06 != 6 then
return -1
endi
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
if $data07 != 3 then
return -1
endi
print ======== step11
#sql alter table tb(ts timestamp, b smallint, c tinyint, d int, e bigint, f float, g double, h binary(20))
sql alter table tb drop column a
sql insert into tb values(now-4d, 1, 1, 1, 1, 1, 1, '1')
sql select count(g) from tb
if $data00 != 7 then
return -1
endi
print ======== step12
#sql alter table tb(ts timestamp, c tinyint, d int, e bigint, f float, g double, h binary(20))
sql alter table tb drop column b
sql insert into tb values(now-3d, 1, 1, 1, 1, 1, '1')
sql select count(g) from tb
if $data00 != 8 then
return -1
endi
print ======== step13
#sql alter table tb(ts timestamp, d int, e bigint, f float, g double, h binary(20))
sql alter table tb drop column c
sql insert into tb values(now-2d, 1, 1, 1, 1, '1')
sql select count(g) from tb
if $data00 != 9 then
return -1
endi
print ======== step14
#sql alter table tb(ts timestamp, e bigint, f float, g double, h binary(20))
sql alter table tb drop column d
sql insert into tb values(now-1d, 1, 1, 1, '1')
sql select count(g) from tb
if $data00 != 10 then
return -1
endi
print ======== step15
#sql alter table tb(ts timestamp, f float, g double, h binary(20))
sql alter table tb drop column e
sql insert into tb values(now, 1, 1, '1')
sql select count(g) from tb
if $data00 != 11 then
return -1
endi
print ======== step16
#sql alter table tb(ts timestamp, g double, h binary(20))
sql alter table tb drop column f
sql insert into tb values(now+1d, 1, '1')
sql select count(g) from tb
if $data00 != 12 then
return -1
endi
print ======== step17
#sql alter table tb(ts timestamp, h binary(20))
sql alter table tb drop column g
sql insert into tb values(now+2d, '1')
sql select count(h) from tb
if $data00 != 10 then
return -1
endi
print ============== step18
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
#sql select count(g) from tb
#if $data00 != 12 then
# return -1
#endi
sql select count(*) from tb
if $data00 != 31 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
print ========= start dnode1 as master
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d1 replica 1 days 7 keep 50
sql use d1
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-30d, -28)
sql insert into tb values(now-27d, -27)
sql insert into tb values(now-26d, -26)
sql select count(a) from tb
if $data00 != 3 then
return -1
endi
print ======== step2
#sql alter table tb(ts timestamp, a int, b smallint)
sql alter table tb add column b smallint
sql insert into tb values(now-25d, -25, 0)
sql insert into tb values(now-22d, -24, 1)
sql insert into tb values(now-20d, -23, 2)
sql select count(b) from tb
if $data00 != 3 then
return -1
endi
print ========= step3
sql import into tb values(now-23d, -23, 0)
sql import into tb values(now-21d, -21, 0)
sql select count(b) from tb
if $data00 != 5 then
return -1
endi
sql_error import into tb values(now-29d, -29, 0)
sql select count(b) from tb
if $data00 != 5 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d3
sql use d3
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-28d, -28)
sql select * from tb order by ts desc
if $rows != 1 then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
print ======== step2
sleep 2500
sql alter table tb add column b smallint
sql insert into tb values(now-25d, -25, 0)
sleep 3000
sql select * from tb order by ts desc
print $rows
if $rows != 2 then
return -1
endi
if $data01 != -25 then
return -1
endi
if $data11 != -28 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data12 != null then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
print ======== step3
sleep 2500
sql alter table tb add column c tinyint
sql insert into tb values(now-22d, -22, 3, 0)
sleep 3000
sql select * from tb order by ts asc
if $rows != 3 then then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -25 then
return -1
endi
if $data12 != 0 then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != -22 then
return -1
endi
if $data22 != 3 then
return -1
endi
if $data23 != 0 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
print ======== step4
sleep 2500
sql alter table tb add column d int
sql insert into tb values(now-19d, -19, 6, 3, 0)
sleep 3000
sql select * from tb order by ts asc
if $rows != 4 then then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -25 then
return -1
endi
if $data12 != 0 then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != -22 then
return -1
endi
if $data22 != 3 then
return -1
endi
if $data23 != 0 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != 6 then
return -1
endi
if $data33 != 3 then
return -1
endi
if $data34 != 0 then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
print ======== step5
sleep 2500
sql alter table tb add column e bigint
sql insert into tb values(now-16d, -16, 9, 5, 4, 3)
sleep 3000
sql select count(e) from tb
if $data00 != 1 then
return -1
endi
sql select count(c) from tb
if $data00 != 3 then then
return -1
endi
sql select * from tb order by ts asc
if $rows != 5 then then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -25 then
return -1
endi
if $data12 != 0 then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != -22 then
return -1
endi
if $data22 != 3 then
return -1
endi
if $data23 != 0 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != 6 then
return -1
endi
if $data33 != 3 then
return -1
endi
if $data34 != 0 then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
if $data41 != -16 then
return -1
endi
if $data42 != 9 then
return -1
endi
if $data43 != 5 then
return -1
endi
if $data44 != 4 then
return -1
endi
if $data45 != 3 then
return -1
endi
if $data46 != null then
return -1
endi
if $data47 != null then
return -1
endi
if $data48 != null then
return -1
endi
print ======== step6
sleep 2500
sql alter table tb add column f float
sql insert into tb values(now-13d, -13, 12, 11, 10, 9, 8)
sleep 3000
sql select * from tb order by ts asc
if $rows != 6 then then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -25 then
return -1
endi
if $data12 != 0 then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != -22 then
return -1
endi
if $data22 != 3 then
return -1
endi
if $data23 != 0 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != 6 then
return -1
endi
if $data33 != 3 then
return -1
endi
if $data34 != 0 then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
if $data41 != -16 then
return -1
endi
if $data42 != 9 then
return -1
endi
if $data43 != 5 then
return -1
endi
if $data44 != 4 then
return -1
endi
if $data45 != 3 then
return -1
endi
if $data46 != null then
return -1
endi
if $data47 != null then
return -1
endi
if $data48 != null then
return -1
endi
if $data51 != -13 then
return -1
endi
if $data52 != 12 then
return -1
endi
if $data53 != 11 then
return -1
endi
if $data54 != 10 then
return -1
endi
if $data55 != 9 then
return -1
endi
if $data56 != 8.00000 then
return -1
endi
if $data57 != null then
return -1
endi
if $data58 != null then
return -1
endi
print ======== step7
sleep 2500
sql alter table tb add column g double
sql insert into tb values(now-10d, -10, 15, 14, 13, 12, 11, 10)
sleep 3000
sql select * from tb order by ts asc
if $rows != 7 then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -25 then
return -1
endi
if $data12 != 0 then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != -22 then
return -1
endi
if $data22 != 3 then
return -1
endi
if $data23 != 0 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != 6 then
return -1
endi
if $data33 != 3 then
return -1
endi
if $data34 != 0 then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
if $data41 != -16 then
return -1
endi
if $data42 != 9 then
return -1
endi
if $data43 != 5 then
return -1
endi
if $data44 != 4 then
return -1
endi
if $data45 != 3 then
return -1
endi
if $data46 != null then
return -1
endi
if $data47 != null then
return -1
endi
if $data48 != null then
return -1
endi
if $data51 != -13 then
return -1
endi
if $data52 != 12 then
return -1
endi
if $data53 != 11 then
return -1
endi
if $data54 != 10 then
return -1
endi
if $data55 != 9 then
return -1
endi
if $data56 != 8.00000 then
return -1
endi
if $data57 != null then
return -1
endi
if $data58 != null then
return -1
endi
if $data61 != -10 then
return -1
endi
if $data62 != 15 then
return -1
endi
if $data63 != 14 then
return -1
endi
if $data64 != 13 then
return -1
endi
if $data65 != 12 then
return -1
endi
if $data66 != 11.00000 then
return -1
endi
if $data67 != 10.000000000 then
return -1
endi
if $data68 != null then
return -1
endi
print ======== step8
sleep 2500
sql alter table tb add column h binary(10)
sql insert into tb values(now-7d, -7, 18, 17, 16, 15, 14, 13, '11')
sleep 3000
sql select * from tb order by ts asc
if $rows != 8 then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -25 then
return -1
endi
if $data12 != 0 then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != -22 then
return -1
endi
if $data22 != 3 then
return -1
endi
if $data23 != 0 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != 6 then
return -1
endi
if $data33 != 3 then
return -1
endi
if $data34 != 0 then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
if $data41 != -16 then
return -1
endi
if $data42 != 9 then
return -1
endi
if $data43 != 5 then
return -1
endi
if $data44 != 4 then
return -1
endi
if $data45 != 3 then
return -1
endi
if $data46 != null then
return -1
endi
if $data47 != null then
return -1
endi
if $data48 != null then
return -1
endi
if $data51 != -13 then
return -1
endi
if $data52 != 12 then
return -1
endi
if $data53 != 11 then
return -1
endi
if $data54 != 10 then
return -1
endi
if $data55 != 9 then
return -1
endi
if $data56 != 8.00000 then
return -1
endi
if $data57 != null then
return -1
endi
if $data58 != null then
return -1
endi
if $data61 != -10 then
return -1
endi
if $data62 != 15 then
return -1
endi
if $data63 != 14 then
return -1
endi
if $data64 != 13 then
return -1
endi
if $data65 != 12 then
return -1
endi
if $data66 != 11.00000 then
return -1
endi
if $data67 != 10.000000000 then
return -1
endi
if $data68 != null then
return -1
endi
if $data71 != -7 then
return -1
endi
if $data72 != 18 then
return -1
endi
if $data73 != 17 then
return -1
endi
if $data74 != 16 then
return -1
endi
if $data75 != 15 then
return -1
endi
if $data76 != 14.00000 then
return -1
endi
if $data77 != 13.000000000 then
return -1
endi
if $data78 != 11 then
return -1
endi
if $data79 != null then
return -1
endi
print ======== step9
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
sql select * from tb
if $rows != 8 then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -25 then
return -1
endi
if $data12 != 0 then
return -1
endi
if $data13 != null then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != -22 then
return -1
endi
if $data22 != 3 then
return -1
endi
if $data23 != 0 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != 6 then
return -1
endi
if $data33 != 3 then
return -1
endi
if $data34 != 0 then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
if $data41 != -16 then
return -1
endi
if $data42 != 9 then
return -1
endi
if $data43 != 5 then
return -1
endi
if $data44 != 4 then
return -1
endi
if $data45 != 3 then
return -1
endi
if $data46 != null then
return -1
endi
if $data47 != null then
return -1
endi
if $data48 != null then
return -1
endi
if $data51 != -13 then
return -1
endi
if $data52 != 12 then
return -1
endi
if $data53 != 11 then
return -1
endi
if $data54 != 10 then
return -1
endi
if $data55 != 9 then
return -1
endi
if $data56 != 8.00000 then
return -1
endi
if $data57 != null then
return -1
endi
if $data58 != null then
return -1
endi
if $data61 != -10 then
return -1
endi
if $data62 != 15 then
return -1
endi
if $data63 != 14 then
return -1
endi
if $data64 != 13 then
return -1
endi
if $data65 != 12 then
return -1
endi
if $data66 != 11.00000 then
return -1
endi
if $data67 != 10.000000000 then
return -1
endi
if $data68 != null then
return -1
endi
if $data71 != -7 then
return -1
endi
if $data72 != 18 then
return -1
endi
if $data73 != 17 then
return -1
endi
if $data74 != 16 then
return -1
endi
if $data75 != 15 then
return -1
endi
if $data76 != 14.00000 then
return -1
endi
if $data77 != 13.000000000 then
return -1
endi
if $data78 != 11 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d4
sql use d4
sql create table tb (ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float, g double, h binary(10))
sql insert into tb values(now-28d, 1, 2, 3, 4, 5, 6, 7, 8)
sql select * from tb order by ts desc
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 2 then
return -1
endi
if $data03 != 3 then
return -1
endi
if $data04 != 4 then
return -1
endi
if $data05 != 5 then
return -1
endi
if $data06 != 6.00000 then
return -1
endi
if $data07 != 7.000000000 then
return -1
endi
if $data08 != 8 then
return -1
endi
print ======== step2
sleep 2500
sql_error alter table tb add column b smallint
sql_error alter table tb add column b int
sql alter table tb drop column b
sql insert into tb values(now-25d, 2, 3, 4, 5, 6, 7, 8)
sleep 3000
sql select * from tb order by ts desc
if $rows != 2 then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data02 != 3 then
return -1
endi
if $data03 != 4 then
return -1
endi
if $data04 != 5 then
return -1
endi
if $data05 != 6.00000 then
return -1
endi
if $data06 != 7.000000000 then
return -1
endi
if $data07 != 8 then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data12 != 3 then
return -1
endi
if $data13 != 4 then
return -1
endi
if $data14 != 5 then
return -1
endi
if $data15 != 6.00000 then
return -1
endi
if $data16 != 7.000000000 then
return -1
endi
if $data17 != 8 then
return -1
endi
if $data18 != null then
return -1
endi
print ======== step3
sleep 2500
sql alter table tb drop column c
sql insert into tb values(now-22d, 3, 4, 5, 6, 7, 8)
sleep 3000
sql select * from tb order by ts desc
if $rows != 3 then
return -1
endi
if $data01 != 3 then
return -1
endi
if $data02 != 4 then
return -1
endi
if $data03 != 5 then
return -1
endi
if $data04 != 6.00000 then
return -1
endi
if $data05 != 7.000000000 then
return -1
endi
if $data06 != 8 then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != 2 then
return -1
endi
if $data12 != 4 then
return -1
endi
if $data13 != 5 then
return -1
endi
if $data14 != 6.00000 then
return -1
endi
if $data15 != 7.000000000 then
return -1
endi
if $data16 != 8 then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data22 != 4 then
return -1
endi
if $data23 != 5 then
return -1
endi
if $data24 != 6.00000 then
return -1
endi
if $data25 != 7.000000000 then
return -1
endi
if $data26 != 8 then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
print ======== step4
sleep 2500
sql alter table tb drop column d
sql alter table tb drop column e
sql insert into tb values(now-19d, -19, 6, 3, 0)
sleep 3000
sql select * from tb order by ts desc
if $rows != 4 then
return -1
endi
if $data01 != -19 then
return -1
endi
if $data02 != 6.00000 then
return -1
endi
if $data03 != 3.000000000 then
return -1
endi
if $data04 != 0 then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != 3 then
return -1
endi
if $data12 != 6.00000 then
return -1
endi
if $data13 != 7.000000000 then
return -1
endi
if $data14 != 8 then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != 2 then
return -1
endi
if $data22 != 6.00000 then
return -1
endi
if $data23 != 7.000000000 then
return -1
endi
if $data24 != 8 then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != 1 then
return -1
endi
if $data32 != 6.00000 then
return -1
endi
if $data33 != 7.000000000 then
return -1
endi
if $data34 != 8 then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
print ======== step5
sleep 2500
sql alter table tb drop column g
sql insert into tb values(now-16d, -16, 9, 5)
sleep 3000
sql select count(f) from tb
if $data00 != 5 then
return -1
endi
sql select * from tb order by ts desc
if $rows != 5 then
return -1
endi
if $data01 != -16 then
return -1
endi
if $data02 != 9.00000 then
return -1
endi
if $data03 != 5 then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data11 != -19 then
return -1
endi
if $data12 != 6.00000 then
return -1
endi
if $data13 != 0 then
return -1
endi
if $data14 != null then
return -1
endi
if $data15 != null then
return -1
endi
if $data16 != null then
return -1
endi
if $data17 != null then
return -1
endi
if $data18 != null then
return -1
endi
if $data21 != 3 then
return -1
endi
if $data22 != 6.00000 then
return -1
endi
if $data23 != 8 then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != 2 then
return -1
endi
if $data32 != 6.00000 then
return -1
endi
if $data33 != 8 then
return -1
endi
if $data34 != null then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
if $data41 != 1 then
return -1
endi
if $data42 != 6.00000 then
return -1
endi
if $data43 != 8 then
return -1
endi
if $data44 != null then
return -1
endi
if $data45 != null then
return -1
endi
if $data46 != null then
return -1
endi
if $data47 != null then
return -1
endi
if $data48 != null then
return -1
endi
print ======== step6
sleep 2500
sql alter table tb drop column f
sql insert into tb values(now-13d, -13, 7)
sleep 3000
sql select * from tb order by ts desc
if $rows != 6 then
return -1
endi
if $data01 != -13 then
return -1
endi
if $data11 != -16 then
return -1
endi
if $data12 != 5 then
return -1
endi
if $data03 != null then
return -1
endi
if $data04 != null then
return -1
endi
if $data05 != null then
return -1
endi
if $data06 != null then
return -1
endi
if $data07 != null then
return -1
endi
if $data08 != null then
return -1
endi
if $data21 != -19 then
return -1
endi
if $data22 != 0 then
return -1
endi
if $data23 != null then
return -1
endi
if $data24 != null then
return -1
endi
if $data25 != null then
return -1
endi
if $data26 != null then
return -1
endi
if $data27 != null then
return -1
endi
if $data28 != null then
return -1
endi
if $data31 != 3 then
return -1
endi
if $data32 != 8 then
return -1
endi
if $data33 != null then
return -1
endi
if $data34 != null then
return -1
endi
if $data35 != null then
return -1
endi
if $data36 != null then
return -1
endi
if $data37 != null then
return -1
endi
if $data38 != null then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data42 != 8 then
return -1
endi
if $data43 != null then
return -1
endi
if $data44 != null then
return -1
endi
if $data45 != null then
return -1
endi
if $data46 != null then
return -1
endi
if $data47 != null then
return -1
endi
if $data48 != null then
return -1
endi
if $data51 != 1 then
return -1
endi
if $data52 != 8 then
return -1
endi
if $data53 != null then
return -1
endi
if $data54 != null then
return -1
endi
if $data55 != null then
return -1
endi
if $data57 != null then
return -1
endi
if $data58 != null then
return -1
endi
print ======== step7
sleep 2500
sql alter table tb drop column h
sql insert into tb values(now-10d, -10)
sleep 3000
sql select * from tb order by ts desc
if $rows != 7 then
return -1
endi
print data01 = $data01
if $data01 != -10 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data11 != -13 then
return -1
endi
if $data12 != null then
return -1
endi
if $data21 != -16 then
return -1
endi
if $data22 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != null then
return -1
endi
if $data33 != null then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != null then
return -1
endi
if $data51 != 2 then
return -1
endi
if $data52 != null then
return -1
endi
if $data53 != null then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data62 != null then
return -1
endi
sql_error alter table tb drop column a
print ======== step9
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
sql select * from tb order by ts desc
if $rows != 7 then
return -1
endi
if $data01 != -10 then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
if $data11 != -13 then
return -1
endi
if $data12 != null then
return -1
endi
if $data21 != -16 then
return -1
endi
if $data22 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != null then
return -1
endi
if $data33 != null then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != null then
return -1
endi
if $data51 != 2 then
return -1
endi
if $data52 != null then
return -1
endi
if $data53 != null then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data62 != null then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d2
sql use d2
sql create table mt (ts timestamp, a int) TAGS (t int)
sql create table tb using mt tags (1)
sql insert into tb values(now-28d, -28)
sql insert into tb values(now-27d, -27)
sql insert into tb values(now-26d, -26)
sql select * from tb
if $rows != 3 then
return -1
endi
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != t then
return -1
endi
if $data21 != INT then
return -1
endi
print ======== step2
sql alter table mt add column b smallint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != t then
return -1
endi
if $data31 != INT then
return -1
endi
print ======== step3
sql alter table mt add column c tinyint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != t then
return -1
endi
if $data41 != INT then
return -1
endi
print ======== step4
sql alter table mt add column d int
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != t then
return -1
endi
if $data51 != INT then
return -1
endi
print ======== step5
sql alter table mt add column e bigint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != t then
return -1
endi
if $data61 != INT then
return -1
endi
print ======== step6
sql alter table mt add column f float
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != t then
return -1
endi
if $data71 != INT then
return -1
endi
print ======== step7
sql alter table mt add column g double
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != t then
return -1
endi
if $data81 != INT then
return -1
endi
print ======== step8
sql alter table mt add column h binary(10)
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
if $data90 != t then
return -1
endi
if $data91 != INT then
return -1
endi
print ======== step9
print ======== step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql use d2
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
if $data90 != t then
return -1
endi
if $data91 != INT then
return -1
endi
print ======== step11
#sql alter table mt drop column a -x step111
# return -1
#step111:
#sql alter table mt drop column ts -x step112
# return -1
#step112:
#sql alter table mt drop column cdfg -x step113
# return -1
#step113:
#sql alter table mt add column a -x step114
# return -1
#step114:
#sql alter table mt add column b -x step115
# return -1
#step115:
print ======== step12
sql alter table mt drop column b
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != c then
return -1
endi
if $data21 != TINYINT then
return -1
endi
if $data30 != d then
return -1
endi
if $data31 != INT then
return -1
endi
if $data40 != e then
return -1
endi
if $data41 != BIGINT then
return -1
endi
if $data50 != f then
return -1
endi
if $data51 != FLOAT then
return -1
endi
if $data60 != g then
return -1
endi
if $data61 != DOUBLE then
return -1
endi
if $data70 != h then
return -1
endi
if $data71 != BINARY then
return -1
endi
if $data72 != 10 then
return -1
endi
if $data80 != t then
return -1
endi
if $data81 != INT then
return -1
endi
print ======== step13
sql alter table mt drop column c
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != d then
return -1
endi
if $data21 != INT then
return -1
endi
if $data30 != e then
return -1
endi
if $data31 != BIGINT then
return -1
endi
if $data40 != f then
return -1
endi
if $data41 != FLOAT then
return -1
endi
if $data50 != g then
return -1
endi
if $data51 != DOUBLE then
return -1
endi
if $data60 != h then
return -1
endi
if $data61 != BINARY then
return -1
endi
if $data62 != 10 then
return -1
endi
if $data70 != t then
return -1
endi
if $data71 != INT then
return -1
endi
print ======== step14
sql alter table mt drop column d
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != e then
return -1
endi
if $data21 != BIGINT then
return -1
endi
if $data30 != f then
return -1
endi
if $data31 != FLOAT then
return -1
endi
if $data40 != g then
return -1
endi
if $data41 != DOUBLE then
return -1
endi
if $data50 != h then
return -1
endi
if $data51 != BINARY then
return -1
endi
if $data52 != 10 then
return -1
endi
if $data60 != t then
return -1
endi
if $data61 != INT then
return -1
endi
print ======== step15
sql alter table mt drop column e
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != f then
return -1
endi
if $data21 != FLOAT then
return -1
endi
if $data30 != g then
return -1
endi
if $data31 != DOUBLE then
return -1
endi
if $data40 != h then
return -1
endi
if $data41 != BINARY then
return -1
endi
if $data42 != 10 then
return -1
endi
if $data50 != t then
return -1
endi
if $data51 != INT then
return -1
endi
print ======== step16
sql alter table mt drop column f
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != g then
return -1
endi
if $data21 != DOUBLE then
return -1
endi
if $data30 != h then
return -1
endi
if $data31 != BINARY then
return -1
endi
if $data32 != 10 then
return -1
endi
if $data40 != t then
return -1
endi
if $data41 != INT then
return -1
endi
print ======== step17
sql alter table mt drop column g
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != h then
return -1
endi
if $data21 != BINARY then
return -1
endi
if $data22 != 10 then
return -1
endi
if $data30 != t then
return -1
endi
if $data31 != INT then
return -1
endi
print ============= step18
sql alter table mt drop column h
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != t then
return -1
endi
if $data21 != INT then
return -1
endi
if $data30 != null then
return -1
endi
print ======= over
sql drop database d2
sql show databases
if $rows != 0 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d1
sql use d1
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-28d, -28)
sql insert into tb values(now-27d, -27)
sql insert into tb values(now-26d, -26)
sql select * from tb
if $rows != 3 then
return -1
endi
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
print ======== step2
sql alter table tb add column b smallint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
print ======== step3
sql alter table tb add column c tinyint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
print ======== step4
sql alter table tb add column d int
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
print ======== step5
sql alter table tb add column e bigint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
print ======== step6
sql alter table tb add column f float
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
print ======== step7
sql alter table tb add column g double
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
print ======== step8
sql alter table tb add column h binary(10)
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
print ======== step9
print ======== step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql use d1
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
print ======== step11
sql alter table drop column a -x step111
return -1
step111:
sql alter table drop column ts -x step112
return -1
step112:
sql alter table drop column cdfg -x step113
return -1
step113:
sql alter table add column a -x step114
return -1
step114:
sql alter table add column b -x step115
return -1
step115:
print ======== step12
sql alter table tb drop column b
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != c then
return -1
endi
if $data21 != TINYINT then
return -1
endi
if $data30 != d then
return -1
endi
if $data31 != INT then
return -1
endi
if $data40 != e then
return -1
endi
if $data41 != BIGINT then
return -1
endi
if $data50 != f then
return -1
endi
if $data51 != FLOAT then
return -1
endi
if $data60 != g then
return -1
endi
if $data61 != DOUBLE then
return -1
endi
if $data70 != h then
return -1
endi
if $data71 != BINARY then
return -1
endi
if $data72 != 10 then
return -1
endi
print ======== step13
sql alter table tb drop column c
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != d then
return -1
endi
if $data21 != INT then
return -1
endi
if $data30 != e then
return -1
endi
if $data31 != BIGINT then
return -1
endi
if $data40 != f then
return -1
endi
if $data41 != FLOAT then
return -1
endi
if $data50 != g then
return -1
endi
if $data51 != DOUBLE then
return -1
endi
if $data60 != h then
return -1
endi
if $data61 != BINARY then
return -1
endi
if $data62 != 10 then
return -1
endi
print ======== step14
sql alter table tb drop column d
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != e then
return -1
endi
if $data21 != BIGINT then
return -1
endi
if $data30 != f then
return -1
endi
if $data31 != FLOAT then
return -1
endi
if $data40 != g then
return -1
endi
if $data41 != DOUBLE then
return -1
endi
if $data50 != h then
return -1
endi
if $data51 != BINARY then
return -1
endi
if $data52 != 10 then
return -1
endi
print ======== step15
sql alter table tb drop column e
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != f then
return -1
endi
if $data21 != FLOAT then
return -1
endi
if $data30 != g then
return -1
endi
if $data31 != DOUBLE then
return -1
endi
if $data40 != h then
return -1
endi
if $data41 != BINARY then
return -1
endi
if $data42 != 10 then
return -1
endi
print ======== step16
sql alter table tb drop column f
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != g then
return -1
endi
if $data21 != DOUBLE then
return -1
endi
if $data30 != h then
return -1
endi
if $data31 != BINARY then
return -1
endi
if $data32 != 10 then
return -1
endi
print ======== step17
sql alter table tb drop column g
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != h then
return -1
endi
if $data21 != BINARY then
return -1
endi
if $data22 != 10 then
return -1
endi
print ============= step18
sql alter table tb drop column h
sleep 2500
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != null then
return -1
endi
print ======= over
sql drop database d1
sql show databases
if $rows != 0 then
return -1
endi
run lite/alter/count.sim
run lite/alter/cached_schema_after_alter.sim
run lite/alter/import.sim
run lite/alter/insert1.sim
run lite/alter/insert2.sim
run lite/alter/metrics.sim
run lite/alter/table.sim
\ No newline at end of file
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode2 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c httpMaxThreads -v 2
system sh/cfg.sh -n dnode2 -c httpMaxThreads -v 2
system sh/cfg.sh -n dnode1 -c monitor -v 1
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode1 -c enableHttp -v 1
system sh/cfg.sh -n dnode2 -c monitor -v 1
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
system sh/cfg.sh -n dnode2 -c monitorInterval -v 1
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
system sh/cfg.sh -n dnode2 -c maxVnodeConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
system sh/cfg.sh -n dnode2 -c maxMgmtConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
system sh/cfg.sh -n dnode2 -c maxMeterConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
system sh/cfg.sh -n dnode2 -c maxShellConns -v 30000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql create database testdb
sql use testdb
sql create table meter1 (ts timestamp, val int)
$x = 0
$v = -100
while $x < 30
$v = $v + 1
$ms = $v . m
sql insert into meter1 values (now $ms , $x )
$x = $x + 1
endw
sleep 3000
system sh/exec.sh -n dnode2 -s start
sql create dnode 192.168.0.2
sleep 20000
sql select * from log.dn_192_168_0_1
print ===>rows $rows
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
if $rows < 20 then
return -1
endi
#sql create table sys.st as select avg(taosd), avg(system) from sys.cpu interval(30s)
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
$i = 0
$dbPrefix = ca_nm_db
$tbPrefix = ca_nm_tb
$mtPrefix = ca_nm_mt
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$mt = $mtPrefix . $i
$tbNum = 10
$rowNum = 20
print =============== step1
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$val = $x * 60000
$ms = 1519833600000 + $val
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $tb order by ts desc
print ===>rows $rows, data $data01
if $rows != 20 then
return -1
endi
if $data01 != 19 then
return -1
endi
sql select * from $mt
print ===>rows $rows, data $data01
if $rows != 100 then
return -1
endi
if $data01 != 0 then
return -1
endi
sql select count(*) from $mt
print ===>rows $rows, data $data00
if $rows != 1 then
return -1
endi
if $data00 != 100 then
return -1
endi
print =============== step3
sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $mt then
return -1
endi
if $data04 != 5 then
return -1
endi
print =============== step4
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$val = $x * 60000
$ms = 1519833600000 + $val
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
print ==> sleep 8 seconds to renew cache
sleep 8000
print =============== step5
sql select * from $tb order by ts desc
print ===>rows $rows, data $data01
if $rows != 20 then
return -1
endi
if $data01 != 19 then
return -1
endi
sql select * from $mt
print ===>rows $rows, data $data01
if $rows != 200 then
return -1
endi
if $data01 != 0 then
return -1
endi
sql select count(*) from $mt
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data00 != 200 then
return -1
endi
print =============== step6
sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $mt then
return -1
endi
if $data04 != 10 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======================== dnode1 start
$dbPrefix = ns_db
$tbPrefix = ns_tb
$mtPrefix = ns_mt
$stPrefix = ns_st
$tbNum = 5
$rowNum = 200
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix
$mt = $mtPrefix
$st = $stPrefix
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
$y = 0
while $y < $rowNum
$ms = $x . s
sql insert into $tb values (now + $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
sql select count(*), count(tbcol), count(tbcol2) from $mt interval(10s)
print $data00 $data01 $data02 $data03
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $mt interval(10s)
print =============== step3
print sleep 22 seconds
sleep 22000
print =============== step4
sql select * from $st
print $st ==> $rows1 $data00 $data01 $data02 $data03
if $data13 >= 51 then
return -1
endi
print =============== step5
$tbNum = 10
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
if $i == 0 then
sleep 2000
endi
$x = 0
$y = 0
while $y < $rowNum
$ms = $x . s
sql insert into $tb values (now + $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
print =============== step6
print sleep 22 seconds
sleep 22000
print =============== step7
sql select * from $st order by ts desc
print $st ==> $rows1 $data00 $data01 $data02 $data03
if $data03 <= 51 then
return -1
endi
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======================== dnode1 start
$i = 0
$dbPrefix = ca_rm_db
$tbPrefix = ca_rm_tb
$mtPrefix = ca_rm_mt
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$mt = $mtPrefix . $i
print =============== step1
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(100))
sql create table $tb using $mt tags( "1" )
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from $mt
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
system sh/exec.sh -n dnode1 -s start
print =============== step3
print ==> sleep 8 seconds to renew cache
sleep 8000
print =============== step4
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bool) TAGS(tgcol int)
sql create table $tb using $mt tags( 3 )
sql insert into $tb values (now, 2)
sql select * from $tb
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select * from $mt
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 3 then
return -1
endi
此差异已折叠。
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======================== dnode1 start
$i = 0
$dbPrefix = ca_rt_db
$tbPrefix = ca_rt_tb
$mtPrefix = ca_rt_mt
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed bool)
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
system sh/exec.sh -n dnode1 -s start
print =============== step3
print ==> sleep 8 seconds to renew cache
sleep 3000
sql reset query cache
sleep 18000
print =============== step4
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
if $data01 != 1 then
return -1
endi
run lite/cache/restart_table.sim
run lite/cache/restart_metrics.sim
run lite/cache/restart_stream.sim
run lite/cache/new_metrics.sim
run lite/cache/new_stream.sim
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
run lite/column/table.sim
run lite/column/metrics.sim
run lite/column/stream.sim
run lite/column/commit.sim
此差异已折叠。
此差异已折叠。
此差异已折叠。
run lite/compress/compress.sim
run lite/compress/uncompress.sim
run lite/compress/commitlog.sim
run lite/compress/compress2.sim
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
run lite/compute/count.sim
run lite/compute/avg.sim
run lite/compute/sum.sim
run lite/compute/min.sim
run lite/compute/max.sim
run lite/compute/first.sim
run lite/compute/last.sim
run lite/compute/stddev.sim
run lite/compute/leastsquare.sim
run lite/compute/top.sim
run lite/compute/bottom.sim
run lite/compute/percentile.sim
run lite/compute/diff.sim
run lite/compute/interval.sim
run lite/compute/null.sim
run lite/compute/diff2.sim
此差异已折叠。
sql connect
$x = 1
begin:
sql insert into db.tb values(now, $x ) -x begin
#print ===> insert successed $x
$x = $x + 1
goto begin
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
{
"hostIp": "192.168.0.1",
"machineNum": 100,
"loopNum": 100,
"dbName": "db",
"dataBegin": 1485878400000
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册