提交 f7ea72b0 编写于 作者: S Shengliang Guan

test: restore some 2.0 case

上级 176379df
此差异已折叠。
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
print ========== step1
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 2000
sql connect
print =============== step1
sleep 2000
sql select * from log.dn
if $rows == 0 then
return -1
endi
print =============== step2
sql create database d4 precision 'us'
sql use d4
sql create table t1 (ts timestamp, i int)
sql insert into d4.t1 values(1626739200000, 1)
sql create table d4.s1 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), stddev(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
sql create table d4.s2 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), stddev(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
sql create table d4.s3 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used), stddev(disk_used), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
sql create table d4.s4 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read), stddev(io_write), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
sql create table d4.s5 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed), stddev(band_speed), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
sql create table d4.s6 as select count(req_http), count(req_insert), avg(req_http), avg(req_select), sum(req_insert), max(req_select), min(req_insert), stddev(req_select), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
sql create table d4.s7 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
sql create table d4.s8 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
sql create table d4.s9 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
sql create table d4.s10 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
sql create table d4.s11 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
sql create table d4.s12 as select count(req_http), count(req_insert), avg(req_select), avg(req_insert), sum(req_insert), max(req_select), min(req_insert), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
print =============== step3
print sleep 22 seconds
sleep 22000
sql select * from d4.s1
$s1 = $rows
print select * from d4.s1 ==> $s1
if $rows <= 0 then
return -1
endi
sql select * from d4.s2
if $rows <= 0 then
return -1
endi
sql select * from d4.s3
if $rows <= 0 then
return -1
endi
sql select * from d4.s4
if $rows <= 0 then
return -1
endi
sql select * from d4.s5
$s5 = $rows
print select * from d4.s5 ==> $s5
if $rows <= 0 then
return -1
endi
sql select * from d4.s6
if $rows <= 0 then
return -1
endi
sql select * from d4.s7
if $rows <= 0 then
return -1
endi
sql select * from d4.s8
if $rows <= 0 then
return -1
endi
sql select * from d4.s9
if $rows <= 0 then
return -1
endi
sql select * from d4.s10
if $rows <= 0 then
return -1
endi
sql select * from d4.s11
if $rows <= 0 then
return -1
endi
sql select * from d4.s12
$s12 = $rows
print select * from d4.s12 ==> $s12
if $rows <= 0 then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
print sleep 22 seconds
sleep 22000
sql select * from d4.s1
print select * from d4.s1 ==> $rows $s1
if $rows <= 0 then
return -1
endi
if $rows <= $s1 then
return -1
endi
sql select * from d4.s2
if $rows <= 0 then
return -1
endi
sql select * from d4.s3
if $rows <= 0 then
return -1
endi
sql select * from d4.s4
if $rows <= 0 then
return -1
endi
sql select * from d4.s5
print select * from d4.s5 ==> $rows $s5
if $rows <= 0 then
return -1
endi
if $rows <= $s5 then
return -1
endi
sql select * from d4.s6
if $rows <= 0 then
return -1
endi
sql select * from d4.s7
if $rows <= 0 then
return -1
endi
sql select * from d4.s8
if $rows <= 0 then
return -1
endi
sql select * from d4.s9
if $rows <= 0 then
return -1
endi
sql select * from d4.s10
if $rows <= 0 then
return -1
endi
sql select * from d4.s11
if $rows <= 0 then
return -1
endi
sql select * from d4.s12
print select * from d4.s12 ==> $rows $s12
if $rows <= 0 then
return -1
endi
if $rows <= $s12 then
return -1
endi
\ No newline at end of file
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 2000
sql connect
print ======================== dnode1 start
$dbPrefix = md_db
$tbPrefix = md_tb
$mtPrefix = md_mt
$stPrefix = md_st
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
sql drop databae $db -x step1
step1:
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
$ts = 1626710400000 + $x
sql insert into $tb values ($ts , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2 c3
sql select count(*), count(tbcol), count(tbcol2) from $mt interval(1d)
print select count(*), count(tbcol), count(tbcol2) from $mt interval(1d) ===> $data00 $data01 $data02, $data03
if $data01 != 200 then
return -1
endi
if $data02 != 200 then
return -1
endi
if $data03 != 200 then
return -1
endi
$st = $stPrefix . c3
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $mt interval(1d)
print =============== step3
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql drop table $tb
$i = $i + 1
endw
sql drop table $mt
print =============== step4
print sleep 120 seconds
sleep 120000
print =============== step5
$st = $stPrefix . c3
sql select * from $st
print ===> select * from $st
print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data01 != null then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
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/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ======================== dnode1 start
$dbPrefix = m1v_db
$tbPrefix = m1v_tb
$mtPrefix = m1v_mt
$stPrefix = m1v_st
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
sql drop databae $db -x step1
step1:
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 = -400
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (1626739200000 $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2 c1
sql select count(*) from $mt interval(1d)
print select count(*) from $mt interval(1d) ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . c1
sql create table $st as select count(*) from $mt interval(1d)
print =============== step3 c2
sql select count(tbcol) from $mt interval(1d)
print select count(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . c2
sql create table $st as select count(tbcol) from $mt interval(1d)
print =============== step4 c3
sql select count(tbcol2) from $mt interval(1d)
print select count(tbcol2) from $mt interval(1d) ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . c3
sql create table $st as select count(tbcol2) from $mt interval(1d)
print =============== step5 avg
sql select avg(tbcol) from $mt interval(1d)
print select avg(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 9.500000000 then
return -1
endi
$st = $stPrefix . av
sql create table $st as select avg(tbcol) from $mt interval(1d)
print =============== step6 su
sql select sum(tbcol) from $mt interval(1d)
print select sum(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 1900 then
return -1
endi
$st = $stPrefix . su
sql create table $st as select sum(tbcol) from $mt interval(1d)
print =============== step7 mi
sql select min(tbcol) from $mt interval(1d)
print select min(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . mi
sql create table $st as select min(tbcol) from $mt interval(1d)
print =============== step8 ma
sql select max(tbcol) from $mt interval(1d)
print select max(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . ma
sql create table $st as select max(tbcol) from $mt interval(1d)
print =============== step9 fi
sql select first(tbcol) from $mt interval(1d)
print select first(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . fi
sql create table $st as select first(tbcol) from $mt interval(1d)
print =============== step10 la
sql select last(tbcol) from $mt interval(1d)
print select last(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . la
sql create table $st as select last(tbcol) from $mt interval(1d)
print =============== step11 wh
sql select count(tbcol) from $mt where ts < 1626739440001 interval(1d)
print select count(tbcol) from $mt where ts < 1626739440000 interval(1d) ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . wh
#sql create table $st as select count(tbcol) from $mt where ts < 1626739200000 + 4m interval(1d)
print =============== step12 as
sql select count(tbcol) from $mt interval(1d)
print select count(tbcol) from $mt interval(1d) ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . as
sql create table $st as select count(tbcol) as c from $mt interval(1d)
print =============== step13
print sleep 120 seconds
sleep 120000
print =============== step14
$st = $stPrefix . c1
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . c2
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . c3
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 200 then
return -1
endi
$st = $stPrefix . av
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 9.500000000 then
return -1
endi
$st = $stPrefix . su
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 1900 then
return -1
endi
$st = $stPrefix . mi
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . ma
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . fi
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . la
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . wh
#sql select * from $st
#print ===> select * from $st ===> $data00 $data01
#if $data01 != 200 then
# return -1
#endi
$st = $stPrefix . as
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 200 then
return -1
endi
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 2000
sql connect
print ======================== dnode1 start
$i = 0
$dbPrefix = rs_db
$tbPrefix = rs_tb
$mtPrefix = rs_mt
$stPrefix = rs_st
$tbNum = 10
$rowNum = 20
$totalNum = 200
$db = $dbPrefix
$tb = $tbPrefix . $i
$mt = $mtPrefix
$stm = $stPrefix . m
$stt = $stPrefix . t
print =============== step1
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int, tbcol2 int ) TAGS(tgcol bool)
$i = 0
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = -400
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (1626739200000 $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
print =============== step2
$i = 0
$tb = $tbPrefix . $i
sql select count(*) from $tb interval(1d)
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 20 then
return -1
endi
sql select count(*) from $mt interval(1d)
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 200 then
return -1
endi
print =============== step3
sql create table $stt as select count(*) from $tb interval(1d)
sql create table $stm as select count(*) from $mt interval(1d)
print sleep 120 seconds
sleep 120000
sql select * from $stt
print select count(*) from $stt ===> $data00 $data01
if $rows != 1 then
return -1
endi
if $data01 != 20 then
return -1
endi
sql select * from $stm
print select * from $stm ===> $data00 $data01
if $rows != 1 then
return -1
endi
if $data01 != 200 then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop
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
print =============== step5
print ==> renew cache
sql reset query cache
sleep 1000
print =============== step6
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bigint, tbcol2 bigint ) TAGS(tgcol int)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = -400
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (1626739200000 $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
print =============== step7
sql select count(*) from $tb interval(1d)
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 20 then
return -1
endi
sql select count(*) from $mt interval(1d)
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 100 then
return -1
endi
print =============== step8
sql create table $stt as select count(*) from $tb interval(1d)
sql create table $stm as select count(*) from $mt interval(1d)
print sleep 120 seconds
sleep 120000
sql select * from $stt
sleep 1000
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 20 then
return -1
endi
sql select * from $stm
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 100 then
return -1
endi
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 2000
sql connect
print ======================== dnode1 start
$dbPrefix = s3_db
$tbPrefix = s3_tb
$mtPrefix = s3_mt
$stPrefix = s3_st
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
sql drop databae $db -x step1
step1:
sql create database $db keep 36500
sql use $db
sql create stable $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
sql create table cq1 as select count(*) from $mt interval(10s);
sleep 1000
sql create table $st using $mt tags(1);
sql insert into $st values (-50000, 1, 1.0);
sql insert into $st values (-10000, 1, 1.0);
sql insert into $st values (10000, 1, 1.0);
$i = 0
while $i < 12
sql select * from cq1;
if $rows != 3 then
sleep 10000
else
if $data00 != @70-01-01 07:59:10.000@ then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data10 != @70-01-01 07:59:50.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data20 != @70-01-01 08:00:10.000@ then
return -1
endi
if $data21 != 1 then
return -1
endi
$i = 12
endi
$i = $i + 1
endw
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 2000
sql connect
print ======================== dnode1 start
$dbPrefix = s3_db
$tbPrefix = s3_tb
$mtPrefix = s3_mt
$stPrefix = s3_st
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
sql drop databae $db -x step1
step1:
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 = -400
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (1626739200000 $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2 c1
$i = 1
$tb = $tbPrefix . $i
sql select count(*) from $tb interval(1d)
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c1
sql create table $st as select count(*) from $tb interval(1d)
print =============== step3 c2
sql select count(tbcol) from $tb interval(1d)
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c2
sql create table $st as select count(tbcol) from $tb interval(1d)
print =============== step4 c3
sql select count(tbcol2) from $tb interval(1d)
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c3
sql create table $st as select count(tbcol2) from $tb interval(1d)
print =============== step5
print sleep 120 seconds
sleep 120000
print =============== step6
$st = $stPrefix . c1
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c2
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c3
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
print =============== step7
system sh/exec.sh -n dnode1 -s stop
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 4000
print ======================== dnode1 start
$dbPrefix = stst3db
$tbPrefix = stst3tb
$mtPrefix = stst3mt
$stPrefix = stst3st
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step8
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
sql drop databae $db -x step8
step8:
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 = -400
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (1626739200000 $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step9 c3
$i = 1
$tb = $tbPrefix . $i
sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
print select count(*), count(tbcol), count(tbcol2) from $tb interval(1d) ===> $data00 $data01 $data02, $data03
if $data01 != $rowNum then
return -1
endi
if $data02 != $rowNum then
return -1
endi
if $data03 != $rowNum then
return -1
endi
$st = $stPrefix . c3
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
print =============== step10
print sleep 120 seconds
sleep 120000
print =============== step11
#$st = $stPrefix . c3
#sql select * from $st -x step11
# print ===> select * from $st first time should be error
# return -1
#step11:
print =============== step12
$st = $stPrefix . c3
sql select * from $st
print ===> select * from $st
print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data01 != $rowNum then
return -1
endi
if $data02 != $rowNum then
return -1
endi
if $data03 != $rowNum then
return -1
endi
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 2000
sql connect
print ======================== dnode1 start
$dbPrefix = sr_db
$tbPrefix = sr_tb
$mtPrefix = sr_mt
$stPrefix = sr_st
$tbNum = 10
$rowNum = 200
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
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 (1626739200000 + $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(10s)
$i = 5
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(10s)
$i = 8
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(10s)
sql show tables
if $rows != 13 then
return -1
endi
print =============== step3
sleep 2000
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
print =============== step4
print sleep 120 seconds
sleep 120000
print =============== step5
$i = 1
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select * from $tb
print $tb ==> $rows $data00 $data01
if $rows != $rowNum then
return -1
endi
$i = 5
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select * from $tb
print $tb ==> $rows $data00 $data01
if $rows != $rowNum then
return -1
endi
$i = 8
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select * from $tb
print $tb ==> $rows $data00 $data01
if $rows != $rowNum then
return -1
endi
print =============== step6
$i = 1
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select * from $st
print $st ==> $rows $data00 $data01
if $rows <= 1 then
return -1
endi
$i = 5
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select * from $st
print $st ==> $rows $data00 $data01
if $rows <= 1 then
return -1
endi
$i = 8
$tb = $tbPrefix . $i
$st = $stPrefix . $i
sql select * from $st
print $st ==> $rows $data00 $data01
if $rows <= 1 then
return -1
endi
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 2000
sql connect
print ======================== dnode1 start
$dbPrefix = td_db
$tbPrefix = td_tb
$mtPrefix = td_mt
$stPrefix = td_st
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
sql drop databae $db -x step1
step1:
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 = -400
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (1626739200000 $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2 c3
$i = 1
$tb = $tbPrefix . $i
sql select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
print select count(*), count(tbcol), count(tbcol2) from $tb interval(1d) ===> $data00 $data01 $data02, $data03
if $data01 != $rowNum then
return -1
endi
if $data02 != $rowNum then
return -1
endi
if $data03 != $rowNum then
return -1
endi
$st = $stPrefix . c3
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $tb interval(1d)
print =============== step3
sql drop table $tb
print =============== step4
print sleep 120 seconds
sleep 120000
print =============== step5
$st = $stPrefix . c3
sql select * from $st
print ===> select * from $st
print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data01 != null then
return -1
endi
if $data02 != null then
return -1
endi
if $data03 != null then
return -1
endi
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/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ======================== dnode1 start
$dbPrefix = t1v_db
$tbPrefix = t1v_tb
$mtPrefix = t1v_mt
$stPrefix = t1v_st
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$st = $stPrefix . $i
sql drop databae $db -x step1
step1:
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 = -400
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (1626739200000 $ms , $y , $y )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2 c1
$i = 1
$tb = $tbPrefix . $i
sql select count(*) from $tb interval(1d)
print select count(*) from $tb interval(1d) ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c1
sql create table $st as select count(*) from $tb interval(1d)
print =============== step3 c2
sql select count(tbcol) from $tb interval(1d)
print select count(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c2
sql create table $st as select count(tbcol) from $tb interval(1d)
print =============== step4 c3
sql select count(tbcol2) from $tb interval(1d)
print select count(tbcol2) from $tb interval(1d) ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c3
sql create table $st as select count(tbcol2) from $tb interval(1d)
print =============== step5 avg
sql select avg(tbcol) from $tb interval(1d)
print select avg(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != 9.500000000 then
return -1
endi
$st = $stPrefix . av
sql create table $st as select avg(tbcol) from $tb interval(1d)
print =============== step6 su
sql select sum(tbcol) from $tb interval(1d)
print select sum(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != 190 then
return -1
endi
$st = $stPrefix . su
sql create table $st as select sum(tbcol) from $tb interval(1d)
print =============== step7 mi
sql select min(tbcol) from $tb interval(1d)
print select min(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . mi
sql create table $st as select min(tbcol) from $tb interval(1d)
print =============== step8 ma
sql select max(tbcol) from $tb interval(1d)
print select max(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . ma
sql create table $st as select max(tbcol) from $tb interval(1d)
print =============== step9 fi
sql select first(tbcol) from $tb interval(1d)
print select first(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . fi
sql create table $st as select first(tbcol) from $tb interval(1d)
print =============== step10 la
sql select last(tbcol) from $tb interval(1d)
print select last(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . la
sql create table $st as select last(tbcol) from $tb interval(1d)
print =============== step11 st
sql select stddev(tbcol) from $tb interval(1d)
print select stddev(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != 5.766281297 then
return -1
endi
$st = $stPrefix . st
sql create table $st as select stddev(tbcol) from $tb interval(1d)
print =============== step12 le
sql select leastsquares(tbcol, 1, 1) from $tb interval(1d)
print select leastsquares(tbcol, 1, 1) from $tb interval(1d) ===> $data00 $data01
#if $data01 != @(0.000017, -25362055.126740)@ then
# return -1
#endi
$st = $stPrefix . le
sql create table $st as select leastsquares(tbcol, 1, 1) from $tb interval(1d)
print =============== step13 pe
sql select percentile(tbcol, 1) from $tb interval(1d)
print select percentile(tbcol, 1) from $tb interval(1d) ===> $data00 $data01
if $data01 != 0.190000000 then
return -1
endi
$st = $stPrefix . pe
sql create table $st as select percentile(tbcol, 1) from $tb interval(1d)
print =============== step14 wh
sql select count(tbcol) from $tb where ts < 1626739440001 interval(1d)
print select count(tbcol) from $tb where ts < 1626739440001 interval(1d) ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . wh
#sql create table $st as select count(tbcol) from $tb where ts < 1626739200000 + 4m interval(1d)
print =============== step15 as
sql select count(tbcol) from $tb interval(1d)
print select count(tbcol) from $tb interval(1d) ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . as
sql create table $st as select count(tbcol) as c from $tb interval(1d)
print =============== step16
print sleep 120 seconds
sleep 120000
print =============== step17
$st = $stPrefix . c1
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c2
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . c3
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
$st = $stPrefix . av
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 9.500000000 then
return -1
endi
$st = $stPrefix . su
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 190 then
return -1
endi
$st = $stPrefix . mi
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . ma
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . fi
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 0 then
return -1
endi
$st = $stPrefix . la
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 19 then
return -1
endi
$st = $stPrefix . st
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 5.766281297 then
return -1
endi
$st = $stPrefix . le
sql select * from $st
#print ===> select * from $st ===> $data00 $data01
#if $data01 != @(0.000017, -25270086.331047)@ then
# return -1
#endi
$st = $stPrefix . pe
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != 0.190000000 then
return -1
endi
$st = $stPrefix . wh
#sql select * from $st
#print ===> select * from $st ===> $data00 $data01
#if $data01 != $rowNum then
# return -1
#endi
$st = $stPrefix . as
sql select * from $st
print ===> select * from $st ===> $data00 $data01
if $data01 != $rowNum then
return -1
endi
run general/stream/stream_3.sim
run general/stream/stream_restart.sim
run general/stream/table_del.sim
run general/stream/metrics_del.sim
run general/stream/table_replica1_vnoden.sim
run general/stream/metrics_replica1_vnoden.sim
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册