add some scripts

This commit is contained in:
slguan 2020-04-19 23:28:22 +08:00
parent 276bb45ca1
commit 9d8998443c
478 changed files with 112836 additions and 0 deletions

View File

@ -0,0 +1,36 @@
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

View File

@ -0,0 +1,49 @@
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

View File

@ -0,0 +1,83 @@
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

View File

@ -0,0 +1,5 @@
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

View File

@ -0,0 +1,87 @@
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

View File

@ -0,0 +1,88 @@
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

View File

@ -0,0 +1,63 @@
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

View File

@ -0,0 +1,316 @@
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
print ========== step1
system sh/cfg.sh -n dnode1 -c monitor -v 1
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
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(now, 1)
sql create table d4.s001 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s002 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s003 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s004 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s005 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s006 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s007 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s008 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s009 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s000 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s011 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s012 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s013 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s014 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s015 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s016 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s017 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s018 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s019 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s010 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s021 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s022 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s023 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s024 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s025 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s026 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s027 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s028 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s029 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s020 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s031 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s032 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s033 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s034 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s035 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s036 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s037 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s038 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s039 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s030 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s041 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s042 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s043 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s044 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s045 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s046 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s047 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s048 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s049 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s040 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s051 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s052 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s053 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s054 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s055 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s056 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s057 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s058 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s059 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s050 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s061 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s062 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s063 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s064 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s065 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s066 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s067 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s068 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s069 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s060 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s071 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s072 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s073 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s074 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s075 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s076 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s077 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s078 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s079 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s070 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s081 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s082 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s083 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s084 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s085 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s086 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s087 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s088 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s089 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s080 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s091 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s092 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s093 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s094 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s095 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s096 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s097 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s098 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s099 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s090 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
print =============== step21
sql create table d4.s101 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s102 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s103 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s104 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s105 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s106 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s107 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s108 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s109 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s100 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s111 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s112 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s113 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s114 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s115 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s116 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s117 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s118 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s119 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s110 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s121 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s122 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s123 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s124 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s125 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s126 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s127 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s128 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s129 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s120 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s131 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s132 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s133 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s134 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s135 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s136 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s137 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s138 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s139 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s130 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s141 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s142 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s143 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s144 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s145 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s146 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s147 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s148 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s149 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s140 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s151 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s152 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s153 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s154 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s155 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s156 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s157 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s158 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s159 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s150 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s161 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s162 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s163 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s164 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s165 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s166 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s167 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s168 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s169 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s160 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s171 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s172 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s173 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s174 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s175 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s176 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s177 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s178 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s179 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s170 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s181 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s182 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s183 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s184 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s185 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s186 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s187 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s188 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s189 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s180 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
sql create table d4.s191 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s192 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s193 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s194 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s195 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s196 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
sql create table d4.s197 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
sql create table d4.s198 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
sql create table d4.s199 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
sql create table d4.s190 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
print =============== step3
print sleep 22 seconds
sleep 50000
sql select * from d4.s001
$s1 = $rows
print select * from d4.s001 ==> $s1
if $rows <= 0 then
return -1
endi
sql select * from d4.s002
if $rows <= 0 then
return -1
endi
sql select * from d4.s003
if $rows <= 0 then
return -1
endi
sql select * from d4.s004
if $rows <= 0 then
return -1
endi
sql select * from d4.s005
$s5 = $rows
print select * from d4.s005 ==> $s5
if $rows <= 0 then
return -1
endi
sql select * from d4.s006
if $rows <= 0 then
return -1
endi
sql select * from d4.s007
if $rows <= 0 then
return -1
endi
sql select * from d4.s008
if $rows <= 0 then
return -1
endi
sql select * from d4.s009
if $rows <= 0 then
return -1
endi
sql select * from d4.s010
if $rows <= 0 then
return -1
endi
sql select * from d4.s101
if $rows <= 0 then
return -1
endi
sql select * from d4.s102
$s12 = $rows
print select * from d4.s102 ==> $s12
if $rows <= 0 then
return -1
endi

View File

@ -0,0 +1,2 @@
run lite/agg/fill.sim
run lite/agg/stream.sim

View File

@ -0,0 +1,119 @@
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

View File

@ -0,0 +1,266 @@
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

View File

@ -0,0 +1,49 @@
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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,683 @@
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

View File

@ -0,0 +1,783 @@
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

View File

@ -0,0 +1,686 @@
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

View File

@ -0,0 +1,7 @@
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

View File

@ -0,0 +1,58 @@
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)

View File

@ -0,0 +1,146 @@
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

View File

@ -0,0 +1,108 @@
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

View File

@ -0,0 +1,87 @@
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

View File

@ -0,0 +1,179 @@
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 1
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
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 = -1440
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (now $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 22 seconds
sleep 22000
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 -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 1
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 1
system sh/exec.sh -n dnode1 -s start
print =============== step5
print ==> sleep 8 seconds to renew cache
sleep 8000
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 = -1440
$y = 0
while $y < $rowNum
$ms = $x . m
sql insert into $tb values (now $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 22 seconds
sleep 22000
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

View File

@ -0,0 +1,61 @@
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

View File

@ -0,0 +1,5 @@
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

View File

@ -0,0 +1,154 @@
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 d3
sql use d3
sql create table d3.mt (ts timestamp, c000 int, c001 int, c002 int, c003 int, c004 int, c005 int, c006 int, c007 int, c008 int, c009 int, c010 int, c011 int, c012 int, c013 int, c014 int, c015 int, c016 int, c017 int, c018 int, c019 int, c020 int, c021 int, c022 int, c023 int, c024 int, c025 int, c026 int, c027 int, c028 int, c029 int, c030 int, c031 int, c032 int, c033 int, c034 int, c035 int, c036 int, c037 int, c038 int, c039 int, c040 int, c041 int, c042 int, c043 int, c044 int, c045 int, c046 int, c047 int, c048 int, c049 int, c050 int, c051 int, c052 int, c053 int, c054 int, c055 int, c056 int, c057 int, c058 int, c059 int, c060 int, c061 int, c062 int, c063 int, c064 int, c065 int, c066 int, c067 int, c068 int, c069 int, c070 int, c071 int, c072 int, c073 int, c074 int, c075 int, c076 int, c077 int, c078 int, c079 int, c080 int, c081 int, c082 int, c083 int, c084 int, c085 int, c086 int, c087 int, c088 int, c089 int, c090 int, c091 int, c092 int, c093 int, c094 int, c095 int, c096 int, c097 int, c098 int, c099 int, c100 int, c101 int, c102 int, c103 int, c104 int, c105 int, c106 int, c107 int, c108 int, c109 int, c110 int, c111 int, c112 int, c113 int, c114 int, c115 int, c116 int, c117 int, c118 int, c119 int, c120 int, c121 int, c122 int, c123 int, c124 int, c125 int, c126 int, c127 int, c128 int, c129 int, c130 int, c131 int, c132 int, c133 int, c134 int, c135 int, c136 int, c137 int, c138 int, c139 int, c140 int, c141 int, c142 int, c143 int, c144 int, c145 int, c146 int, c147 int, c148 int, c149 int, c150 int, c151 int, c152 int, c153 int, c154 int, c155 int, c156 int, c157 int, c158 int, c159 int, c160 int, c161 int, c162 int, c163 int, c164 int, c165 int, c166 int, c167 int, c168 int, c169 int, c170 int, c171 int, c172 int, c173 int, c174 int, c175 int, c176 int, c177 int, c178 int, c179 int, c180 int, c181 int, c182 int, c183 int, c184 int, c185 int, c186 int, c187 int, c188 int, c189 int, c190 int, c191 int, c192 int, c193 int, c194 int, c195 int, c196 int, c197 int, c198 int, c199 int, c200 int, c201 int, c202 int, c203 int, c204 int, c205 int, c206 int, c207 int, c208 int, c209 int, c210 int, c211 int, c212 int, c213 int, c214 int, c215 int, c216 int, c217 int, c218 int, c219 int, c220 int, c221 int, c222 int, c223 int, c224 int, c225 int, c226 int, c227 int, c228 int, c229 int, c230 int, c231 int, c232 int, c233 int, c234 int, c235 int, c236 int, c237 int, c238 int, c239 int, c240 int, c241 int, c242 int, c243 int, c244 int, c245 int, c246 int, c247 int, c248 int) tags(a int, b smallint, c binary(20), d float, e double, f bigint)
sql create table d3.t1 using d3.mt tags(1, 2, '3', 4, 5, 6)
sql show tables
if $rows != 1 then
return -1
endi
sql show stables
if $rows != 1 then
return -1
endi
print =============== step2
sql insert into d3.t1 values (now -300d,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 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 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
print =============== step3
sql select * from d3.mt
if $rows != 10 then
return -1
endi
sql select * from d3.mt where c001 = 1
if $rows != 1 then
return -1
endi
sql select * from d3.mt where c002 = 2 and c003 = 2
if $rows != 1 then
return -1
endi
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c235), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d3.mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data00 != 10 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 45 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 4.500000000 then
return -1
endi
if $data08 != 10 then
return -1
endi
if $data09 != 10 then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 4000
system sh/exec.sh -n dnode1 -s start
sleep 3000
print =============== step5
sql select * from d3.mt
if $rows != 10 then
return -1
endi
sql select * from d3.mt where c001 = 1
if $rows != 1 then
return -1
endi
sql select * from d3.mt where c002 = 2 and c003 = 2
if $rows != 1 then
return -1
endi
sql select count(*) from d3.mt
if $data00 != 10 then
return -1
endi
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c128), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d3.mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data00 != 10 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 45 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 4.500000000 then
return -1
endi
if $data08 != 10 then
return -1
endi
if $data09 != 10 then
return -1
endi

View File

@ -0,0 +1,217 @@
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 d2.mt (ts timestamp, c000 int, c001 int, c002 int, c003 int, c004 int, c005 int, c006 int, c007 int, c008 int, c009 int, c010 int, c011 int, c012 int, c013 int, c014 int, c015 int, c016 int, c017 int, c018 int, c019 int, c020 int, c021 int, c022 int, c023 int, c024 int, c025 int, c026 int, c027 int, c028 int, c029 int, c030 int, c031 int, c032 int, c033 int, c034 int, c035 int, c036 int, c037 int, c038 int, c039 int, c040 int, c041 int, c042 int, c043 int, c044 int, c045 int, c046 int, c047 int, c048 int, c049 int, c050 int, c051 int, c052 int, c053 int, c054 int, c055 int, c056 int, c057 int, c058 int, c059 int, c060 int, c061 int, c062 int, c063 int, c064 int, c065 int, c066 int, c067 int, c068 int, c069 int, c070 int, c071 int, c072 int, c073 int, c074 int, c075 int, c076 int, c077 int, c078 int, c079 int, c080 int, c081 int, c082 int, c083 int, c084 int, c085 int, c086 int, c087 int, c088 int, c089 int, c090 int, c091 int, c092 int, c093 int, c094 int, c095 int, c096 int, c097 int, c098 int, c099 int, c100 int, c101 int, c102 int, c103 int, c104 int, c105 int, c106 int, c107 int, c108 int, c109 int, c110 int, c111 int, c112 int, c113 int, c114 int, c115 int, c116 int, c117 int, c118 int, c119 int, c120 int, c121 int, c122 int, c123 int, c124 int, c125 int, c126 int, c127 int, c128 int, c129 int, c130 int, c131 int, c132 int, c133 int, c134 int, c135 int, c136 int, c137 int, c138 int, c139 int, c140 int, c141 int, c142 int, c143 int, c144 int, c145 int, c146 int, c147 int, c148 int, c149 int, c150 int, c151 int, c152 int, c153 int, c154 int, c155 int, c156 int, c157 int, c158 int, c159 int, c160 int, c161 int, c162 int, c163 int, c164 int, c165 int, c166 int, c167 int, c168 int, c169 int, c170 int, c171 int, c172 int, c173 int, c174 int, c175 int, c176 int, c177 int, c178 int, c179 int, c180 int, c181 int, c182 int, c183 int, c184 int, c185 int, c186 int, c187 int, c188 int, c189 int, c190 int, c191 int, c192 int, c193 int, c194 int, c195 int, c196 int, c197 int, c198 int, c199 int, c200 int, c201 int, c202 int, c203 int, c204 int, c205 int, c206 int, c207 int, c208 int, c209 int, c210 int, c211 int, c212 int, c213 int, c214 int, c215 int, c216 int, c217 int, c218 int, c219 int, c220 int, c221 int, c222 int, c223 int, c224 int, c225 int, c226 int, c227 int, c228 int, c229 int, c230 int, c231 int, c232 int, c233 int, c234 int, c235 int, c236 int, c237 int, c238 int, c239 int, c240 int, c241 int, c242 int, c243 int, c244 int, c245 int, c246 int, c247 int, c248 int) tags(a int, b smallint, c binary(20), d float, e double, f bigint)
sql create table d2.t1 using d2.mt tags(1, 2, '3', 4, 5, 6)
sql create table d2.t2 using d2.mt tags(6, 7, '8', 9, 10, 11)
sql show tables
if $rows != 2 then
return -1
endi
sql show stables
if $rows != 1 then
return -1
endi
print =============== step2
sql insert into d2.t1 values (now,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0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, 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
print =============== step3
sql select * from d2.mt
if $rows != 20 then
return -1
endi
sql select * from d2.mt where ts < now + 4m
if $rows != 10 then
return -1
endi
sql select * from d2.mt where c001 = 1
if $rows != 2 then
return -1
endi
sql select * from d2.mt where c002 = 2 and c003 = 2
if $rows != 2 then
return -1
endi
sql select * from d2.mt where c002 = 2 and c003 = 2 and ts < now + 4m
if $rows != 2 then
return -1
endi
sql select count(*) from d2.mt
if $data00 != 20 then
return -1
endi
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c235), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d2.mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data00 != 20 then
return -1
endi
if $data01 != 20 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 90 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 4.500000000 then
return -1
endi
if $data08 != 20 then
return -1
endi
if $data09 != 20 then
return -1
endi
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c238), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d2.mt where a = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data00 != 10 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 45 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 4.500000000 then
return -1
endi
if $data08 != 10 then
return -1
endi
if $data09 != 10 then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 2000
print =============== step5
sql select * from d2.mt
if $rows != 20 then
return -1
endi
sql select * from d2.mt where c001 = 1
if $rows != 2 then
return -1
endi
sql select * from d2.mt where c002 = 2 and c003 = 2
if $rows != 2 then
return -1
endi
sql select count(*) from d2.mt
if $data00 != 20 then
return -1
endi
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c128), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d2.mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data00 != 20 then
return -1
endi
if $data01 != 20 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 90 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 4.500000000 then
return -1
endi
if $data08 != 20 then
return -1
endi
if $data09 != 20 then
return -1
endi

View File

@ -0,0 +1,200 @@
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
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 3000
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(now, 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 5000
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

View File

@ -0,0 +1,213 @@
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 d1.t1 (ts timestamp, c000 int, c001 int, c002 int, c003 int, c004 int, c005 int, c006 int, c007 int, c008 int, c009 int, c010 int, c011 int, c012 int, c013 int, c014 int, c015 int, c016 int, c017 int, c018 int, c019 int, c020 int, c021 int, c022 int, c023 int, c024 int, c025 int, c026 int, c027 int, c028 int, c029 int, c030 int, c031 int, c032 int, c033 int, c034 int, c035 int, c036 int, c037 int, c038 int, c039 int, c040 int, c041 int, c042 int, c043 int, c044 int, c045 int, c046 int, c047 int, c048 int, c049 int, c050 int, c051 int, c052 int, c053 int, c054 int, c055 int, c056 int, c057 int, c058 int, c059 int, c060 int, c061 int, c062 int, c063 int, c064 int, c065 int, c066 int, c067 int, c068 int, c069 int, c070 int, c071 int, c072 int, c073 int, c074 int, c075 int, c076 int, c077 int, c078 int, c079 int, c080 int, c081 int, c082 int, c083 int, c084 int, c085 int, c086 int, c087 int, c088 int, c089 int, c090 int, c091 int, c092 int, c093 int, c094 int, c095 int, c096 int, c097 int, c098 int, c099 int, c100 int, c101 int, c102 int, c103 int, c104 int, c105 int, c106 int, c107 int, c108 int, c109 int, c110 int, c111 int, c112 int, c113 int, c114 int, c115 int, c116 int, c117 int, c118 int, c119 int, c120 int, c121 int, c122 int, c123 int, c124 int, c125 int, c126 int, c127 int, c128 int, c129 int, c130 int, c131 int, c132 int, c133 int, c134 int, c135 int, c136 int, c137 int, c138 int, c139 int, c140 int, c141 int, c142 int, c143 int, c144 int, c145 int, c146 int, c147 int, c148 int, c149 int, c150 int, c151 int, c152 int, c153 int, c154 int, c155 int, c156 int, c157 int, c158 int, c159 int, c160 int, c161 int, c162 int, c163 int, c164 int, c165 int, c166 int, c167 int, c168 int, c169 int, c170 int, c171 int, c172 int, c173 int, c174 int, c175 int, c176 int, c177 int, c178 int, c179 int, c180 int, c181 int, c182 int, c183 int, c184 int, c185 int, c186 int, c187 int, c188 int, c189 int, c190 int, c191 int, c192 int, c193 int, c194 int, c195 int, c196 int, c197 int, c198 int, c199 int, c200 int, c201 int, c202 int, c203 int, c204 int, c205 int, c206 int, c207 int, c208 int, c209 int, c210 int, c211 int, c212 int, c213 int, c214 int, c215 int, c216 int, c217 int, c218 int, c219 int, c220 int, c221 int, c222 int, c223 int, c224 int, c225 int, c226 int, c227 int, c228 int, c229 int, c230 int, c231 int, c232 int, c233 int, c234 int, c235 int, c236 int, c237 int, c238 int, c239 int, c240 int, c241 int, c242 int, c243 int, c244 int, c245 int, c246 int, c247 int, c248 int, c249 int, c250 int)
sql show tables
if $rows != 1 then
return -1
endi
print =============== step2
sql insert into d1.t1 values (now,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,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 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
print ======= step3
sql select * from d1.t1
print select * from d1.t1 => rows $rows
if $rows != 10 then
return -1
endi
sql select * from d1.t1 where ts < now + 4m
print select * from d1.t1 where ts < now + 4m => rows $rows
if $rows != 5 then
return -1
endi
sql select * from d1.t1 where c001 = 1
print select * from d1.t1 where c001 = 1 => rows $rows
if $rows != 1 then
return -1
endi
sql select * from d1.t1 where c002 = 2 and c003 = 2
print select * from d1.t1 where c002 = 2 and c003 = 2 => rows $rows
if $rows != 1 then
return -1
endi
sql select * from d1.t1 where c002 = 2 and c003 = 2 and ts < now + 4m
print select * from d1.t1 where c002 = 2 and c003 = 2 and ts < now + 4m => rows $rows
if $rows != 1 then
return -1
endi
sql select count(*) from d1.t1
print select count(*) from d1.t1 => $data00
if $data00 != 10 then
return -1
endi
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250) from d1.t1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != 10 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 45 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 2.872281323 then
return -1
endi
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d1.t1
if $data00 != 10 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 45 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 2.872281323 then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 2000
print ============== step5
sql select * from d1.t1
print select * from d1.t1 => rows $rows
if $rows != 10 then
return -1
endi
sql select * from d1.t1 where c001 = 1
print select * from d1.t1 where c001 = 1 => rows $rows
if $rows != 1 then
return -1
endi
sql select * from d1.t1 where c002 = 2 and c003 = 2
print select * from d1.t1 where c002 = 2 and c003 = 2 => rows $rows
if $rows != 1 then
return -1
endi
sql select count(*) from d1.t1
print select count(*) from d1.t1 => $data00
if $data00 != 10 then
return -1
endi
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250) from d1.t1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != 10 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 45 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 2.872281323 then
return -1
endi
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d1.t1
if $data00 != 10 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 45 then
return -1
endi
if $data05 != 9 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 2.872281323 then
return -1
endi

View File

@ -0,0 +1,4 @@
run lite/column/table.sim
run lite/column/metrics.sim
run lite/column/stream.sim
run lite/column/commit.sim

View File

@ -0,0 +1,128 @@
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 1
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 1024
system sh/cfg.sh -n dnode1 -c compression -v 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
$i = 0
$dbPrefix = db
$tbPrefix = tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$N = 2000
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step2
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, f float, d double, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step3
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) -x step3
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 20000
system sh/exec.sh -n dnode1 -s start
sleep 10000
print =============== step5
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi

View File

@ -0,0 +1,123 @@
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 cacheBlockSize -v 1024
system sh/cfg.sh -n dnode1 -c compression -v 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
$i = 0
$dbPrefix = db
$tbPrefix = tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$N = 2000
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step2
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, f float, d double, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step3
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000
system sh/exec.sh -n dnode1 -s start
sleep 10000
print =============== step5
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi

View File

@ -0,0 +1,123 @@
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 cacheBlockSize -v 1024
system sh/cfg.sh -n dnode1 -c compression -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
$i = 0
$dbPrefix = db
$tbPrefix = tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$N = 2000
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step2
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, f float, d double, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step3
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000
system sh/exec.sh -n dnode1 -s start
sleep 10000
print =============== step5
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi

View File

@ -0,0 +1,4 @@
run lite/compress/compress.sim
run lite/compress/uncompress.sim
run lite/compress/commitlog.sim
run lite/compress/compress2.sim

View File

@ -0,0 +1,123 @@
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 cacheBlockSize -v 1024
system sh/cfg.sh -n dnode1 -c compression -v 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
$i = 0
$dbPrefix = cp_cp_db
$tbPrefix = cp_cp_tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$N = 2000
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step2
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, f float, d double, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step3
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
$count = 0
while $count < $N
$ms = $count . a
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
$count = $count + 1
endw
sql select * from $tb
if $rows != $N then
return -1
endi
print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000
system sh/exec.sh -n dnode1 -s start
sleep 10000
print =============== step5
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 1
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi
$i = 2
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql select * from $tb
print select * from $tb ==> $rows points
if $rows != $N then
return -1
endi

View File

@ -0,0 +1,156 @@
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
$dbPrefix = m_av_db
$tbPrefix = m_av_tb
$mtPrefix = m_av_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select avg(tbcol) from $tb
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
print =============== step3
sql select avg(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 2.000000000 then
return -1
endi
print =============== step4
sql select avg(tbcol) as b from $tb
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
print =============== step5
sql select avg(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data11 != 1.000000000 then
return -1
endi
sql select avg(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 9.500000000 then
return -1
endi
print =============== step6
sql select avg(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data41 != 4.000000000 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select avg(tbcol) from $mt
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
print =============== step8
sql select avg(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 2.000000000 then
return -1
endi
sql select avg(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
sql select avg(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 2.000000000 then
return -1
endi
print =============== step9
sql select avg(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1.000000000 then
return -1
endi
sql select avg(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 9.500000000 then
return -1
endi
print =============== step10
sql select avg(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select avg(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1.000000000 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,97 @@
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
$dbPrefix = m_bo_db
$tbPrefix = m_bo_tb
$mtPrefix = m_bo_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select bottom(tbcol, 1) from $tb
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step3
sql select bottom(tbcol, 1) from $tb where ts > now + 4m
print ===> $data01
if $data01 != 5 then
return -1
endi
print =============== step4
sql select bottom(tbcol, 1) as b from $tb
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step5
sql select bottom(tbcol, 2) as b from $tb
print ===> $data01 $data11
if $data01 != 0 then
return -1
endi
if $data11 != 1 then
return -1
endi
print =============== step6
sql select bottom(tbcol, 2) as b from $tb where ts > now + 4m
print ===> $data01 $data11
if $data01 != 5 then
return -1
endi
if $data11 != 6 then
return -1
endi
sql select bottom(tbcol, 122) as b from $tb -x step6
return -1
step6:
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,172 @@
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
$dbPrefix = m_co_db
$tbPrefix = m_co_tb
$mtPrefix = m_co_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select count(*) from $tb
print ===> select count(*) from $tb => $data00
if $data00 != $rowNum then
return -1
endi
sql select count(tbcol) from $tb
print ===> $data00
if $data00 != $rowNum then
return -1
endi
print =============== step3
sql select count(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 5 then
return -1
endi
print =============== step4
sql select count(tbcol) as b from $tb
print ===> $data00
if $data00 != $rowNum then
return -1
endi
print =============== step5
sql select count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
sql select count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
return -1
endi
print =============== step6
sql select count(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select count(*) from $mt
print ===> $data00
if $data00 != $totalNum then
return -1
endi
sql select count(tbcol) from $mt
print ===> $data00
if $data00 != $totalNum then
return -1
endi
print =============== step8
sql select count(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 50 then
return -1
endi
sql select count(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 100 then
return -1
endi
sql select count(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 25 then
return -1
endi
print =============== step9
sql select count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
return -1
endi
if $data11 != 10 then
return -1
endi
sql select count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
endi
print =============== step10
sql select count(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != $rowNum then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select count(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data01
if $data01 != 1 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,89 @@
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
$dbPrefix = m_di_db
$tbPrefix = m_di_tb
$mtPrefix = m_di_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select diff(tbcol) from $tb
print ===> $data11
if $data11 != 1 then
return -1
endi
print =============== step3
sql select diff(tbcol) from $tb where ts > now + 4m
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(tbcol) from $tb where ts < now + 4m
print ===> $data11
if $data11 != 1 then
return -1
endi
print =============== step4
sql select diff(tbcol) as b from $tb
print ===> $data11
if $data11 != 1 then
return -1
endi
print =============== step5
sql select diff(tbcol) as b from $tb interval(1m) -x step5
return -1
step5:
print =============== step6
sql select diff(tbcol) as b from $tb where ts < now + 4m interval(1m) -x step6
return -1
step6:
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,155 @@
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
$dbPrefix = m_di_db
$tbPrefix = m_di_tb
$mtPrefix = m_di_mt
$tbNum = 2
$rowNum = 10000
$totalNum = 20000
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 nchar(5), c9 binary(10)) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
$tinyint = $x / 128
sql insert into $tb values (now + $ms , $x , $x , $x , $x , $tinyint , $x , $x , $x , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select diff(c1) from $tb
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(c2) from $tb
print ===> $data11
if $data11 != 1.00000 then
return -1
endi
sql select diff(c3) from $tb
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(c4) from $tb
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(c5) from $tb
print ===> $data11
if $data11 != 0 then
return -1
endi
sql select diff(c6) from $tb
print ===> $data11
if $data11 != 1.000000000 then
return -1
endi
sql_error select diff(c7) from $tb
sql_error select diff(c8) from $tb
sql_error select diff(c9) from $tb
sql_error select diff(ts) from $tb
sql_error select diff(c1), diff(c2) from $tb
sql_error select 2+diff(c1) from $tb
sql_error select diff(c1+2) from $tb
sql_error select diff(c1) from $tb where ts > 0 and ts < now + 100m interval(10m)
sql_error select diff(c1) from $mt
sql_error select diff(diff(c1)) from $tb
sql_error select diff(c1) from m_di_tb1 where c2 like '2%'
print =============== step3
sql select diff(c1) from $tb where c1 > 5
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(c2) from $tb where c2 > 5
print ===> $data11
if $data11 != 1.00000 then
return -1
endi
sql select diff(c3) from $tb where c3 > 5
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(c4) from $tb where c4 > 5
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(c5) from $tb where c5 > 5
print ===> $data11
if $data11 != 0 then
return -1
endi
sql select diff(c6) from $tb where c6 > 5
print ===> $data11
if $data11 != 1.000000000 then
return -1
endi
print =============== step4
sql select diff(c1) from $tb where c1 > 5 and c2 < $rowNum
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(c1) from $tb where c9 like '%9' and c1 <= 20
if $rows != 1 then
return -1
endi
print ===> $data11
if $data01 != 10 then
return -1
endi
print =============== step5
sql select diff(c1) as b from $tb interval(1m) -x step5
return -1
step5:
print =============== step6
sql select diff(c1) as b from $tb where ts < now + 4m interval(1m) -x step6
return -1
step6:
print =============== clear
#sql drop database $db
#sql show databases
#if $rows != 0 then
# return -1
#endi

View File

@ -0,0 +1,158 @@
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
$dbPrefix = m_fi_db
$tbPrefix = m_fi_tb
$mtPrefix = m_fi_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select first(tbcol) from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step3
sql select first(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step4
sql select first(tbcol) as b from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step5
sql select first(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 0 then
return -1
endi
sql select first(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step6
sql select first(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data41 != 4 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select first(tbcol) from $mt
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step8
sql select first(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select first(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select first(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step9
sql select first(tbcol) as b from $mt interval(1m)
print select first(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select first(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step10
sql select first(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 0 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select first(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,174 @@
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
$dbPrefix = m_in_db
$tbPrefix = m_in_tb
$mtPrefix = m_in_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb interval(1m)
print ===> $rows
if $rows < $rowNum then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data05 != 1 then
return -1
endi
print =============== step3
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now + 4m interval(1m)
print ===> $rows
if $rows > 10 then
return -1
endi
if $rows < 3 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data05 != 1 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now-1m interval(1m)
print ===> $rows
if $rows < 18 then
return -1
endi
if $rows > 22 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data05 != 1 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now+1m interval(1m) fill(value,0)
print ===> $rows
if $rows < 30 then
return -1
endi
if $rows > 50 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data25 != 1 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt interval(1m)
print ===> $rows
if $rows < 18 then
return -1
endi
if $rows > 22 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now + 4m interval(1m)
print ===> $rows
if $rows < 3 then
return -1
endi
if $rows > 7 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now-1m interval(1m)
print ===> $rows
if $rows < 18 then
return -1
endi
if $rows > 22 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== step9
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now+1m interval(1m) fill(value, 0)
if $rows < 30 then
return -1
endi
if $rows > 50 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,157 @@
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
$dbPrefix = m_la_db
$tbPrefix = m_la_tb
$mtPrefix = m_la_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select last(tbcol) from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step3
sql select last(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step4
sql select last(tbcol) as b from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step5
sql select last(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select last(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step6
sql select last(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select last(tbcol) from $mt
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step8
sql select last(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
sql select last(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 19 then
return -1
endi
sql select last(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step9
sql select last(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select last(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step10
sql select last(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 19 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select last(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,98 @@
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
$dbPrefix = m_le_db
$tbPrefix = m_le_tb
$mtPrefix = m_le_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db keep 36500
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 2
$ms = 1000
while $x < $rowNum
$ms = $ms + 1000
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select leastsquares(tbcol, 1, 1) from $tb
print ===> $data00
if $data00 != @(1.000000, 1.000000)@ then
return -1
endi
print =============== step3
sql select leastsquares(tbcol, 1, 1) from $tb where ts < now + 4m
print ===> $data00
if $data00 != @(1.000000, 1.000000)@ then
return -1
endi
print =============== step4
sql select leastsquares(tbcol, 1, 1) as b from $tb
print ===> $data00
if $data00 != @(1.000000, 1.000000)@ then
return -1
endi
print =============== step5
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m)
print ===> $data01
if $data01 != @(1.000000, 1.000000)@ then
return -1
endi
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
print ===> $data01
if $data01 != @(1.000000, 1.000000)@ then
return -1
endi
print =============== step6
sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data01 != @(1.000000, 1.000000)@ then
return -1
endi
print ===> $rows
if $rows != 1 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,157 @@
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
$dbPrefix = m_ma_db
$tbPrefix = m_ma_tb
$mtPrefix = m_ma_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select max(tbcol) from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step3
sql select max(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step4
sql select max(tbcol) as b from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step5
sql select max(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select max(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step6
sql select max(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select max(tbcol) from $mt
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step8
sql select max(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
sql select max(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 19 then
return -1
endi
sql select max(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step9
sql select max(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select max(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step10
sql select max(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 19 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select max(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,158 @@
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
$dbPrefix = m_mi_db
$tbPrefix = m_mi_tb
$mtPrefix = m_mi_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select min(tbcol) from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step3
sql select min(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step4
sql select min(tbcol) as b from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step5
sql select min(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select min(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step6
sql select min(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select min(tbcol) from $mt
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step8
sql select min(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select min(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select min(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step9
sql select min(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select min(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step10
sql select min(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 0 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select min(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,225 @@
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
$dbPrefix = db
$tbPrefix = tb
$mtPrefix = mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int, tbcol2 int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
$v1 = $x
$v2 = $x
if $x == 0 then
$v1 = NULL
endi
sql insert into $tb values (now + $ms , $v1 , $v2 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select * from $tb
print $data00 $data01 $data02
if $data01 != null then
return -1
endi
if $data02 != 0 then
return -1
endi
if $rows != 20 then
return -1
endi
print =============== step3
sql select count(tbcol), count(tbcol2), avg(tbcol), avg(tbcol2), sum(tbcol), sum(tbcol2) from $tb
print ===> $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 19 then
return -1
endi
if $data01 != 20 then
return -1
endi
if $data02 != 10.000000000 then
return -1
endi
if $data03 != 9.500000000 then
return -1
endi
if $data04 != 190 then
return -1
endi
if $data05 != 190 then
return -1
endi
print =============== step4
sql select * from $tb where tbcol2 = 19
print ===> $data01 $data02
if $rows != 1 then
return -1
endi
if $data01 != 19 then
return -1
endi
if $data02 != 19 then
return -1
endi
sql select * from $tb where tbcol = NULL -x step3
return -1
step3:
print =============== step5
sql create table $tb using $mt tags( NULL )
# return -1
#step51:
#sql alter table $tb set tgcol=NULL -x step52
# return -1
#step52:
sql select * from $mt where tgcol = NULL -x step5
return -1
step5:
print =============== step6
sql select count(tbcol), count(tbcol2), avg(tbcol), avg(tbcol2), sum(tbcol), sum(tbcol2) from $mt
print ===> $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 190 then
return -1
endi
if $data01 != 200 then
return -1
endi
if $data02 != 10.000000000 then
return -1
endi
if $data03 != 9.500000000 then
return -1
endi
if $data04 != 1900 then
return -1
endi
if $data05 != 1900 then
return -1
endi
print =============== step7
sql create table t1 (ts timestamp, i bool)
sql create table t2 (ts timestamp, i smallint)
sql create table t3 (ts timestamp, i tinyint)
sql create table t4 (ts timestamp, i int)
sql create table t5 (ts timestamp, i bigint)
sql create table t6 (ts timestamp, i float)
sql create table t7 (ts timestamp, i double)
sql create table t8 (ts timestamp, i binary(10))
sql insert into t1 values(now, NULL)
sql insert into t2 values(now, NULL)
sql insert into t3 values(now, NULL)
sql insert into t4 values(now, NULL)
sql insert into t5 values(now, NULL)
sql insert into t6 values(now, NULL)
sql insert into t7 values(now, NULL)
#sql insert into t8 values(now, NULL)
#sql select * from t1
#if $rows != 1 then
# return -1
#endi
#if $data01 != NULL then
# return -1
#endi
sql select * from t2
if $rows != 1 then
return -1
endi
if $data01 != null then
return -1
endi
sql select * from t3
if $rows != 1 then
return -1
endi
if $data01 != null then
return -1
endi
sql select * from t4
if $rows != 1 then
return -1
endi
if $data01 != null then
return -1
endi
sql select * from t5
if $rows != 1 then
return -1
endi
if $data01 != null then
return -1
endi
sql select * from t6
if $rows != 1 then
return -1
endi
if $data01 != null then
return -1
endi
sql select * from t7
if $rows != 1 then
return -1
endi
if $data01 != null then
return -1
endi
#sql select * from t8
#if $rows != 1 then
# return -1
#endi
#if $data01 != null then
# return -1
#endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,114 @@
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
$dbPrefix = m_pe_db
$tbPrefix = m_pe_tb
$mtPrefix = m_pe_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select percentile(tbcol, 10) from $tb
print ===> $data00
if $data00 != 1.900000000 then
return -1
endi
sql select percentile(tbcol, 20) from $tb
print ===> $data00
if $data00 != 3.800000000 then
return -1
endi
sql select percentile(tbcol, 100) from $tb
print ===> $data00
if $data00 != 19.000000000 then
return -1
endi
sql select percentile(tbcol, 110) from $tb -x step2
return -1
step2:
print =============== step3
sql select percentile(tbcol, 1) from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.140000000 then
return -1
endi
sql select percentile(tbcol, 5) from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.700000000 then
return -1
endi
sql select percentile(tbcol, 0) from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.000000000 then
return -1
endi
print =============== step4
sql select percentile(tbcol, 1) as c from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.140000000 then
return -1
endi
sql select percentile(tbcol, 5) as c from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.700000000 then
return -1
endi
sql select percentile(tbcol, 0) as c from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.000000000 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,96 @@
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
$dbPrefix = m_st_db
$tbPrefix = m_st_tb
$mtPrefix = m_st_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select stddev(tbcol) from $tb
print ===> $data00
if $data00 != 5.766281297 then
return -1
endi
print =============== step3
sql select stddev(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 1.414213562 then
return -1
endi
print =============== step4
sql select stddev(tbcol) as b from $tb
print ===> $data00
if $data00 != 5.766281297 then
return -1
endi
print =============== step5
sql select stddev(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 0.000000000 then
return -1
endi
sql select stddev(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 5.766281297 then
return -1
endi
print =============== step6
sql select stddev(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data01 != 0.000000000 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,157 @@
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
$dbPrefix = m_su_db
$tbPrefix = m_su_tb
$mtPrefix = m_su_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select sum(tbcol) from $tb
print ===> $data00
if $data00 != 190 then
return -1
endi
print =============== step3
sql select sum(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 10 then
return -1
endi
print =============== step4
sql select sum(tbcol) as b from $tb
print ===> $data00
if $data00 != 190 then
return -1
endi
print =============== step5
sql select sum(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select sum(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 190 then
return -1
endi
print =============== step6
sql select sum(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select sum(tbcol) from $mt
print ===> $data00
if $data00 != 1900 then
return -1
endi
print =============== step8
sql select sum(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 100 then
return -1
endi
sql select sum(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 950 then
return -1
endi
sql select sum(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 50 then
return -1
endi
print =============== step9
sql select sum(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 < 5 then
return -1
endi
sql select sum(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 1900 then
return -1
endi
print =============== step10
sql select sum(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 190 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol
print select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol
print ===> $data01
if $data01 != 10 then
return -1
endi
if $rows != 10 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,16 @@
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

View File

@ -0,0 +1,97 @@
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
$dbPrefix = m_to_db
$tbPrefix = m_to_tb
$mtPrefix = m_to_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select top(tbcol, 1) from $tb
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step3
sql select top(tbcol, 1) from $tb where ts < now + 4m
print ===> $data01
if $data01 != 4 then
return -1
endi
print =============== step4
sql select top(tbcol, 1) as b from $tb
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step5
sql select top(tbcol, 2) as b from $tb
print ===> $data01 $data11
if $data01 != 18 then
return -1
endi
if $data11 != 19 then
return -1
endi
print =============== step6
sql select top(tbcol, 2) as b from $tb where ts < now + 4m
print ===> $data01 $data11
if $data01 != 3 then
return -1
endi
if $data11 != 4 then
return -1
endi
sql select top(tbcol, 122) as b from $tb -x step6
return -1
step6:
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,7 @@
sql connect
$x = 1
begin:
sql insert into db.tb values(now, $x ) -x begin
#print ===> insert successed $x
$x = $x + 1
goto begin

View File

@ -0,0 +1,209 @@
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -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/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
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 dnode3 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
print ========= start dnode1 as master
system sh/exec.sh -n dnode1 -s start
sql connect
print ========= start other dnodes
sql create dnode 192.168.0.2
system sh/exec.sh -n dnode2 -s start
sleep 3000
print ======== step1 create db
sql create database keepdb replica 1 keep 30 days 7
sql use keepdb
sql create table tb (ts timestamp, i int)
$x = 1
while $x < 41
$time = $x . d
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows != 40 then
return -1
endi
if $data01 != 40 then
return -1
endi
print ======== step2 stop dnode
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows >= 40 then
return -1
endi
if $rows <= 20 then
return -1
endi
if $data01 != 40 then
return -1
endi
$num1 = $rows + 40
print ======== step3 alter db
sql alter database keepdb keep 60
sleep 1000
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data02 != 1 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data05 != 7 then
return -1
endi
if $data06 != 60 then
return -1
endi
print ======== step4 insert data
$x = 41
while $x < 81
$time = $x . d
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows != $num1 then
return -1
endi
if $data01 != 80 then
return -1
endi
print ======== step5 stop dnode
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows >= $num1 then
return -1
endi
if $rows <= 50 then
return -1
endi
if $data01 != 80 then
return -1
endi
print ======== step6 alter db
sql alter database keepdb keep 30
sleep 1000
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data02 != 1 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data05 != 7 then
return -1
endi
if $data06 != 30 then
return -1
endi
print ======== step7 stop dnode
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows >= 40 then
return -1
endi
if $rows <= 20 then
return -1
endi
if $data01 != 80 then
return -1
endi
$num3 = $rows + 40
print ======== step8 insert data
$x = 81
while $x < 121
$time = $x . d
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows != $num3 then
return -1
endi
if $data01 != 120 then
return -1
endi
print ======== step9 alter db
sql alter database keepdb keep -1 -x error1
return -1
error1:
sql alter database keepdb keep 0 -x error2
return -1
error2:
sql alter database keepdb days 1 -x error3
return -1
error3:
print ======= test success

View File

@ -0,0 +1,204 @@
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 numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c tables -v 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
$i = 0
$dbPrefix = ob_db_db
$tbPrefix = ob_db_tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql create database $db replica 1 days 20 keep 2000
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data05 != 20 then
return -1
endi
if $data07 != 1000 then
return -1
endi
print =============== step2
sql create database $db
sql show databases
if $rows != 1 then
return -1
endi
print =============== step3
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
print =============== step4
sql_error drop database $db
print =============== step5
sql create database $db replica 1 days 15 keep 1500
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data05 != 15 then
return -1
endi
#if $data06 != 1500,15000,1500 then
# return -1
#endi
if $data07 != 1000 then
return -1
endi
print =============== step6
sql use $db
sql create table $tb (ts timestamp, speed int)
$i = 1
while $i < 4
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
$i = $i + 1
endw
sql show databases
if $rows != 4 then
return -1
endi
$i = 4
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int) -x step6
return -1
step6:
print =============== step7
$i = 0
while $i < 5
$db = $dbPrefix . $i
sql drop database $db
$i = $i + 1
endw
print =============== step8
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
print =============== step9
sql drop database $db
print =============== step10
sql create database $db
sql use $db
sql show tables
if $rows != 0 then
return -1
endi
print =============== step11
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
print =============== step12
sql drop database $db
print =============== step13
sql create database $db
sql use $db
sql show tables
if $rows != 0 then
return -1
endi
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
sql insert into $tb values (now+1a, 0)
sql insert into $tb values (now+2a, 1)
sql insert into $tb values (now+3a, 2)
sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
sql select * from $tb
if $rows != 5 then
return -1
endi
print =============== step14
sql drop database $db
print =============== step15
sql create database $db
sql use $db
sql show tables
if $rows != 0 then
return -1
endi
print =============== step16
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
sql select * from $tb
if $rows != 0 then
return -1
endi
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,110 @@
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up
system sh/ip.sh -i 4 -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/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.4
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 dnode3 -c commitLog -v 0
system sh/cfg.sh -n dnode4 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d1 replica 1
sql create database d2 replica 1
sql create database d3 replica 1
sql create database d4 replica 1
sql create table d1.t1 (ts timestamp, i int)
sql create table d2.t2 (ts timestamp, i int)
sql create table d3.t3 (ts timestamp, i int)
sql create table d4.t4 (ts timestamp, i int)
sql insert into d2.t2 values(now, 1)
sql insert into d1.t1 values(now, 1)
sql insert into d3.t3 values(now, 1)
sql insert into d4.t4 values(now, 1)
sql select * from d1.t1
if $rows != 1 then
return -1
endi
sql select * from d2.t2
if $rows != 1 then
return -1
endi
sql select * from d3.t3
if $rows != 1 then
return -1
endi
sql select * from d4.t4
if $rows != 1 then
return -1
endi
print ======== step2
sql drop database d1
sleep 1000
sql insert into d1.t1 values(now, 2) -x step2
return -1
step2:
print ========= step3
sql create database d1 replica 1
sql create table d1.t1 (ts timestamp, i int)
sql insert into d1.t1 values(now, 2)
sql select * from d1.t1
if $rows != 1 then
return -1
endi
print ========= step4
$x = 0
while $x < 20
sql drop database d1
sleep 1000
sql insert into d1.t1 values(now, -1) -x step4
return -1
step4:
sql create database d1 replica 1
sql create table d1.t1 (ts timestamp, i int)
sql insert into d1.t1 values(now, $x )
sql select * from d1.t1
if $rows != 1 then
return -1
endi
$x = $x + 1
print ===> loop times: $x
endw

View File

@ -0,0 +1,117 @@
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up
system sh/ip.sh -i 4 -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/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.4
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 dnode3 -c commitLog -v 0
system sh/cfg.sh -n dnode4 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
sql create database d1 replica 1
sql create database d2 replica 1
sql create database d3 replica 1
sql create database d4 replica 1
sql create table d1.t1 (ts timestamp, i int)
sql create table d2.t2 (ts timestamp, i int)
sql create table d3.t3 (ts timestamp, i int)
sql create table d4.t4 (ts timestamp, i int)
sql insert into d2.t2 values(now, 1)
sql insert into d1.t1 values(now, 1)
sql insert into d3.t3 values(now, 1)
sql insert into d4.t4 values(now, 1)
sql select * from d1.t1
if $rows != 1 then
return -1
endi
sql select * from d2.t2
if $rows != 1 then
return -1
endi
sql select * from d3.t3
if $rows != 1 then
return -1
endi
sql select * from d4.t4
if $rows != 1 then
return -1
endi
print ======== step2
sql drop database d1
sleep 1000
sql insert into d1.t1 values(now, 2) -x step2
return -1
step2:
print ========= step3
sql create database db1 replica 1
sql create table db1.tb1 (ts timestamp, i int)
sql insert into db1.tb1 values(now, 2)
sql select * from db1.tb1
if $rows != 1 then
return -1
endi
print ========= step4
$x = 1
while $x < 20
$db = db . $x
$tb = tb . $x
sql use $db
sql drop database $db
sleep 1000
sql insert into $tb values(now, -1) -x step4
return -1
step4:
$x = $x + 1
$db = db . $x
$tb = tb . $x
sql create database $db replica 1
sql use $db
sql create table $tb (ts timestamp, i int)
sql insert into $tb values(now, $x )
sql select * from $tb
if $rows != 1 then
return -1
endi
print ===> loop times: $x
endw

View File

@ -0,0 +1,121 @@
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 numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 200
system sh/cfg.sh -n dnode2 -c cacheBlockSize -v 200
system sh/cfg.sh -n dnode3 -c cacheBlockSize -v 200
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
print ======== step1
$tbPrefix = t
$i = 0
while $i < 1000
$db = db . $i
sql create database $db
sql use $db
$tb = $tbPrefix . $i
sql create table $tb (ts timestamp, i int);
sql insert into $tb values(now, 1);
sleep 1000
sql drop database $db
print times $i
$i = $i + 1
endw
print ======== step2
sleep 1000
sql drop database $db
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 numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 200
system sh/cfg.sh -n dnode2 -c cacheBlockSize -v 200
system sh/cfg.sh -n dnode3 -c cacheBlockSize -v 200
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
print ======== step1
$tbPrefix = t
$i = 0
while $i < 1000
$db = db . $i
sql create database $db tables 4
sql use $db
sql create table st (ts timesetamp, i int) tags(j int);
$tb = $tbPrefix . $i
$tb = $tb . a
$tb1 = $tb . 1
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 2
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 3
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 5
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 5
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 6
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 7
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 8
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
sleep 1000
sql drop database $db
print times $i
$i = $i + 1
endw
print ======== step2
sleep 1000
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,79 @@
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 numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 200
system sh/cfg.sh -n dnode2 -c cacheBlockSize -v 200
system sh/cfg.sh -n dnode3 -c cacheBlockSize -v 200
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
print ======== step1
sql create database db tables 4;
sql use db
$tbPrefix = t
$i = 0
while $i < 1000
sql create table st (ts timestamp, i int) tags(j int);
$tb = $tbPrefix . $i
$tb = $tb . a
$tb1 = $tb . 1
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 2
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 3
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 5
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 5
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 6
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 7
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb . 8
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
sql drop table st
sleep 1000
print times $i
$i = $i + 1
endw
print ======== step2
sleep 1000
sql drop database db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,59 @@
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up
system sh/ip.sh -i 4 -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/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.4
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 dnode3 -c commitLog -v 0
system sh/cfg.sh -n dnode4 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql create database db
sql create table db.tb (ts timestamp, i int)
sql insert into db.tb values(now, 1)
print ======== start back
run_back lite/db/back_insert.sim
sleep 1000
print ======== step1
$x = 1
while $x < 20
print drop database times $x
sql drop database db -x step1
step1:
sql create database db
sql create table db.tb (ts timestamp, i int)
sleep 3000
$x = $x + 1
endw

View File

@ -0,0 +1,47 @@
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 numOfTotalVnodes -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql create database db
sql create table db.tb (ts timestamp, i int)
sql insert into db.tb values(now, 1)
sql create database db2
sql create table db2.tb2 (ts timestamp, i int)
sql insert into db2.tb2 values(now, 1)
sql create database db3
sql create table db3.tb3 (ts timestamp, i int)
sql insert into db3.tb3 values(now, 1)
sql create database db4
sql create table db4.tb4 (ts timestamp, i int)
sql insert into db4.tb4 values(now, 1)
print ======== start back
run_back lite/db/back_insert.sim
sleep 1000
print ======== step1
$x = 1
while $x < 10
print drop database times $x
sql drop database db -x step1
step1:
sql create database db
sql create table db.tb (ts timestamp, i int)
sleep 3000
$x = $x + 1
endw

View File

@ -0,0 +1,94 @@
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 numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c sessionsPerVnode -v 2000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print =============== step1
sql_error drop database dd
sql create database -x step1
return -1
step1:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step2
sql create database a
sql show databases
if $rows != 1 then
return -1
endi
sql drop database a
sql show databases
if $rows != 0 then
return -1
endi
print =============== step3
sql create database a12345678
sql show databases
if $rows != 1 then
return -1
endi
sql drop database a12345678
sql show databases
if $rows != 0 then
return -1
endi
print =============== step4
sql create database a012345678901201234567890120123456789012 -x step4
return -1
step4:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step5
sql create database a;1
sql drop database a
sql show databases
if $rows != 0 then
return -1
endi
print =============== step6
sql create database a'1 -x step6
return -1
step6:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step7
sql create database (a) -x step7
return -1
step7:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step8
sql create database a.1 -x step8
return -1
step8:
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,71 @@
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 numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c tables -v 4
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
sql create database d1
sql create table d1.t1(ts timestamp, i int)
sql create database d2
sql create table d2.t1(ts timestamp, i int)
sql create database d3
sql create table d3.t1(ts timestamp, i int)
sql create database d4
sql create table d4.t1(ts timestamp, i int)
sleep 3000
sql drop database d1
sql drop database d2
sql drop database d3
sql drop database d4
sleep 3000
sql create database d5
sql create table d5.t1(ts timestamp, i int)
sql create database d6
sql create table d6.t1(ts timestamp, i int)
sql create database d7
sql create table d7.t1(ts timestamp, i int)
sql create database d8
sql create table d8.t1(ts timestamp, i int)
sleep 3000
sql drop database d5
sql drop database d6
sql drop database d7
sql drop database d8
sleep 3000
sql create database d9;
sql create table d9.t1(ts timestamp, i int)
sql create database d10;
sql create table d10.t1(ts timestamp, i int)
sql create database d11
sql create table d11.t1(ts timestamp, i int)
sql create database d12
sql create table d12.t1(ts timestamp, i int)
sql drop database d9
sql drop database d10
sql drop database d11
sql drop database d12

View File

@ -0,0 +1,126 @@
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 numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c sessionsPerVnode -v 2000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print =============== step2
sql create database db tables 2
sql show databases
print $rows $data07
if $rows != 1 then
return -1
endi
if $data07 != 2 then
return -1
endi
print =============== step3
sql use db
sql create table t1 (ts timestamp, i int)
sql create table t2 (ts timestamp, i int)
sql create table t3 (ts timestamp, i int)
sql create table t4 (ts timestamp, i int)
sql create table t11 (ts timestamp, i int)
sql create table t22 (ts timestamp, i int)
sql create table t33 (ts timestamp, i int)
sql create table t44 (ts timestamp, i int)
print =============== step4
sql insert into t1 values(now, 1)
sql insert into t2 values(now, 2)
sql insert into t3 values(now, 3)
sql insert into t4 values(now, 4)
sql insert into t11 values(now, 1)
sql insert into t22 values(now, 2)
sql insert into t33 values(now, 3)
sql insert into t44 values(now, 4)
print =============== step5
sql select * from t1
if $data01 != 1 then
return -1
endi
sql select * from t2
if $data01 != 2 then
return -1
endi
sql select * from t3
if $data01 != 3 then
return -1
endi
sql select * from t4
if $data01 != 4 then
return -1
endi
print =============== step6
sql drop database db
sql reset query cache
sleep 20000
print =============== step7
sql create database db tables 2
sql show databases
print $rows $data07
if $rows != 1 then
return -1
endi
if $data07 != 2 then
return -1
endi
print =============== step8
sql use db
sql create table t1 (ts timestamp, i int)
sql create table t2 (ts timestamp, i int)
sql create table t3 (ts timestamp, i int)
sql create table t4 (ts timestamp, i int)
sql create table t11 (ts timestamp, i int)
sql create table t22 (ts timestamp, i int)
sql create table t33 (ts timestamp, i int)
sql create table t44 (ts timestamp, i int)
print =============== step9
sql insert into t1 values(now, 1)
sql insert into t2 values(now, 2)
sql insert into t3 values(now, 3)
sql insert into t4 values(now, 4)
sql insert into t11 values(now, 1)
sql insert into t22 values(now, 2)
sql insert into t33 values(now, 3)
sql insert into t44 values(now, 4)
print =============== step10
sql select * from t1
if $data01 != 1 then
return -1
endi
sql select * from t2
if $data01 != 2 then
return -1
endi
sql select * from t3
if $data01 != 3 then
return -1
endi
sql select * from t4
if $data01 != 4 then
return -1
endi

View File

@ -0,0 +1,7 @@
run lite/db/tables.sim
run lite/db/basic.sim
run lite/db/len.sim
run lite/db/delete_reuse1.sim
run lite/db/delete_reuse2.sim
run lite/db/delete_writing1.sim
run lite/db/delete_writing2.sim

View File

@ -0,0 +1,295 @@
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 ======================== dnode1 start
$dbPrefix = fi_bt_db
$tbPrefix = fi_bt_tb
$mtPrefix = fi_bt_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol2 bool, tbcol int) TAGS(tgcol bool, tgcol2 int)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0, 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1, 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1, 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
print =============== step4
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step5
sql select * from $mt where ts > now + 4m and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step6
sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step9
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 50 then
return -1
endi
print =============== step10
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 and tbcol2 = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step11
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step12
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 interval(1d) group by tgcol order by tgcol desc
print $db
print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 interval(1d) group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,521 @@
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 ======================== dnode1 start
$dbPrefix = fi_3_db
$tbPrefix = fi_3_tb
$mtPrefix = fi_3_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 int, tbcol3 float) TAGS(tgcol1 smallint, tgcol2 int, tgcol3 float)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0, 0, 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 0, 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1, 1, 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1, 1, 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt
if $rows != $totalNum then
return -1
endi
sql select * from $mt where ts < now + 4m
if $rows != 50 then
return -1
endi
sql select * from $mt where ts > now + 4m
if $rows != 150 then
return -1
endi
sql select * from $mt where ts = now + 4m
if $rows != 0 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m
if $rows != 10 then
return -1
endi
print =============== step3
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
print =============== step4
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
print =============== step5
sql select * from $mt where tbcol3 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 1
if $rows != 100 then
return -1
endi
print =============== step6
sql select * from $mt where ts > now + 4m and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step7
sql select * from $mt where ts > now + 4m and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step8
sql select * from $mt where ts > now + 4m and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step9
sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step10
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step11
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
print =============== step12
sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step13
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step14
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step15
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 50 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step16
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step17
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step18
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step19
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,711 @@
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 ======================== dnode1 start
$dbPrefix = fi_4_db
$tbPrefix = fi_4_tb
$mtPrefix = fi_4_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 bigint, tbcol3 float, tbcol4 double) TAGS(tgcol1 smallint, tgcol2 bigint, tgcol3 float, tgcol4 double)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0, 0, 0, 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 0, 0, 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1, 1, 1, 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1, 1, 1, 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt
if $rows != $totalNum then
return -1
endi
sql select * from $mt where ts < now + 4m
if $rows != 50 then
return -1
endi
sql select * from $mt where ts > now + 4m
if $rows != 150 then
return -1
endi
sql select * from $mt where ts = now + 4m
if $rows != 0 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m
if $rows != 10 then
return -1
endi
print =============== step3
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
print =============== step4
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
print =============== step5
sql select * from $mt where tbcol3 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 1
if $rows != 100 then
return -1
endi
print =============== step6
sql select * from $mt where tbcol4 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 <> 1
if $rows != 100 then
return -1
endi
print =============== step7
sql select * from $mt where ts > now + 4m and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step8
sql select * from $mt where ts > now + 4m and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step9
sql select * from $mt where ts > now + 4m and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step10
sql select * from $mt where ts > now + 4m and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step11
sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step12
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step13
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
print =============== step14
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
print =============== step15
sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step16
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step17
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step18
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step19
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step20
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 50 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step21
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol4
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step22
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step23
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step24
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,834 @@
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 ======================== dnode1 start
$dbPrefix = fi_5_db
$tbPrefix = fi_5_tb
$mtPrefix = fi_5_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol1 tinyint, tbcol2 int, tbcol3 bigint, tbcol4 double, tbcol5 smallint) TAGS(tgcol1 tinyint, tgcol2 int, tgcol3 bigint, tgcol4 double, tgcol5 smallint)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0, 0, 0, 0, 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 0, 0, 0, 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1, 1, 1, 1, 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1, 1, 1, 1, 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt
if $rows != $totalNum then
return -1
endi
sql select * from $mt where ts < now + 4m
if $rows != 50 then
return -1
endi
sql select * from $mt where ts > now + 4m
if $rows != 150 then
return -1
endi
sql select * from $mt where ts = now + 4m
if $rows != 0 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m
if $rows != 10 then
return -1
endi
print =============== step3
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
print =============== step4
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
print =============== step5
sql select * from $mt where tbcol3 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 1
if $rows != 100 then
return -1
endi
print =============== step6
sql select * from $mt where tbcol4 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 <> 1
if $rows != 100 then
return -1
endi
print =============== step7
sql select * from $mt where tbcol5 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol5 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol5 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol5 <> 1
if $rows != 100 then
return -1
endi
print =============== step8
sql select * from $mt where ts > now + 4m and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step9
sql select * from $mt where ts > now + 4m and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step10
sql select * from $mt where ts > now + 4m and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step11
sql select * from $mt where ts > now + 4m and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step12
sql select * from $mt where ts > now + 4m and tbcol5 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step13
sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step14
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
print =============== step15
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
print =============== step16
sql select * from $mt where ts > now + 4m and tbcol5 = 1 and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 1 and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
print =============== step17
sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step18
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step19
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step20
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 and tbcol5 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 and tbcol5 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 5 then
return -1
endi
print =============== step21
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step22
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step23
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 50 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step24
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol4
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol5
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step25
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step26
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step27
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 interval(1d) group by tgcol5 order by tgcol5 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,989 @@
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 ======================== dnode1 start
$dbPrefix = fi_6_db
$tbPrefix = fi_6_tb
$mtPrefix = fi_6_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 bigint, tbcol3 smallint, tbcol4 bigint, tbcol5 float, tbcol6 bool) TAGS(tgcol1 smallint, tgcol2 bigint, tgcol3 smallint, tgcol4 bigint, tgcol5 float, tgcol6 bool)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0, 0, 0, 0, 0, 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 0, 0, 0, 0, 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1, 1, 1, 1, 1, 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1, 1, 1, 1, 1, 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt
if $rows != $totalNum then
return -1
endi
sql select * from $mt where ts < now + 4m
if $rows != 50 then
return -1
endi
sql select * from $mt where ts > now + 4m
if $rows != 150 then
return -1
endi
sql select * from $mt where ts = now + 4m
if $rows != 0 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m
if $rows != 10 then
return -1
endi
print =============== step3
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
print =============== step4
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
print =============== step5
sql select * from $mt where tbcol3 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 1
if $rows != 100 then
return -1
endi
print =============== step6
sql select * from $mt where tbcol4 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol4 <> 1
if $rows != 100 then
return -1
endi
print =============== step7
sql select * from $mt where tbcol5 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol5 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol5 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol5 <> 1
if $rows != 100 then
return -1
endi
print =============== step8
sql select * from $mt where tbcol6 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol6 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol6 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol6 <> 1
if $rows != 100 then
return -1
endi
print =============== step9
sql select * from $mt where ts > now + 4m and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step10
sql select * from $mt where ts > now + 4m and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step11
sql select * from $mt where ts > now + 4m and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step12
sql select * from $mt where ts > now + 4m and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step13
sql select * from $mt where ts > now + 4m and tbcol5 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step14
sql select * from $mt where ts > now + 4m and tbcol6 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol6 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol6 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol6 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol6 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol6 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol6 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol6 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step15
sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step16
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
print =============== step17
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
print =============== step18
sql select * from $mt where ts > now + 4m and tbcol5 = 1 and tbcol4 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 1 and tbcol4 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 = 0 and tbcol4 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 and tbcol4 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 and tbcol4 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0
if $rows != 5 then
return -1
endi
print =============== step19
sql select * from $mt where ts > now + 4m and tbcol5 = 1 and tbcol6 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 1 and tbcol6 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 = 0 and tbcol6 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol5 <> 0 and tbcol6 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 = 0 and tbcol6 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 and tbcol6 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 and tbcol6 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m and ts < now + 5m and tbcol6 <> 0
if $rows != 5 then
return -1
endi
print =============== step20
sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step21
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step22
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step23
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 and tbcol5 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 and tbcol5 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0
if $rows != 5 then
return -1
endi
print =============== step24
sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 and tbcol5 = 1 and tbcol6 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 and tbcol5 <> 1 and tbcol6 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 and tbcol6 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 and tbcol6 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0
if $rows != 5 then
return -1
endi
print =============== step25
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step26
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step27
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 50 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step28
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol4
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol5
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol6
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step29
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step30
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step31
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 interval(1d) group by tgcol5 order by tgcol5 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 interval(1d) group by tgcol6 order by tgcol6 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,160 @@
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 ======================== dnode1 start
$dbPrefix = fi_bi_db
$tbPrefix = fi_bi_tb
$mtPrefix = fi_bi_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bigint) TAGS(tgcol bigint)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,84 @@
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 ======================== dnode1 start
$dbPrefix = fi_by_db
$tbPrefix = fi_by_tb
$mtPrefix = fi_by_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol binary(10)) TAGS(tgcol binary(10))
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( '0' )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , '0' )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( '1' )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , '1' )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = '0'
if $rows != 100 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol = '1'
if $rows != 75 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' group by tgcol -x step13
return -1
step13:
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol -x step14
return -1
step14:
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' interval(1d) group by tgcol -x step15
return -1
step15:
#can't filter binary fields
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,161 @@
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 ======================== dnode1 start
$dbPrefix = fi_bo_db
$tbPrefix = fi_bo_tb
$mtPrefix = fi_bo_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bool) TAGS(tgcol bool)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = true
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> true
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = false
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> false
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = true
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> true
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> false
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> false and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = true group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc
print select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,160 @@
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 ======================== dnode1 start
$dbPrefix = fi_do_db
$tbPrefix = fi_do_tb
$mtPrefix = fi_do_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol double) TAGS(tgcol double)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,160 @@
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 ======================== dnode1 start
$dbPrefix = fi_fl_db
$tbPrefix = fi_fl_tb
$mtPrefix = fi_fl_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol float) TAGS(tgcol float)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,160 @@
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 ======================== dnode1 start
$dbPrefix = fi_in_db
$tbPrefix = fi_in_tb
$mtPrefix = fi_in_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,218 @@
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 ======================== dnode1 start
$dbPrefix = fi_si_db
$tbPrefix = fi_si_tb
$mtPrefix = fi_si_mt
$rowNum = 20
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, tbcol int)
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
print =============== step2
sql select * from $tb
if $rows != $rowNum then
return -1
endi
sql select * from $tb where tbcol = 10
if $rows != 1 then
return -1
endi
if $data01 != 10 then
return -1
endi
sql select * from $tb where tbcol = 8
if $rows != 1 then
return -1
endi
if $data01 != 8 then
return -1
endi
sql select * from $tb where tbcol < 10
if $rows != 10 then
return -1
endi
if $data91 != 9 then
return -1
endi
sql select * from $tb where tbcol <= 10
if $rows != 11 then
return -1
endi
if $data81 != 8 then
return -1
endi
sql select * from $tb where tbcol > 10
if $rows != 9 then
return -1
endi
if $data81 != 19 then
return -1
endi
sql select * from $tb where tbcol > 10 order by ts asc
if $rows != 9 then
return -1
endi
if $data01 != 11 then
return -1
endi
sql select * from $tb where tbcol < 10 and tbcol > 5 order by ts desc
if $rows != 4 then
return -1
endi
if $data01 != 9 then
return -1
endi
if $data31 != 6 then
return -1
endi
sql select * from $tb where tbcol < 10 and tbcol > 5 order by ts asc
if $rows != 4 then
return -1
endi
if $data01 != 6 then
return -1
endi
if $data31 != 9 then
return -1
endi
sql select * from $tb where tbcol > 10 and tbcol < 5 order by ts asc
if $rows != 0 then
return -1
endi
print =============== step3
sql select * from $tb where ts < now + 4m
if $rows != 5 then
return -1
endi
sql select * from $tb where tbcol = 10 and ts < now + 4m
print select * from $tb where tbcol = 10 and ts < now + 4m
if $rows != 0 then
return -1
endi
sql select * from $tb where tbcol = 4 and ts < now + 4m order by ts desc
if $rows != 1 then
return -1
endi
if $data01 != 4 then
return -1
endi
sql select * from $tb where tbcol < 10 and ts < now + 4m order by ts desc
if $rows != 5 then
return -1
endi
if $data01 != 4 then
return -1
endi
sql select * from $tb where tbcol < 10 and ts > now + 4m and ts < now + 5m order by ts desc
print $rows $data00 $data01
if $rows != 1 then
return -1
endi
if $data01 != 5 then
return -1
endi
print =============== step4
sql select count(*) from $tb
if $data00 != $rowNum then
return -1
endi
sql select count(*) from $tb where tbcol = 10
if $data00 != 1 then
return -1
endi
#sql select count(*) from $tb where tbcol = 8 or tbcol = 9
#if $data00 != 2 then
# return -1
#endi
sql select count(*) from $tb where tbcol < 10
if $data00 != 10 then
return -1
endi
sql select count(*) from $tb where tbcol <= 10
if $data00 != 11 then
return -1
endi
sql select count(*) from $tb where tbcol < 10 and tbcol > 5
if $data00 != 4 then
return -1
endi
sql select count(*) from $tb where tbcol < 10 and tbcol > 5 order by ts asc -x step4
# return -1
step4:
print =============== step5
sql select count(*) from $tb where ts < now + 4m
if $data00 != 5 then
return -1
endi
#sql select count(*) from $tb where tbcol = 10 and ts < now + 4m
#if $data00 != 0 then
# return -1
#endi
sql select count(*) from $tb where tbcol = 4 and ts < now + 4m
if $data00 != 1 then
return -1
endi
sql select count(*) from $tb where tbcol < 10 and ts < now + 4m
if $data00 != 5 then
return -1
endi
sql select count(*) from $tb where tbcol < 10 and ts > now + 4m and ts < now + 5m
if $data00 != 1 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,160 @@
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 ======================== dnode1 start
$dbPrefix = fi_sm_db
$tbPrefix = fi_sm_tb
$mtPrefix = fi_sm_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol smallint) TAGS(tgcol smallint)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,14 @@
run lite/field/single.sim
run lite/field/bool.sim
run lite/field/smallint.sim
run lite/field/tinyint.sim
run lite/field/int.sim
run lite/field/bigint.sim
run lite/field/float.sim
run lite/field/double.sim
run lite/field/binary.sim
run lite/field/2.sim
run lite/field/3.sim
run lite/field/4.sim
run lite/field/5.sim
run lite/field/6.sim

View File

@ -0,0 +1,161 @@
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 ======================== dnode1 start
$dbPrefix = fi_ti_db
$tbPrefix = fi_ti_tb
$mtPrefix = fi_ti_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol tinyint) TAGS(tgcol tinyint)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi

View File

@ -0,0 +1,329 @@
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"os"
"sync"
"sync/atomic"
"time"
"flag"
)
var (
token string
url string
config Config
request int64
period int64
errorNum int64
)
type Config struct {
HostIp string `json:"hostIp"`
ConnNum int `json:"connNum"`
InsertModel string `json:"insertModel"`
WaitTime int `json:"waitTime"`
TableDesc string `json:"tableDesc"`
TablePrefix string `json:"tablePrefix"`
TablePerConn int `json:"tablePerConn"`
TableCreate bool `json:"tableCreate"`
TableStart int `json:"tableStart"`
DbName string `json:"dbName"`
DbReplica int `json:"dbReplica"`
DbKeep int `json:"dbKeep"`
DbDays int `json:"dbDays"`
MetricsName string `json:"metricsName"`
TagNum int `json:"tagNum"`
DataNum int `json:"dataNum"`
DataBegin int64 `json:"dataBegin"`
DataInterval int `json:"dataInterval"`
DataBatch int `json:"dataBatch"`
DataInsert bool `json:"dataInsert"`
DataRandom bool `json:"dataRandom"`
}
type TokenResult struct {
Status string `json:"status"`
Code int `json:"code"`
Desc string `json:"desc"`
}
type JsonResult struct {
Status string `json:"status"`
Code int `json:"code"`
}
func readFile(filename string) {
file, err := os.Open(filename)
if err != nil {
println("taos_cloud.json not found")
panic(err)
}
defer file.Close()
dec := json.NewDecoder(file)
err = dec.Decode(&config)
if err != nil {
println("taos_cloud.json parse error")
panic(err)
}
if config.TagNum <= 0 {
config.TagNum = 1
}
request = 0
period = 0
errorNum = 0
fmt.Println("================config parameters======================")
fmt.Println("HostIp:", config.HostIp)
fmt.Println("connNum:", config.ConnNum)
fmt.Println("insertModel:", config.InsertModel)
fmt.Println("waitTime:", config.WaitTime)
fmt.Println("tableDesc:", config.TableDesc)
fmt.Println("tablePrefix:", config.TablePrefix)
fmt.Println("tablePerConn:", config.TablePerConn)
fmt.Println("tableCreate:", config.TableCreate)
fmt.Println("tableStart:", config.TableStart)
fmt.Println("dbName:", config.DbName)
fmt.Println("dbReplica:", config.DbReplica)
fmt.Println("dbKeep:", config.DbKeep)
fmt.Println("dbDays:", config.DbDays)
fmt.Println("metricsName:", config.MetricsName)
fmt.Println("tagNum:", config.TagNum)
fmt.Println("dataNum:", config.DataNum)
fmt.Println("dataBegin:", config.DataBegin)
fmt.Println("dataInterval:", config.DataInterval)
fmt.Println("dataBatch:", config.DataBatch)
fmt.Println("dataInsert:", config.DataInsert)
fmt.Println("dataRandom:", config.DataRandom)
fmt.Println("================http token=============================")
token, err = getToken()
url = fmt.Sprintf("http://%s:%d/rest/sql", config.HostIp, 6020)
fmt.Println("httpToken:", token)
fmt.Println("httpUrl:", url)
if err != nil {
panic(err)
}
}
func getToken() (string, error) {
resp, err := http.Get(fmt.Sprintf("http://%s:%d/rest/login/%s/%s", config.HostIp, 6020, "root", "taosdata"))
if err != nil {
return "", err
}
defer resp.Body.Close()
var tokenResult TokenResult
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
err = json.Unmarshal(data, &tokenResult)
if err != nil {
return "", err
}
if tokenResult.Status != "succ" {
fmt.Println("get http token failed")
fmt.Println(tokenResult)
return "", err
}
return tokenResult.Desc, nil
}
func exec(client *http.Client, sql string) {
for times := 0; times < 10; times++ {
req, err1 := http.NewRequest("POST", url, bytes.NewReader([]byte(sql)))
if err1 != nil {
continue
}
req.Header.Add("Authorization", "Taosd "+token)
begin := time.Now()
resp, err := client.Do(req)
if err != nil {
continue
}
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
resp.Body.Close()
continue
}
spend := (time.Since(begin).Nanoseconds())
var jsonResult JsonResult
err = json.Unmarshal(data, &jsonResult)
if err != nil {
resp.Body.Close()
continue
}
if jsonResult.Status != "succ" {
resp.Body.Close()
continue
}
atomic.AddInt64(&request, 1)
if (request < 103) {
return
}
atomic.AddInt64(&period, spend)
if request%5000 == 0 && request != 0 {
requestAvg := float64(period) / float64(1000000) / float64(request)
qps := float64(1000) / float64(requestAvg) * float64(config.ConnNum)
dps := qps * float64(config.DataBatch)
fmt.Println("====== req:", request, ", error:", errorNum, ", qps:", int64(qps), ", wait:", int64(requestAvg), "ms", ", data per second:", int64(dps))
}
return
}
fmt.Println("xxxx>sql:", sql, ", retryTimes:", 10)
errorNum++
}
func insertTable(conn int) {
client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart
tmStart := config.DataBegin
for j := 0; j < config.DataNum; j++ {
for i := 0; i < config.TablePerConn; i++ {
tmVal := int64(j)*int64(config.DataInterval) + tmStart + 1
tbIndex := i + tbStart
dataVal := j
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql := fmt.Sprintf("import into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal)
exec(client, sql)
time.Sleep(time.Millisecond * time.Duration(10))
}
}
}
func insertLoop(conn int) {
client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart
tmStart := config.DataBegin
for j := 0; j < config.DataNum; j++ {
for i := 0; i < config.TablePerConn; i++ {
tbIndex := i + tbStart
tmVal := int64(j)*int64(config.DataInterval) + tmStart
dataVal := j
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql := fmt.Sprintf("insert into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal)
for k := 1; k < config.DataBatch; k++ {
tmVal := int64(j)*int64(config.DataInterval) + int64(k) + tmStart
dataVal := j + k
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql += fmt.Sprintf("values(%d, %d)", tmVal, dataVal)
}
j += (config.DataBatch - 1)
exec(client, sql)
if config.WaitTime != 0 {
time.Sleep(time.Millisecond * time.Duration(config.WaitTime))
}
}
}
}
func insertTb(wg *sync.WaitGroup, conn int) {
defer wg.Done()
if !config.DataInsert {
return
}
if config.InsertModel == "insertTable" {
insertTable(conn)
} else {
insertLoop(conn)
}
}
func selectData(wg *sync.WaitGroup, conn int) {
defer wg.Done()
client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart
for j := 0; j < config.DataNum; j++ {
tbIndex := 0 + tbStart
sql := fmt.Sprintf("select max(i),min(i) from db.mt where tbname in ('%s%d'", config.TablePrefix, tbIndex)
for i := 1; i < 2000; i++ {
tbIndex := i + tbStart
sql += fmt.Sprintf(",'%s%d'", config.TablePrefix, tbIndex)
}
sql += ") group by orgno"
//sql := fmt.Sprintf("select count(*) from db.mt")
//sql := fmt.Sprintf("select max(i),min(i) from db.mt", config.TablePrefix, tbIndex)
exec(client, sql)
time.Sleep(time.Millisecond * time.Duration(10))
}
}
func main() {
filename := flag.String("config", "taos_cloud.json", "config file name")
flag.Parse()
readFile(*filename)
fmt.Println("\n================http test start======================")
var wg sync.WaitGroup
fmt.Println("\n================select data ========================")
for i := 0; i < config.ConnNum; i++ {
wg.Add(1)
go insertTb(&wg, i)
}
for i := 0; i < config.ConnNum; i++ {
wg.Add(1)
go selectData(&wg, i)
}
wg.Wait()
fmt.Println("\n================http test stop ======================")
}

View File

@ -0,0 +1,182 @@
system sh/stop_dnodes.sh
sleep 5000
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 adminRowLimit -v 10
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
print =============== step1 - prepare data
sql create database d1
sql use d1
sql create table table_gc (ts timestamp, db binary(10), tb binary(20), col binary(20))
sql create table m1 (ts timestamp, v1 int, v2 float)
sql create table m2 (ts timestamp, v1 int, v2 float)
sql insert into table_gc values('2017-12-25 21:28:41.022', 'd1', 'm1', 'v1')
sql insert into table_gc values('2017-12-25 21:28:42.022', 'd1', 'm1', 'v2')
sql insert into table_gc values('2017-12-25 21:28:43.022', 'd1', 'm2', 'v1')
sql insert into table_gc values('2017-12-25 21:28:44.022', 'd1', 'm2', 'v2')
sql insert into m1 values(1514208523020, 1, 4.1)
sql insert into m1 values(1514208523021, 2, 5.1)
sql insert into m1 values(1514208523022, 3, 6.1)
sql insert into m2 values(1514208523024, 3, 6.1)
sql insert into m2 values(1514208523025, 2, 5.1)
sql insert into m2 values(1514208523026, 1, 4.1)
sql create table mt (ts timestamp, i int) tags(a int, b binary(10))
sql create table t1 using mt tags (1, 'a')
sql create table t2 using mt tags (2, 'b')
sql create table t3 using mt tags (3, 'c')
sql insert into t1 values('2017-12-25 21:25:41', 1)
sql insert into t1 values('2017-12-25 21:26:41', 1)
sql insert into t1 values('2017-12-25 21:27:41', 1)
sql insert into t1 values('2017-12-25 21:28:41', 1)
sql insert into t1 values('2017-12-25 21:29:41', 1)
sql insert into t2 values('2017-12-25 21:25:41', 2)
sql insert into t2 values('2017-12-25 21:26:41', 2)
sql insert into t2 values('2017-12-25 21:27:41', 2)
sql insert into t2 values('2017-12-25 21:28:41', 2)
sql insert into t3 values('2017-12-25 21:25:41', 3)
sql insert into t3 values('2017-12-25 21:26:41', 3)
sql insert into t3 values('2017-12-25 21:27:41', 3)
print =============== step2 - login
system_content curl 192.168.0.1:6020/grafana/
print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/grafana/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/grafana/login/xx/xx/
print 3-> $system_content
if $system_content != @{"status":"error","code":35,"desc":"invalid user name"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/grafana/root/1/123/1/1/3
print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 192.168.0.1:6020/grafana/login/1/root/1/
print 5-> $system_content
if $system_content != @{"status":"error","code":35,"desc":"invalid user name"}@ then
return -1
endi
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/grafana/root/1/login
print 6-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
return -1
endi
system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/grafana/root/1/login
print 7-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
return -1
endi
sleep 3000
system_content curl 192.168.0.1:6020/grafana/login/root/taosdata
print 8-> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
return -1
endi
print =============== step3 - heartbeat
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/grafana/d1/table_gc
print 9-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1
endi
print =============== step4 - search
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/grafana/heartbeat
print 10-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/grafana/d1/table_invalid/search
print 11-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1
endi
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' 127.0.0.1:6020/grafana/d1/m1/search
print 12-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1
endi
print =============== step5 - query
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"taosd","sql":"select first(v1) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"},{"refId":"B","alias":"system","sql":"select first(v2) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"}]' 127.0.0.1:6020/grafana/query
print 13-> $system_content
if $system_content != @[{"refId":"A","target":"taosd","datapoints":[[2,1514208480000]]},{"refId":"B","target":"system","datapoints":[[5.10000,1514208480000]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select first(v1) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"},{"refId":"B","alias":"","sql":"select first(v2) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"}]' 127.0.0.1:6020/grafana/query
print 14-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[2,1514208480000]]},{"refId":"B","target":"B","datapoints":[[5.10000,1514208480000]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query
print 15-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[3,"-"]]},{"refId":"B","target":"B","datapoints":[[3,"-"]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query
print 15-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[3,"-"]]},{"refId":"B","target":"B","datapoints":[[3,"-"]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query
print 16-> $system_content
if $system_content != @[{"refId":"A","target":"1","datapoints":[[5,"-"]]},{"refId":"A","target":"2","datapoints":[[4,"-"]]},{"refId":"A","target":"3","datapoints":[[3,"-"]]},{"refId":"B","target":"a","datapoints":[[5,"-"]]},{"refId":"B","target":"b","datapoints":[[8,"-"]]},{"refId":"B","target":"c","datapoints":[[9,"-"]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"sum-","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query
print 17-> $system_content
if $system_content != @[{"refId":"A","target":"count1","datapoints":[[5,"-"]]},{"refId":"A","target":"count2","datapoints":[[4,"-"]]},{"refId":"A","target":"count3","datapoints":[[3,"-"]]},{"refId":"B","target":"sum-a","datapoints":[[5,"-"]]},{"refId":"B","target":"sum-b","datapoints":[[8,"-"]]},{"refId":"B","target":"sum-c","datapoints":[[9,"-"]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt interval(1m) group by a "}]' 127.0.0.1:6020/grafana/query
print 18-> $system_content
if $system_content != @[{"refId":"A","target":"count1","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000],[1,1514208540000]]},{"refId":"A","target":"count2","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000]]},{"refId":"A","target":"count3","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select sum(v2), count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2), sum(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query
print 19-> $system_content
if $system_content != @[{"refId":"A","target":"3","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"15.299999714","datapoints":[[3,"-"]]}]@ then
return -1
endi

View File

@ -0,0 +1,239 @@
system sh/stop_dnodes.sh
sleep 2000
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 adminRowLimit -v 10
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
system sh/exec.sh -n dnode1 -s start
sql connect
sleep 3000
print ============================ dnode1 start
print =============== step0 - prepare data
sql create database db
sql use db
sql create table tb (ts timestamp, val int, val1 int, val2 int)
sql create table tb2 (ts timestamp, val int, val1 int, val2 int)
sql create table t2 (ts timestamp, val int)
sql insert into tb values('2020-01-01 00:00:00.000', 1, 11, 21)
sql insert into tb values('2020-01-02 00:00:00.000', 1, 12, 22)
sql insert into tb values('2020-01-03 00:00:00.000', 2, 13, 23)
sql insert into tb values('2020-01-04 00:00:00.000', 2, 14, 24)
sql insert into tb2 values('2020-01-01 00:00:00.000', 21, 211, 221)
sql insert into tb2 values('2020-01-02 00:00:00.000', 21, 212, 222)
sql insert into tb2 values('2020-01-03 00:00:00.000', 22, 213, 223)
sql insert into tb2 values('2020-01-04 00:00:00.000', 22, 214, 224)
print =============== step1 - one query, 1 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then
return -1
endi
print =============== step2 - one query, 2 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step2-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
return -1
endi
print =============== step3 - one query, 3 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step3.1-> $system_content
if $system_content != @[{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb "} ]' 127.0.0.1:6020/grafana/query
print step3.2-> $system_content
if $system_content != @[{"refId":"A","target":"11","datapoints":[[1,1577808000000]]},{"refId":"A","target":"12","datapoints":[[1,1577894400000]]},{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query
print step3.3-> $system_content
if $system_content != @[{"refId":"A","target":"1","datapoints":[[11,1577808000000],[12,1577894400000]]},{"refId":"A","target":"2","datapoints":[[13,1577980800000],[14,1578067200000]]}]@ then
return -1
endi
print =============== step4 - one query, 4 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val2,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query
print step4.1-> $system_content
if $system_content != @[{"refId":"A","target":"1","datapoints":[[21,1577808000000],[22,1577894400000]]},{"refId":"A","target":"2","datapoints":[[23,1577980800000],[24,1578067200000]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1,val2 from db.tb "} ]' 127.0.0.1:6020/grafana/query
print step4.2-> $system_content
if $system_content != @[{"refId":"A","target":"21","datapoints":[[1,1577808000000]]},{"refId":"A","target":"22","datapoints":[[1,1577894400000]]},{"refId":"A","target":"23","datapoints":[[2,1577980800000]]},{"refId":"A","target":"24","datapoints":[[2,1578067200000]]}]@ then
return -1
endi
print =============== step5 - one query, 1 column, no timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[2,"-"],[2,"-"]]}]@ then
return -1
endi
print =============== step6 - one query, 2 column, no timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"A","target":"23","datapoints":[[13,"-"]]},{"refId":"A","target":"24","datapoints":[[14,"-"]]}]@ then
return -1
endi
print =============== step7 - one query, 3 column, no timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"A","target":"2","datapoints":[[13,"-"],[14,"-"]]}]@ then
return -1
endi
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb"} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"A","target":"1","datapoints":[[11,"-"],[12,"-"]]},{"refId":"A","target":"2","datapoints":[[13,"-"],[14,"-"]]}]@ then
return -1
endi
print =============== step8 - one query, no return
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb where ts >= 1677980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[]@ then
return -1
endi
print =============== step9 - one query, insert sql
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"insert into db.t2 values(now, 1) "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[]@ then
return -1
endi
print =============== step10 - one query, error sql
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select * from db.tt "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[]@ then
return -1
endi
print =============== step11 - two query, 1 column, with timestamp, 1 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"A","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then
return -1
endi
print =============== step12 - two query, 1 column, with timestamp, 2 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"A","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
return -1
endi
print =============== step13 - two query, 1 column, with timestamp, 3 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then
return -1
endi
print =============== step14 - two query, 2 column, with timestamp, 2 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[223,1577980800000],[224,1578067200000]]},{"refId":"A","target":"AA","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
return -1
endi
print =============== step15 - two query, 2 column, with timestamp, 3 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB213","datapoints":[[223,1577980800000]]},{"refId":"B","target":"BB214","datapoints":[[224,1578067200000]]},{"refId":"A","target":"AA","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
return -1
endi
print =============== step16 - two query, 3 column, with timestamp, 4 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val, val1, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB213","datapoints":[[22,1577980800000]]},{"refId":"B","target":"BB214","datapoints":[[22,1578067200000]]},{"refId":"A","target":"AA13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"AA14","datapoints":[[2,1578067200000]]}]@ then
return -1
endi
print =============== step17 - two query, 2 column, with timestamp, no return
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val from db.tb where ts >= 1677980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,1577980800000],[22,1578067200000]]}]@ then
return -1
endi
print =============== step18 - two query, 2 column, with timestamp, invalid sql
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val from db.tb222 where ts >= 1677980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,1577980800000],[22,1578067200000]]}]@ then
return -1
endi
print =============== step19 - two query, 2 column, with timestamp, insert sql
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"insert into db.t2 values(now, 1)"} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,1577980800000],[22,1578067200000]]}]@ then
return -1
endi
print =============== step20 - two query, 1 column, no timestamp, 1 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then
return -1
endi
print =============== step21 - two query, 1 column, no timestamp, 2 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA","datapoints":[[223,1577980800000],[224,1578067200000]]}]@ then
return -1
endi
print =============== step22 - two query, 1 column, no timestamp, 3 column, with timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val1, val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA223","datapoints":[[213,1577980800000]]},{"refId":"A","target":"AA224","datapoints":[[214,1578067200000]]}]@ then
return -1
endi
print =============== step23 - two query, 2 column, no timestamp, 1 column, no timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA","datapoints":[[213,"-"],[214,"-"]]}]@ then
return -1
endi
print =============== step24 - two query, 2 column, no timestamp, 2 column, no timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA213","datapoints":[[22,"-"]]},{"refId":"A","target":"AA214","datapoints":[[22,"-"]]}]@ then
return -1
endi
print =============== step25 - two query, 2 column, no timestamp, 3 column, no timestamp
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1,val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
print step1-> $system_content
if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA223","datapoints":[[22,"-"]]},{"refId":"A","target":"AA224","datapoints":[[22,"-"]]}]@ then
return -1
endi

View File

@ -0,0 +1,23 @@
{
"hostIp": "192.168.100.128",
"connNum": 1,
"insertModel": "insertTable",
"waitTime": 0,
"tableDesc": "ts timestamp i int",
"tablePrefix": "t",
"tablePerConn": 1,
"tableCreate": true,
"tableStart": 1,
"dbName": "db",
"dbReplica": 1,
"dbKeep": 3650,
"dbDays": 7,
"metricsName": "mt",
"tagNum": 10,
"dataNum": 100,
"dataBegin": 1485878400000,
"dataInterval": 1000,
"dataBatch": 1,
"dataInsert": true,
"dataRandom": false
}

View File

@ -0,0 +1,232 @@
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"os"
"sync"
"sync/atomic"
"time"
)
var (
token string
url string
config Config
request int64
begin time.Time
errorNum int64
)
type Config struct {
HostIp string `json:"hostIp"`
TableNum int `json:"tableNum"`
DbName string `json:"dbName"`
MetricsName string `json:"metricsName"`
DataNum int `json:"dataNum"`
BatchNum int `json:"batchNum"`
}
type TokenResult struct {
Status string `json:"status"`
Code int `json:"code"`
Desc string `json:"desc"`
}
type JsonResult struct {
Status string `json:"status"`
Code int `json:"code"`
}
func readFile(filename string) {
file, err := os.Open(filename)
if err != nil {
println("taos.json not found")
panic(err)
}
defer file.Close()
dec := json.NewDecoder(file)
err = dec.Decode(&config)
if err != nil {
println("taos.json parse error")
panic(err)
}
request = 0
errorNum = 0
fmt.Println("================config parameters======================")
fmt.Println("HostIp:", config.HostIp)
fmt.Println("TableNum:", config.TableNum)
fmt.Println("dbName:", config.DbName)
fmt.Println("metricsName:", config.MetricsName)
fmt.Println("dataNum:", config.DataNum)
fmt.Println("batchNum:", config.BatchNum)
fmt.Println("================http token=============================")
token, err = getToken()
url = fmt.Sprintf("http://%s:%d/rest/sql", config.HostIp, 6020)
fmt.Println("httpToken:", token)
fmt.Println("httpUrl:", url)
if err != nil {
panic(err)
}
}
func getToken() (string, error) {
resp, err := http.Get(fmt.Sprintf("http://%s:%d/rest/login/%s/%s", config.HostIp, 6020, "root", "taosdata"))
if err != nil {
return "", err
}
defer resp.Body.Close()
var tokenResult TokenResult
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
err = json.Unmarshal(data, &tokenResult)
if err != nil {
return "", err
}
if tokenResult.Status != "succ" {
fmt.Println("get http token failed")
fmt.Println(tokenResult)
return "", err
}
return tokenResult.Desc, nil
}
func exec(client *http.Client, sql string) {
for reTryTimes := 0; reTryTimes < 10; reTryTimes++ {
req, err1 := http.NewRequest("POST", url, bytes.NewReader([]byte(sql)))
if err1 != nil {
continue
}
req.Header.Add("Authorization", "Taosd "+token)
resp, err := client.Do(req)
if err != nil {
continue
}
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
resp.Body.Close()
continue
}
var jsonResult JsonResult
err = json.Unmarshal(data, &jsonResult)
if err != nil {
resp.Body.Close()
continue
}
if jsonResult.Status != "succ" {
resp.Body.Close()
continue
}
atomic.AddInt64(&request, 1)
if (request*int64(config.BatchNum))%100000 == 0 && request != 0 {
spend := time.Since(begin).Seconds()
if spend >= 1 && spend < 10000000 {
total := (request - errorNum - 2 - int64(config.TableNum)) * int64(config.BatchNum)
fmt.Printf("request:%d, error:%d, insert:%d, spend:%.2f seconds, dps:%.1f \n", request, errorNum, total, spend, float64(total)/float64(spend))
}
}
return
}
//fmt.Println("exec failed, sql:", sql)
errorNum++
}
func createDb() {
fmt.Println("================create database =====================")
client := &http.Client{}
sql := fmt.Sprintf("create database %s", config.DbName)
exec(client, sql)
}
func createTb() {
fmt.Println("================create table ========================")
client := &http.Client{}
sql := fmt.Sprintf("create table %s.%s(ts timestamp, f1 int, f2 int) tags (tb int)", config.DbName, config.MetricsName)
exec(client, sql)
for i := 0; i < config.TableNum; i++ {
sql := fmt.Sprintf("create table %s.t%d using %s.%s tags(%d)", config.DbName, i, config.DbName, config.MetricsName, i)
exec(client, sql)
}
}
func insertData(wg *sync.WaitGroup, tableIndex int) {
defer wg.Done()
client := &http.Client{}
beginTime := int64(1519833600000)
for i := 0; i < config.DataNum; i += config.BatchNum {
var sql bytes.Buffer
sql.WriteString(fmt.Sprintf("insert into %s.t%d values", config.DbName, tableIndex))
for j := 0; j < config.BatchNum; j++ {
sql.WriteString(fmt.Sprintf("(%d,%d,%d)", beginTime+int64(i)+int64(j), rand.Intn(1000), rand.Intn(1000)))
}
exec(client, sql.String())
}
}
func main() {
filename := flag.String("config", "http.json", "config file name")
flag.Parse()
readFile(*filename)
fmt.Println("\n================http test start======================")
createDb()
createTb()
begin = time.Now()
var wg sync.WaitGroup
fmt.Println("================insert data ========================")
for i := 0; i < config.TableNum; i++ {
wg.Add(1)
go insertData(&wg, i)
}
wg.Wait()
fmt.Println("\n================http test stop ======================")
spend := time.Since(begin).Seconds()
total := (request - errorNum - 2 - int64(config.TableNum)) * int64(config.BatchNum)
fmt.Printf("request:%d, error:%d, insert:%d, spend:%.2f seconds, dps:%.1f \n", request, errorNum, total, spend, float64(total)/float64(spend))
}

View File

@ -0,0 +1,372 @@
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"os"
"sync"
"sync/atomic"
"time"
"flag"
)
var (
token string
url string
config Config
request int64
period int64
errorNum int64
)
type Config struct {
HostIp string `json:"hostIp"`
ConnNum int `json:"connNum"`
InsertModel string `json:"insertModel"`
WaitTime int `json:"waitTime"`
TableDesc string `json:"tableDesc"`
TablePrefix string `json:"tablePrefix"`
TablePerConn int `json:"tablePerConn"`
TableCreate bool `json:"tableCreate"`
TableStart int `json:"tableStart"`
DbName string `json:"dbName"`
DbReplica int `json:"dbReplica"`
DbKeep int `json:"dbKeep"`
DbDays int `json:"dbDays"`
MetricsName string `json:"metricsName"`
TagNum int `json:"tagNum"`
DataNum int `json:"dataNum"`
DataBegin int64 `json:"dataBegin"`
DataInterval int `json:"dataInterval"`
DataBatch int `json:"dataBatch"`
DataInsert bool `json:"dataInsert"`
DataRandom bool `json:"dataRandom"`
}
type TokenResult struct {
Status string `json:"status"`
Code int `json:"code"`
Desc string `json:"desc"`
}
type JsonResult struct {
Status string `json:"status"`
Code int `json:"code"`
}
func readFile(filename string) {
file, err := os.Open(filename)
if err != nil {
println("taos_cloud.json not found")
panic(err)
}
defer file.Close()
dec := json.NewDecoder(file)
err = dec.Decode(&config)
if err != nil {
println("taos_cloud.json parse error")
panic(err)
}
if config.TagNum <= 0 {
config.TagNum = 1
}
request = 0
period = 0
errorNum = 0
fmt.Println("================config parameters======================")
fmt.Println("HostIp:", config.HostIp)
fmt.Println("connNum:", config.ConnNum)
fmt.Println("insertModel:", config.InsertModel)
fmt.Println("waitTime:", config.WaitTime)
fmt.Println("tableDesc:", config.TableDesc)
fmt.Println("tablePrefix:", config.TablePrefix)
fmt.Println("tablePerConn:", config.TablePerConn)
fmt.Println("tableCreate:", config.TableCreate)
fmt.Println("tableStart:", config.TableStart)
fmt.Println("dbName:", config.DbName)
fmt.Println("dbReplica:", config.DbReplica)
fmt.Println("dbKeep:", config.DbKeep)
fmt.Println("dbDays:", config.DbDays)
fmt.Println("metricsName:", config.MetricsName)
fmt.Println("tagNum:", config.TagNum)
fmt.Println("dataNum:", config.DataNum)
fmt.Println("dataBegin:", config.DataBegin)
fmt.Println("dataInterval:", config.DataInterval)
fmt.Println("dataBatch:", config.DataBatch)
fmt.Println("dataInsert:", config.DataInsert)
fmt.Println("dataRandom:", config.DataRandom)
fmt.Println("================http token=============================")
token, err = getToken()
url = fmt.Sprintf("http://%s:%d/rest/sql", config.HostIp, 6020)
fmt.Println("httpToken:", token)
fmt.Println("httpUrl:", url)
if err != nil {
panic(err)
}
}
func getToken() (string, error) {
resp, err := http.Get(fmt.Sprintf("http://%s:%d/rest/login/%s/%s", config.HostIp, 6020, "tiger", "tiger"))
if err != nil {
return "", err
}
defer resp.Body.Close()
var tokenResult TokenResult
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
err = json.Unmarshal(data, &tokenResult)
if err != nil {
return "", err
}
if tokenResult.Status != "succ" {
fmt.Println("get http token failed")
fmt.Println(tokenResult)
return "", err
}
return tokenResult.Desc, nil
}
func exec(client *http.Client, sql string) {
for times := 0; times < 10; times++ {
req, err1 := http.NewRequest("POST", url, bytes.NewReader([]byte(sql)))
if err1 != nil {
continue
}
req.Header.Add("Authorization", "Taosd "+token)
begin := time.Now()
resp, err := client.Do(req)
if err != nil {
continue
}
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
resp.Body.Close()
continue
}
spend := (time.Since(begin).Nanoseconds())
var jsonResult JsonResult
err = json.Unmarshal(data, &jsonResult)
if err != nil {
resp.Body.Close()
continue
}
if jsonResult.Status != "succ" {
resp.Body.Close()
continue
}
atomic.AddInt64(&request, 1)
if (request < 103) {
return
}
atomic.AddInt64(&period, spend)
if request%5000 == 0 && request != 0 {
requestAvg := float64(period) / float64(1000000) / float64(request)
qps := float64(1000) / float64(requestAvg) * float64(config.ConnNum)
dps := qps * float64(config.DataBatch)
fmt.Println("====== req:", request, ", error:", errorNum, ", qps:", int64(qps), ", wait:", int64(requestAvg), "ms", ", data per second:", int64(dps))
}
return
}
fmt.Println("xxxx>sql:", sql, ", retryTimes:", 10)
errorNum++
}
func createDb() {
if !config.TableCreate {
return
}
client := &http.Client{}
fmt.Println("\n================create database =====================")
sql := fmt.Sprintf("create database %s keep %d", config.DbName, config.DbKeep)
exec(client, sql)
}
func createTb() {
if !config.TableCreate {
return
}
client := &http.Client{}
fmt.Println("\n================create table ========================")
sql := fmt.Sprintf("create table %s.%s(%s) tags (orgno int)", config.DbName, config.MetricsName, config.TableDesc)
exec(client, sql)
tbNum := config.TablePerConn*config.ConnNum + config.TableStart
for i := config.TableStart; i < tbNum; i++ {
sql := fmt.Sprintf("create table %s.%s%d using %s.%s tags(%d)", config.DbName, config.TablePrefix, i, config.DbName, config.MetricsName, i%config.TagNum+1)
exec(client, sql)
}
}
func insertTable(conn int) {
client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart
tmStart := config.DataBegin
for i := 0; i < config.TablePerConn; i++ {
tbIndex := i + tbStart
for j := 0; j < config.DataNum; j++ {
tmVal := int64(j)*int64(config.DataInterval) + tmStart
dataVal := j
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql := fmt.Sprintf("insert into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal)
for k := 1; k < config.DataBatch; k++ {
tmVal := int64(j)*int64(config.DataInterval) + int64(k) + tmStart
dataVal := j + k
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql += fmt.Sprintf("(%d, %d)", tmVal, dataVal)
}
j += (config.DataBatch - 1)
exec(client, sql)
if config.WaitTime != 0 {
time.Sleep(time.Millisecond * time.Duration(config.WaitTime))
}
}
}
}
func insertLoop(conn int) {
client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart
tmStart := config.DataBegin
for j := 0; j < config.DataNum; j++ {
for i := 0; i < config.TablePerConn; i++ {
tbIndex := i + tbStart
tmVal := int64(j)*int64(config.DataInterval) + tmStart
dataVal := j
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql := fmt.Sprintf("insert into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal)
for k := 1; k < config.DataBatch; k++ {
tmVal := int64(j)*int64(config.DataInterval) + int64(k) + tmStart
dataVal := j + k
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql += fmt.Sprintf("values(%d, %d)", tmVal, dataVal)
}
j += (config.DataBatch - 1)
exec(client, sql)
if config.WaitTime != 0 {
time.Sleep(time.Millisecond * time.Duration(config.WaitTime))
}
}
}
}
func insertTb(wg *sync.WaitGroup, conn int) {
defer wg.Done()
if !config.DataInsert {
return
}
if config.InsertModel == "insertTable" {
insertTable(conn)
} else {
insertLoop(conn)
}
}
func selectData(wg *sync.WaitGroup, conn int) {
defer wg.Done()
client := &http.Client{}
for i := 0; i < config.DataNum; i++ {
exec(client, config.TableDesc)
}
}
func main() {
filename := flag.String("config", "taos_cloud.json", "config file name")
flag.Parse()
readFile(*filename)
fmt.Println("\n================http test start======================")
var wg sync.WaitGroup
if config.InsertModel == "selectData" {
fmt.Println("\n================select data ========================")
for i := 0; i < config.ConnNum; i++ {
wg.Add(1)
go selectData(&wg, i)
}
} else {
createDb()
createTb()
if config.DataInsert {
fmt.Println("\n================insert data ========================")
}
for i := 0; i < config.ConnNum; i++ {
wg.Add(1)
go insertTb(&wg, i)
}
}
wg.Wait()
fmt.Println("\n================http test stop ======================")
requestAvg := float64(period) / float64(1000000) / float64(request)
qps := float64(1000) / float64(requestAvg) * float64(config.ConnNum)
dps := qps * float64(config.DataBatch)
fmt.Println("====== req:", request, ", error:", errorNum, ", qps:", int64(qps), ", wait:", int64(requestAvg), "ms", ", data per second:", int64(dps))
}

View File

@ -0,0 +1,372 @@
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"os"
"sync"
"sync/atomic"
"time"
"flag"
)
var (
token string
url string
config Config
request int64
period int64
errorNum int64
)
type Config struct {
HostIp string `json:"hostIp"`
ConnNum int `json:"connNum"`
InsertModel string `json:"insertModel"`
WaitTime int `json:"waitTime"`
TableDesc string `json:"tableDesc"`
TablePrefix string `json:"tablePrefix"`
TablePerConn int `json:"tablePerConn"`
TableCreate bool `json:"tableCreate"`
TableStart int `json:"tableStart"`
DbName string `json:"dbName"`
DbReplica int `json:"dbReplica"`
DbKeep int `json:"dbKeep"`
DbDays int `json:"dbDays"`
MetricsName string `json:"metricsName"`
TagNum int `json:"tagNum"`
DataNum int `json:"dataNum"`
DataBegin int64 `json:"dataBegin"`
DataInterval int `json:"dataInterval"`
DataBatch int `json:"dataBatch"`
DataInsert bool `json:"dataInsert"`
DataRandom bool `json:"dataRandom"`
}
type TokenResult struct {
Status string `json:"status"`
Code int `json:"code"`
Desc string `json:"desc"`
}
type JsonResult struct {
Status string `json:"status"`
Code int `json:"code"`
}
func readFile(filename string) {
file, err := os.Open(filename)
if err != nil {
println("taos_cloud.json not found")
panic(err)
}
defer file.Close()
dec := json.NewDecoder(file)
err = dec.Decode(&config)
if err != nil {
println("taos_cloud.json parse error")
panic(err)
}
if config.TagNum <= 0 {
config.TagNum = 1
}
request = 0
period = 0
errorNum = 0
fmt.Println("================config parameters======================")
fmt.Println("HostIp:", config.HostIp)
fmt.Println("connNum:", config.ConnNum)
fmt.Println("insertModel:", config.InsertModel)
fmt.Println("waitTime:", config.WaitTime)
fmt.Println("tableDesc:", config.TableDesc)
fmt.Println("tablePrefix:", config.TablePrefix)
fmt.Println("tablePerConn:", config.TablePerConn)
fmt.Println("tableCreate:", config.TableCreate)
fmt.Println("tableStart:", config.TableStart)
fmt.Println("dbName:", config.DbName)
fmt.Println("dbReplica:", config.DbReplica)
fmt.Println("dbKeep:", config.DbKeep)
fmt.Println("dbDays:", config.DbDays)
fmt.Println("metricsName:", config.MetricsName)
fmt.Println("tagNum:", config.TagNum)
fmt.Println("dataNum:", config.DataNum)
fmt.Println("dataBegin:", config.DataBegin)
fmt.Println("dataInterval:", config.DataInterval)
fmt.Println("dataBatch:", config.DataBatch)
fmt.Println("dataInsert:", config.DataInsert)
fmt.Println("dataRandom:", config.DataRandom)
fmt.Println("================http token=============================")
token, err = getToken()
url = fmt.Sprintf("http://%s:%d/rest/sql", config.HostIp, 6020)
fmt.Println("httpToken:", token)
fmt.Println("httpUrl:", url)
if err != nil {
panic(err)
}
}
func getToken() (string, error) {
resp, err := http.Get(fmt.Sprintf("http://%s:%d/rest/login/%s/%s", config.HostIp, 6020, "root", "taosdata"))
if err != nil {
return "", err
}
defer resp.Body.Close()
var tokenResult TokenResult
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
err = json.Unmarshal(data, &tokenResult)
if err != nil {
return "", err
}
if tokenResult.Status != "succ" {
fmt.Println("get http token failed")
fmt.Println(tokenResult)
return "", err
}
return tokenResult.Desc, nil
}
func exec(client *http.Client, sql string) {
for times := 0; times < 1; times++ {
req, err1 := http.NewRequest("POST", url, bytes.NewReader([]byte(sql)))
if err1 != nil {
continue
}
req.Header.Add("Authorization", "Taosd "+token)
begin := time.Now()
resp, err := client.Do(req)
if err != nil {
continue
}
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
resp.Body.Close()
continue
}
spend := (time.Since(begin).Nanoseconds())
var jsonResult JsonResult
err = json.Unmarshal(data, &jsonResult)
if err != nil {
resp.Body.Close()
continue
}
if jsonResult.Status != "succ" {
resp.Body.Close()
continue
}
atomic.AddInt64(&request, 1)
if (request < 103) {
return
}
atomic.AddInt64(&period, spend)
if request%5000 == 0 && request != 0 {
requestAvg := float64(period) / float64(1000000) / float64(request)
qps := float64(1000) / float64(requestAvg) * float64(config.ConnNum)
dps := qps * float64(config.DataBatch)
fmt.Println("====== req:", request, ", error:", errorNum, ", qps:", int64(qps), ", wait:", int64(requestAvg), "ms", ", data per second:", int64(dps))
}
return
}
fmt.Println("xxxx>sql:", sql, ", retryTimes:", 10)
errorNum++
}
func createDb() {
if !config.TableCreate {
return
}
client := &http.Client{}
fmt.Println("\n================create database =====================")
sql := fmt.Sprintf("create database %s keep %d", config.DbName, config.DbKeep)
exec(client, sql)
}
func createTb() {
if !config.TableCreate {
return
}
client := &http.Client{}
fmt.Println("\n================create table ========================")
sql := fmt.Sprintf("create table %s.%s(%s) tags (orgno int)", config.DbName, config.MetricsName, config.TableDesc)
exec(client, sql)
tbNum := config.TablePerConn*config.ConnNum + config.TableStart
for i := config.TableStart; i < tbNum; i++ {
sql := fmt.Sprintf("create table %s.%s%d using %s.%s tags(%d)", config.DbName, config.TablePrefix, i, config.DbName, config.MetricsName, i%config.TagNum+1)
exec(client, sql)
}
}
func insertTable(conn int) {
client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart
tmStart := config.DataBegin
for j := 0; j < config.DataNum; j++ {
for i := 0; i < config.TablePerConn; i++ {
tbIndex := i + tbStart
tmVal := int64(j)*int64(config.DataInterval) + tmStart
dataVal := j
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql := fmt.Sprintf("insert into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal)
for k := 1; k < config.DataBatch; k++ {
tmVal := int64(j)*int64(config.DataInterval) + int64(k) + tmStart
dataVal := j + k
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql += fmt.Sprintf("(%d, %d)", tmVal, dataVal)
}
exec(client, sql)
if config.WaitTime != 0 {
time.Sleep(time.Millisecond * time.Duration(config.WaitTime))
}
}
j += (config.DataBatch - 1)
}
}
func insertLoop(conn int) {
client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart
tmStart := config.DataBegin
for j := 0; j < config.DataNum; j++ {
for i := 0; i < config.TablePerConn; i++ {
tbIndex := i + tbStart
tmVal := int64(j)*int64(config.DataInterval) + tmStart
dataVal := j
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql := fmt.Sprintf("insert into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal)
for k := 1; k < config.DataBatch; k++ {
tmVal := int64(j)*int64(config.DataInterval) + int64(k) + tmStart
dataVal := j + k
if config.DataRandom {
dataVal = rand.Intn(1000)
}
sql += fmt.Sprintf("values(%d, %d)", tmVal, dataVal)
}
j += (config.DataBatch - 1)
exec(client, sql)
if config.WaitTime != 0 {
time.Sleep(time.Millisecond * time.Duration(config.WaitTime))
}
}
}
}
func insertTb(wg *sync.WaitGroup, conn int) {
defer wg.Done()
if !config.DataInsert {
return
}
if config.InsertModel == "insertTable" {
insertTable(conn)
} else {
insertLoop(conn)
}
}
func selectData(wg *sync.WaitGroup, conn int) {
defer wg.Done()
client := &http.Client{}
for i := 0; i < config.DataNum; i++ {
exec(client, config.TableDesc)
}
}
func main() {
filename := flag.String("config", "taos_cloud.json", "config file name")
flag.Parse()
readFile(*filename)
fmt.Println("\n================http test start======================")
var wg sync.WaitGroup
if config.InsertModel == "selectData" {
fmt.Println("\n================select data ========================")
for i := 0; i < config.ConnNum; i++ {
wg.Add(1)
go selectData(&wg, i)
}
} else {
createDb()
createTb()
if config.DataInsert {
fmt.Println("\n================insert data ========================")
}
for i := 0; i < config.ConnNum; i++ {
wg.Add(1)
go insertTb(&wg, i)
}
}
wg.Wait()
fmt.Println("\n================http test stop ======================")
requestAvg := float64(period) / float64(1000000) / float64(request)
qps := float64(1000) / float64(requestAvg) * float64(config.ConnNum)
dps := qps * float64(config.DataBatch)
fmt.Println("====== req:", request, ", error:", errorNum, ", qps:", int64(qps), ", wait:", int64(requestAvg), "ms", ", data per second:", int64(dps))
}

View File

@ -0,0 +1,238 @@
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 ============================ dnode1 start
print =============== step1 - parse
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db123456789012345678901234567890db
print $system_content
if $system_content != @{"status":"error","code":1058,"desc":"database name too long"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put2
print $system_content
if $system_content != @{"status":"error","code":1009,"desc":"http url parse error"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1060,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1059,"desc":"invalid opentsdb json fromat"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1060,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1062,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": 1,"timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1063,"desc":"metric name type should be string"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1064,"desc":"metric name length is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "ab1234567890123456789012345678ab1234567890123456789012345678","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1065,"desc":"metric name length can not more than 22"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1066,"desc":"timestamp not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": "2","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1067,"desc":"timestamp type should be integer"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": -1,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1068,"desc":"timestamp value smaller than 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1078,"desc":"value not find"}@ then
return -1
endi
#######
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1069,"desc":"tags not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1070,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": 0}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1070,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","group1": "1","group1": "1","group1": "1","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1071,"desc":"tags size too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1073,"desc":"tag name is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host01123456789001123456789001123456789001123456789001123456789001123456789": "01"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1074,"desc":"tag name length too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web011234567890011234567890011234567890011234567890011234567890011234567890011234567890011234567890"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1077,"desc":"tag value can not more than 64"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": ""}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1076,"desc":"tag value is null"}@ then
return -1
endi
sleep 3000
print =============== step2 - insert single data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":1,"affected_rows":1}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":0,"status":"succ"}}],"failed":0,"success":1,"affected_rows":0}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_web01' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000]],"rows":1}@ then
return -1
endi
print =============== step3 - multi-query data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846401000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402000,"value": 18,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846401000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}},{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web02","timestamp":1346846402000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web02"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":2,"affected_rows":2}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_web01' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000],["2012-09-05 20:00:01.000",18.000000000]],"rows":2}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows":1}@ then
return -1
endi
print =============== step4 - summary-put data
system_content curl -u root:taosdata -d '[{"metric": "sys_mem","timestamp": 1346846400000,"value": 8,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_mem","timestamp": 1346846401000,"value": 9,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put?details=false
print $system_content
if $system_content != @{"failed":0,"success":2}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select * from db.sys_mem_d_bbb_lga_1_web01' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",8.000000000],["2012-09-05 20:00:01.000",9.000000000]],"rows":2}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select count(*) from db.sys_mem_d_bbb' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[2]],"rows":1}@ then
return -1
endi
print =============== step5 - prepare data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846402000,"value": 19,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402,"value": 19,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846403000,"value": 20,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846403,"value": 20,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846404000,"value": 21,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846404,"value": 21,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846405000,"value": 22,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846405,"value": 22,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846406000,"value": 23,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846406,"value": 23,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":1}@ then
return -1
endi

View File

@ -0,0 +1,54 @@
system sh/stop_dnodes.sh
sleep 5000
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 ============================ dnode1 start
print =============== step1 - prepare data
sql create database d1
sql use d1
sql create table t1 (ts timestamp, i int, b binary(100))
sql insert into t1 values('2017-12-25 21:28:41.022', 1, 11)
sql insert into t1 values('2017-12-25 21:28:42.022', 2, '22')
sql insert into t1 values('2017-12-25 21:28:43.022', 3, "33")
sql insert into t1 values('2017-12-25 21:28:44.022', 4, '44"')
sql insert into t1 values('2017-12-25 21:28:45.022', 5, "55'")
sql insert into t1 values('2017-12-25 21:28:46.022', 6, "66'6'")
sql insert into t1 values('2017-12-25 21:28:47.022', 7, '77"7"')
sql insert into t1 values('2017-12-25 21:28:48.022', 8, '88""88')
sql insert into t1 values('2017-12-25 21:28:49.022', 9, '99\99')
sql insert into t1 values('2017-12-25 21:28:51.022', 11, '11\\11')
sql insert into t1 values('2017-12-25 21:28:52.022', 12, '22\\11')
sql insert into t1 values('2017-12-25 21:28:53.022', 13, '33\\"33')
sql insert into t1 values('2017-12-25 21:28:54.022', 14, '44\\""44')
sleep 4000
print =============== step2 - login
system_content curl 127.0.0.1:6020/rest/login/root/taosdata
print curl 127.0.0.1:6020/rest/login/root/taosdata -----> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
return -1
endi
return
print =============== step3 - query data
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwia2V5IjoiYkVsOExjdkxVZDdhOHFkdE5abXRPTnJ5cDIwMW1hMDQiLCJzdWIiOiJyb290In0.k7CkgmpOJImIkLqZqzASlPmkdeEw7Wfk4XUrqGZX-LQ' -d 'select * from t1' 127.0.0.1:6020/rest/sql/d1
print curl 127.0.0.1:6020/rest/sql/d1 -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i","b"],"data":[["2017-12-25 21:28:54.022",14,"44\\\\\"\"44"],["2017-12-25 21:28:53.022",13,"33\\\\\"33"],["2017-12-25 21:28:52.022",12,"22\\\\11"],["2017-12-25 21:28:51.022",11,"11\\\\11"],["2017-12-25 21:28:49.022",9,"99\\99"],["2017-12-25 21:28:48.022",8,"88\"\"88"],["2017-12-25 21:28:47.022",7,"77\"7\""],["2017-12-25 21:28:46.022",6,"66'6'"],["2017-12-25 21:28:45.022",5,"55'"],["2017-12-25 21:28:44.022",4,"44\""],["2017-12-25 21:28:43.022",3,"33"],["2017-12-25 21:28:42.022",2,"22"],["2017-12-25 21:28:41.022",1,"11"]],"rows":13}@ then
return -1
endi

View File

@ -0,0 +1,84 @@
system sh/stop_dnodes.sh
sleep 5000
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 httpEnableRecordSql -v 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
print =============== step1 - prepare data
sql create database d1
sql use d1
sql create table table_rest (ts timestamp, i int)
sql insert into table_rest values('2017-12-25 21:28:41.022', 1)
sql insert into table_rest values('2017-12-25 21:28:42.022', 2)
sql insert into table_rest values('2017-12-25 21:28:43.022', 3)
sql insert into table_rest values('2017-12-25 21:28:44.022', 4)
sql insert into table_rest values('2017-12-25 21:28:45.022', 5)
sql insert into table_rest values('2017-12-25 21:28:46.022', 6)
sql insert into table_rest values('2017-12-25 21:28:47.022', 7)
sql insert into table_rest values('2017-12-25 21:28:48.022', 8)
sql insert into table_rest values('2017-12-25 21:28:49.022', 9)
sql insert into table_rest values('2017-12-25 21:28:50.022', 10)
print =============== step2 - login
system_content curl 127.0.0.1:6020/rest/login/root/taosdata
print curl 127.0.0.1:6020/rest/login/root/taosdata -----> $system_content
if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then
return -1
endi
print =============== step3 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest' 127.0.0.1:6020/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10]],"rows":10}@ then
return -1
endi
print =============== step4 - insert data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.table_rest values('2017-12-25 21:28:51.022', 11)" 127.0.0.1:6020/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1
endi
print =============== step5 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest' 127.0.0.1:6020/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
return -1
endi
print =============== step6 - query no db data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show dnodes' 127.0.0.1:6020/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content
print =============== step7 - change password
sql create user u1 PASS 'abcd@1234'
sql create user u2 PASS 'abcd_1234'
system_content curl 127.0.0.1:6020/rest/login/u1/abcd@1234
print curl 127.0.0.1:6020/rest/login/u1/abcd@1234 -----> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"jIlItaLFFIPa8qdtNZmtONryp201ma04SXX8PEJowKAB/46k1gwnPNryp201ma04"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/rest/login/u2/abcd_1234
print curl 127.0.0.1:6020/rest/login/u2/abcd_1234 -----> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"AZH3lNvWZiLa8qdtNZmtONryp201ma04QExCHYkbFFQB/46k1gwnPNryp201ma04"}@ then
return -1
endi

View File

@ -0,0 +1,234 @@
system sh/stop_dnodes.sh
sleep 5000
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 ============================ dnode1 start
print =============== step1 - login
system_content curl 192.168.0.1:6020/rest/
print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/rest/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/rest/login
print 3-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1
endi
#4
system_content curl 192.168.0.1:6020/rest/login/root
print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/rest/login/root/123
print 5-> $system_content
if $system_content != @{"status":"error","code":10,"desc":"authentication failure"}@ then
return -1
endi
system_content curl 192.168.0.1:6020/rest/login/root/123/1/1/3
print 6-> $system_content
if $system_content != @{"status":"error","code":10,"desc":"authentication failure"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 192.168.0.1:6020/rest/login/root/1
print 7-> $system_content
if $system_content != @{"status":"error","code":10,"desc":"authentication failure"}@ then
return -1
endi
#8
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/rest/login/root/1
print 8-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
return -1
endi
system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/rest/login/root/1
print 9-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
return -1
endi
sleep 3000
system_content curl 192.168.0.1:6020/rest/login/root/taosdata/
print 10-> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
return -1
endi
print =============== step2 - no db
#11
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 192.168.0.1:6020/rest/sql
print 11-> $system_content
if $system_content != @{"status":"succ","head":["name","created time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","tables","rows","cache(b)","ablocks","tblocks","ctime(s)","clog","comp","time precision","status"],"data":[],"rows":0}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 192.168.0.1:6020/rest/sql
print 12-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 192.168.0.1:6020/rest/sql
print 13-> $system_content
if $system_content != @{"status":"error","code":33,"desc":"DB already there"}@ then
return -1
endi
#14
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '' 192.168.0.1:6020/rest/sql
print 14-> $system_content
if $system_content != @{"status":"error","code":1012,"desc":"no sql input"}@ then
return -1
endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'use d1' 192.168.0.1:6020/rest/sql
#print 15-> $system_content
#if $system_content != @{"status":"error","code":1017,"desc":"no need to execute use db cmd"}@ then
#if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
# return -1
#endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' use d1' 192.168.0.1:6020/rest/sql
#print 16-> $system_content
#if $system_content != @{"status":"error","code":1017,"desc":"no need to execute use db cmd"}@ then
# return -1
#endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' used1' 192.168.0.1:6020/rest/sql
print 17-> $system_content
if $system_content != @{"status":"error","code":28,"desc":"invalid SQL: invalid SQL: syntax error near 'used1'"}@ then
return -1
endi
#18
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 192.168.0.1:6020/rest/sql
print 18-> $system_content
if $system_content != @{"status":"error","code":38,"desc":"DB not selected"}@ then
return -1
endi
print =============== step3 - db
#19
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 192.168.0.1:6020/rest/sql/d4
#print 19-> $system_content
#if $system_content != @{"status":"error","code":102,"desc":"invalid DB"}@ then
# return -1
#endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 192.168.0.1:6020/rest/sql/d1
#print 20-> $system_content
#if $system_content != @{"status":"succ","head":["name","created time","columns","metric"],"data":[],"rows":0}@ then
# return -1
#endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1;' 192.168.0.1:6020/rest/sql
print 21-> $system_content
if $system_content != @{"status":"error","code":32,"desc":"invalid table"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d1.t1 (ts timestamp, speed int)' 192.168.0.1:6020/rest/sql
print 22-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 192.168.0.1:6020/rest/sql
print 23-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[],"rows":0}@ then
return -1
endi
#24
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:41.022', 1)" 192.168.0.1:6020/rest/sql
print 24-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 192.168.0.1:6020/rest/sql
print 25-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
return -1
endi
#26
print 25-> no print
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:42.022', 2)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:43.022', 3)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:44.022', 4)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:45.022', 5)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:46.022', 6)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:47.022', 7)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:48.022', 8)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:49.022', 9)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:50.022', 10)" 192.168.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:51.022', 11)" 192.168.0.1:6020/rest/sql
#27
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 192.168.0.1:6020/rest/sql
print 27-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d2' 192.168.0.1:6020/rest/sql
print 28-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d2.t1 (ts timestamp, speed int)' 192.168.0.1:6020/rest/sql
print 29-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1
endi
#30
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d2.t1 values('2017-12-25 21:28:41.022', 1)" 192.168.0.1:6020/rest/sql
print 30-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d2.t1 ' 192.168.0.1:6020/rest/sql
print 31-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
return -1
endi

View File

@ -0,0 +1,53 @@
system sh/stop_dnodes.sh
sleep 5000
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 httpEnableRecordSql -v 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
print =============== step1 - prepare data
sql create database d1
sql use d1
sql create table d1.table_rest0 (ts timestamp, i int)
sql create table d1.table_rest1 (ts timestamp, i int)
sql create table d1.table_rest2 (ts timestamp, i int)
sql create table d1.table_rest3 (ts timestamp, i int)
sql create table d1.table_rest4 (ts timestamp, i int)
sql create table d1.table_rest5 (ts timestamp, i int)
sql create table d1.table_rest6 (ts timestamp, i int)
sql create table d1.table_rest7 (ts timestamp, i int)
sql create table d1.table_rest8 (ts timestamp, i int)
sql create table d1.table_rest9 (ts timestamp, i int)
print =============== step2 - login
system_content curl 127.0.0.1:6020/rest/login/root/taosdata
print curl 127.0.0.1:6020/rest/login/root/taosdata -----> $system_content
if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then
return -1
endi
print =============== step3 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql
print =============== step5 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest1' 127.0.0.1:6020/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content

View File

@ -0,0 +1,45 @@
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 ============================ dnode1 start
print =============== step1 - prepare data
$dbPrefix = db
$tbPrefix = tb
$mtPrefix = st
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bigint, t1 bigint, t2 bigint, t3 bigint, t4 bigint, t5 bigint, t6 bigint, t7 bigint, t8 bigint, t9 bigint, t0 nchar(20)) TAGS(tgcol bigint)
$i = 0
while $i < 2
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0 )
$x = 0
while $x < 2000
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, '你好' )
$x = $x + 1
endw
$i = $i + 1
endw
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d 'select * from db0.st0 limit 100' 127.0.0.1:6020/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content
#system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d "select * from db0.st0 where tbname in ('tb0', 'tb1') limit 1000" 127.0.0.1:6020/rest/sql
#print curl 127.0.0.1:6020/rest/sql -----> $system_content

View File

@ -0,0 +1,23 @@
{
"hostIp": "192.168.100.128",
"connNum": 1,
"insertModel": "insertTable",
"waitTime": 0,
"tableDesc": "ts timestamp, i int",
"tablePrefix": "t",
"tablePerConn": 1,
"tableCreate": true,
"tableStart": 1,
"dbName": "db",
"dbReplica": 1,
"dbKeep": 3650,
"dbDays": 7,
"metricsName": "mt",
"tagNum": 10,
"dataNum": 1000,
"dataBegin": 1485878400000,
"dataInterval": 1000,
"dataBatch": 1000,
"dataInsert": true,
"dataRandom": false
}

View File

@ -0,0 +1,21 @@
{
"hostIp": "192.168.100.128",
"connNum": 10,
"insertModel": "insertTable",
"waitTime": 0,
"tableDesc": "ts timestamp, i int",
"tablePrefix": "t",
"tablePerConn": 1,
"tableCreate": true,
"tableStart": 1,
"dbName": "db",
"dbKeep": 3650,
"metricsName": "mt",
"tagNum": 10,
"dataNum": 1000,
"dataBegin": 1517414400000,
"dataInterval": 1000,
"dataBatch": 1000,
"dataInsert": true,
"dataRandom": false
}

View File

@ -0,0 +1,7 @@
{
"hostIp": "192.168.0.1",
"machineNum": 100,
"loopNum": 100,
"dbName": "db",
"dataBegin": 1485878400000
}

View File

@ -0,0 +1,621 @@
{
"metrics": [{
"fields": {
"result_code": 2,
"result_type": "connection_failed"
},
"name": "net_response",
"tags": {
"host": "panshi-gsl",
"port": "80",
"protocol": "tcp",
"result": "connection_failed",
"server": "localhost"
},
"timestamp": 1536750390000
},{
"fields": {
"load1": 0.27,
"load15": 0.09,
"load5": 0.22,
"n_cpus": 4,
"n_users": 4
},
"name": "system",
"tags": {
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},{
"fields": {
"uptime": 122
},
"name": "system",
"tags": {
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"uptime_format": " 0:02"
},
"name": "system",
"tags": {
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"bytes_recv": 19964,
"bytes_sent": 11077,
"drop_in": 0,
"drop_out": 0,
"err_in": 0,
"err_out": 0,
"packets_recv": 237,
"packets_sent": 124
},
"name": "net",
"tags": {
"host": "panshi-gsl",
"interface": "eth0"
},
"timestamp": 1536750390000
},
{
"fields": {
"usage_guest": 0,
"usage_guest_nice": 0,
"usage_idle": 99.39879759519036,
"usage_iowait": 0,
"usage_irq": 0,
"usage_nice": 0,
"usage_softirq": 0,
"usage_steal": 0,
"usage_system": 0.300601202404812,
"usage_user": 0.30060120240480753
},
"name": "cpu",
"tags": {
"cpu": "cpu0",
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"usage_guest": 0,
"usage_guest_nice": 0,
"usage_idle": 99.79959919839683,
"usage_iowait": 0,
"usage_irq": 0,
"usage_nice": 0,
"usage_softirq": 0,
"usage_steal": 0,
"usage_system": 0.2004008016032065,
"usage_user": 0
},
"name": "cpu",
"tags": {
"cpu": "cpu1",
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"usage_guest": 0,
"usage_guest_nice": 0,
"usage_idle": 99.7999999999999,
"usage_iowait": 0,
"usage_irq": 0,
"usage_nice": 0,
"usage_softirq": 0,
"usage_steal": 0,
"usage_system": 0.10000000000000217,
"usage_user": 0.09999999999999995
},
"name": "cpu",
"tags": {
"cpu": "cpu2",
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"usage_guest": 0,
"usage_guest_nice": 0,
"usage_idle": 99.7999999999999,
"usage_iowait": 0,
"usage_irq": 0,
"usage_nice": 0,
"usage_softirq": 0.09999999999999988,
"usage_steal": 0,
"usage_system": 0.09999999999999995,
"usage_user": 0
},
"name": "cpu",
"tags": {
"cpu": "cpu3",
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"usage_guest": 0,
"usage_guest_nice": 0,
"usage_idle": 99.74956173303289,
"usage_iowait": 0,
"usage_irq": 0,
"usage_nice": 0,
"usage_softirq": 0.025043826696719312,
"usage_steal": 0,
"usage_system": 0.12521913348359823,
"usage_user": 0.10017530678687725
},
"name": "cpu",
"tags": {
"cpu": "cpu-total",
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"icmp_inaddrmaskreps": 0,
"icmp_inaddrmasks": 0,
"icmp_indestunreachs": 1,
"icmp_inechoreps": 0,
"icmp_inechos": 0,
"icmp_inerrors": 0,
"icmp_inmsgs": 1,
"icmp_inparmprobs": 0,
"icmp_inredirects": 0,
"icmp_insrcquenchs": 0,
"icmp_intimeexcds": 0,
"icmp_intimestampreps": 0,
"icmp_intimestamps": 0,
"icmp_outaddrmaskreps": 0,
"icmp_outaddrmasks": 0,
"icmp_outdestunreachs": 5,
"icmp_outechoreps": 0,
"icmp_outechos": 0,
"icmp_outerrors": 0,
"icmp_outmsgs": 5,
"icmp_outparmprobs": 0,
"icmp_outredirects": 0,
"icmp_outsrcquenchs": 0,
"icmp_outtimeexcds": 0,
"icmp_outtimestampreps": 0,
"icmp_outtimestamps": 0,
"icmpmsg_intype3": 1,
"icmpmsg_outtype3": 5,
"ip_defaultttl": 64,
"ip_forwarding": 2,
"ip_forwdatagrams": 0,
"ip_fragcreates": 0,
"ip_fragfails": 0,
"ip_fragoks": 0,
"ip_inaddrerrors": 0,
"ip_indelivers": 132,
"ip_indiscards": 0,
"ip_inhdrerrors": 0,
"ip_inreceives": 132,
"ip_inunknownprotos": 0,
"ip_outdiscards": 0,
"ip_outnoroutes": 40,
"ip_outrequests": 134,
"ip_reasmfails": 0,
"ip_reasmoks": 0,
"ip_reasmreqds": 0,
"ip_reasmtimeout": 0,
"tcp_activeopens": 11,
"tcp_attemptfails": 11,
"tcp_currestab": 0,
"tcp_estabresets": 0,
"tcp_inerrs": 0,
"tcp_insegs": 22,
"tcp_maxconn": -1,
"tcp_outrsts": 11,
"tcp_outsegs": 22,
"tcp_passiveopens": 0,
"tcp_retranssegs": 0,
"tcp_rtoalgorithm": 1,
"tcp_rtomax": 120000,
"tcp_rtomin": 200,
"udp_indatagrams": 101,
"udp_inerrors": 0,
"udp_noports": 5,
"udp_outdatagrams": 109,
"udp_rcvbuferrors": 0,
"udp_sndbuferrors": 0,
"udplite_indatagrams": 0,
"udplite_inerrors": 0,
"udplite_noports": 0,
"udplite_outdatagrams": 0,
"udplite_rcvbuferrors": 0,
"udplite_sndbuferrors": 0
},
"name": "net",
"tags": {
"host": "panshi-gsl",
"interface": "all"
},
"timestamp": 1536750390000
},
{
"fields": {
"io_time": 44,
"iops_in_progress": 0,
"read_bytes": 569344,
"read_time": 44,
"reads": 108,
"weighted_io_time": 44,
"write_bytes": 0,
"write_time": 0,
"writes": 0
},
"name": "diskio",
"tags": {
"host": "panshi-gsl",
"name": "sda5"
},
"timestamp": 1536750390000
},
{
"fields": {
"io_time": 4900,
"iops_in_progress": 0,
"read_bytes": 262294528,
"read_time": 13607,
"reads": 8122,
"weighted_io_time": 27970,
"write_bytes": 12054528,
"write_time": 14369,
"writes": 1073
},
"name": "diskio",
"tags": {
"host": "panshi-gsl",
"name": "sda"
},
"timestamp": 1536750390000
},
{
"fields": {
"io_time": 4874,
"iops_in_progress": 0,
"read_bytes": 261522432,
"read_time": 13538,
"reads": 7963,
"weighted_io_time": 27901,
"write_bytes": 12054528,
"write_time": 14369,
"writes": 1073
},
"name": "diskio",
"tags": {
"host": "panshi-gsl",
"name": "sda1"
},
"timestamp": 1536750390000
},
{
"fields": {
"io_time": 15,
"iops_in_progress": 0,
"read_bytes": 2048,
"read_time": 15,
"reads": 2,
"weighted_io_time": 15,
"write_bytes": 0,
"write_time": 0,
"writes": 0
},
"name": "diskio",
"tags": {
"host": "panshi-gsl",
"name": "sda2"
},
"timestamp": 1536750390000
},
{
"fields": {
"free": 4106956800,
"inodes_free": 526746,
"inodes_total": 752192,
"inodes_used": 225446,
"total": 12112691200,
"used": 7390433280,
"used_percent": 64.27922535963918
},
"name": "disk",
"tags": {
"device": "rootfs",
"fstype": "rootfs",
"host": "panshi-gsl",
"mode": "rw",
"path": "/"
},
"timestamp": 1536750390000
},
{
"fields": {
"free": 4106956800,
"inodes_free": 526746,
"inodes_total": 752192,
"inodes_used": 225446,
"total": 12112691200,
"used": 7390433280,
"used_percent": 64.27922535963918
},
"name": "disk",
"tags": {
"device": "disk/by-uuid/d4becabf-b49c-4c1c-a4ea-b2f593018766",
"fstype": "ext3",
"host": "panshi-gsl",
"mode": "rw",
"path": "/"
},
"timestamp": 1536750390000
},
{
"fields": {
"boot_time": 1536750268,
"context_switches": 135890,
"entropy_avail": 514,
"interrupts": 112317,
"processes_forked": 3595
},
"name": "kernel",
"tags": {
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"active": 211845120,
"available": 3829399552,
"available_percent": 92.37877479393148,
"buffered": 12083200,
"cached": 254320640,
"commit_limit": 2648322048,
"committed_as": 549027840,
"dirty": 49152,
"free": 3562995712,
"high_free": 0,
"high_total": 0,
"huge_page_size": 2097152,
"huge_pages_free": 0,
"huge_pages_total": 0,
"inactive": 214351872,
"low_free": 0,
"low_total": 0,
"mapped": 81797120,
"page_tables": 13062144,
"shared": 2682880,
"slab": 33386496,
"swap_cached": 0,
"swap_free": 575660032,
"swap_total": 575660032,
"total": 4145324032,
"used": 315924480,
"used_percent": 7.621225206068523,
"vmalloc_chunk": 35184198369280,
"vmalloc_total": 35184372087808,
"vmalloc_used": 168906752,
"wired": 0,
"write_back": 0,
"write_back_tmp": 0
},
"name": "mem",
"tags": {
"host": "panshi-gsl"
},
"timestamp": 1536750390000
},
{
"fields": {
"IpExtInBcastOctets": 1291,
"IpExtInBcastPkts": 6,
"IpExtInMcastOctets": 0,
"IpExtInMcastPkts": 0,
"IpExtInNoRoutes": 0,
"IpExtInOctets": 12160,
"IpExtInTruncatedPkts": 0,
"IpExtOutBcastOctets": 0,
"IpExtOutBcastPkts": 0,
"IpExtOutMcastOctets": 0,
"IpExtOutMcastPkts": 0,
"IpExtOutOctets": 9881,
"TcpExtArpFilter": 0,
"TcpExtDelayedACKLocked": 0,
"TcpExtDelayedACKLost": 0,
"TcpExtDelayedACKs": 0,
"TcpExtEmbryonicRsts": 0,
"TcpExtListenDrops": 0,
"TcpExtListenOverflows": 0,
"TcpExtLockDroppedIcmps": 0,
"TcpExtOfoPruned": 0,
"TcpExtOutOfWindowIcmps": 0,
"TcpExtPAWSActive": 0,
"TcpExtPAWSEstab": 0,
"TcpExtPAWSPassive": 0,
"TcpExtPruneCalled": 0,
"TcpExtRcvPruned": 0,
"TcpExtSyncookiesFailed": 0,
"TcpExtSyncookiesRecv": 0,
"TcpExtSyncookiesSent": 0,
"TcpExtTCPAbortFailed": 0,
"TcpExtTCPAbortOnClose": 0,
"TcpExtTCPAbortOnData": 0,
"TcpExtTCPAbortOnLinger": 0,
"TcpExtTCPAbortOnMemory": 0,
"TcpExtTCPAbortOnSyn": 0,
"TcpExtTCPAbortOnTimeout": 0,
"TcpExtTCPDSACKIgnoredNoUndo": 0,
"TcpExtTCPDSACKIgnoredOld": 0,
"TcpExtTCPDSACKOfoRecv": 0,
"TcpExtTCPDSACKOfoSent": 0,
"TcpExtTCPDSACKOldSent": 0,
"TcpExtTCPDSACKRecv": 0,
"TcpExtTCPDSACKUndo": 0,
"TcpExtTCPDirectCopyFromBacklog": 0,
"TcpExtTCPDirectCopyFromPrequeue": 0,
"TcpExtTCPFACKReorder": 0,
"TcpExtTCPFastRetrans": 0,
"TcpExtTCPForwardRetrans": 0,
"TcpExtTCPFullUndo": 0,
"TcpExtTCPHPAcks": 0,
"TcpExtTCPHPHits": 0,
"TcpExtTCPHPHitsToUser": 0,
"TcpExtTCPLoss": 0,
"TcpExtTCPLossFailures": 0,
"TcpExtTCPLossUndo": 0,
"TcpExtTCPLostRetransmit": 0,
"TcpExtTCPMD5NotFound": 0,
"TcpExtTCPMD5Unexpected": 0,
"TcpExtTCPMemoryPressures": 0,
"TcpExtTCPPartialUndo": 0,
"TcpExtTCPPrequeueDropped": 0,
"TcpExtTCPPrequeued": 0,
"TcpExtTCPPureAcks": 0,
"TcpExtTCPRcvCollapsed": 0,
"TcpExtTCPRenoFailures": 0,
"TcpExtTCPRenoRecovery": 0,
"TcpExtTCPRenoRecoveryFail": 0,
"TcpExtTCPRenoReorder": 0,
"TcpExtTCPSACKDiscard": 0,
"TcpExtTCPSACKReneging": 0,
"TcpExtTCPSACKReorder": 0,
"TcpExtTCPSackFailures": 0,
"TcpExtTCPSackMerged": 0,
"TcpExtTCPSackRecovery": 0,
"TcpExtTCPSackRecoveryFail": 0,
"TcpExtTCPSackShiftFallback": 0,
"TcpExtTCPSackShifted": 0,
"TcpExtTCPSchedulerFailed": 0,
"TcpExtTCPSlowStartRetrans": 0,
"TcpExtTCPSpuriousRTOs": 0,
"TcpExtTCPTSReorder": 0,
"TcpExtTCPTimeouts": 0,
"TcpExtTW": 0,
"TcpExtTWKilled": 0,
"TcpExtTWRecycled": 0
},
"name": "nstat",
"tags": {
"host": "panshi-gsl",
"name": "netstat"
},
"timestamp": 1536750390000
},
{
"fields": {
"IcmpInAddrMaskReps": 0,
"IcmpInAddrMasks": 0,
"IcmpInDestUnreachs": 1,
"IcmpInEchoReps": 0,
"IcmpInEchos": 0,
"IcmpInErrors": 0,
"IcmpInMsgs": 1,
"IcmpInParmProbs": 0,
"IcmpInRedirects": 0,
"IcmpInSrcQuenchs": 0,
"IcmpInTimeExcds": 0,
"IcmpInTimestampReps": 0,
"IcmpInTimestamps": 0,
"IcmpMsgInType3": 1,
"IcmpMsgOutType3": 5,
"IcmpOutAddrMaskReps": 0,
"IcmpOutAddrMasks": 0,
"IcmpOutDestUnreachs": 5,
"IcmpOutEchoReps": 0,
"IcmpOutEchos": 0,
"IcmpOutErrors": 0,
"IcmpOutMsgs": 5,
"IcmpOutParmProbs": 0,
"IcmpOutRedirects": 0,
"IcmpOutSrcQuenchs": 0,
"IcmpOutTimeExcds": 0,
"IcmpOutTimestampReps": 0,
"IcmpOutTimestamps": 0,
"IpDefaultTTL": 64,
"IpForwDatagrams": 0,
"IpForwarding": 2,
"IpFragCreates": 0,
"IpFragFails": 0,
"IpFragOKs": 0,
"IpInAddrErrors": 0,
"IpInDelivers": 132,
"IpInDiscards": 0,
"IpInHdrErrors": 0,
"IpInReceives": 132,
"IpInUnknownProtos": 0,
"IpOutDiscards": 0,
"IpOutNoRoutes": 40,
"IpOutRequests": 134,
"IpReasmFails": 0,
"IpReasmOKs": 0,
"IpReasmReqds": 0,
"IpReasmTimeout": 0,
"TcpActiveOpens": 12,
"TcpAttemptFails": 12,
"TcpCurrEstab": 0,
"TcpEstabResets": 0,
"TcpInErrs": 0,
"TcpInSegs": 24,
"TcpMaxConn": -1,
"TcpOutRsts": 12,
"TcpOutSegs": 24,
"TcpPassiveOpens": 0,
"TcpRetransSegs": 0,
"TcpRtoAlgorithm": 1,
"TcpRtoMax": 120000,
"TcpRtoMin": 200,
"UdpInDatagrams": 101,
"UdpInErrors": 0,
"UdpLiteInDatagrams": 0,
"UdpLiteInErrors": 0,
"UdpLiteNoPorts": 0,
"UdpLiteOutDatagrams": 0,
"UdpLiteRcvbufErrors": 0,
"UdpLiteSndbufErrors": 0,
"UdpNoPorts": 5,
"UdpOutDatagrams": 109,
"UdpRcvbufErrors": 0,
"UdpSndbufErrors": 0
},
"name": "nstat",
"tags": {
"host": "panshi-gsl",
"name": "snmp"
},
"timestamp": 1536750390000
},
{
"fields": {
"blocked": 0,
"dead": 0,
"idle": 0,
"paging": 0,
"running": 1,
"sleeping": 181,
"stopped": 0,
"total": 182,
"total_threads": 280,
"unknown": 0,
"zombies": 0
},
"name": "processes",
"tags": {
"host": "panshi-gsl"
},
"timestamp": 1536750390000
}]
}

View File

@ -0,0 +1,293 @@
system sh/stop_dnodes.sh
sleep 5000
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 httpEnableRecordSql -v 1
system sh/cfg.sh -n dnode1 -c telegrafUseFieldNum -v 0
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ dnode1 start
print =============== step1 - parse
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/
print $system_content
if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/
print $system_content
if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/d123456789012345678901234567890123456
print $system_content
if $system_content != @{"status":"error","code":1023,"desc":"database name too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": []}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1025,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": [{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": 12}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1025,"desc":"metrics size is 0"}@ then
return -1
endi
#system_content curl -u root:taosdata -d '{"metrics": [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1
#print $system_content
#if $system_content != @{"status":"error","code":1026,"desc":"metrics size can not more than 50"}@ then
# return -1
#endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":111,"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1028,"desc":"metric name type should be string"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1029,"desc":"metric name length is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1030,"desc":"metric name length too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"}}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1031,"desc":"timestamp not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":""}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1032,"desc":"timestamp type should be integer"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":-1}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1033,"desc":"timestamp value smaller than 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1034,"desc":"tags not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":"","timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then
return -1
endi
#system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor","host":"windows","instance":"1","objectname":"Processor","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata
#print $system_content
#if $system_content != @{"status":"error","code":1036,"desc":"tags size too long"}@ then
# return -1
#endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1038,"desc":"tag name is null"}@ then
return -1
endi
#system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host111111111111222222222222222222222":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
#print $system_content
#if $system_content != @{"status":"error","code":1039,"desc":"tag name length too long"}@ then
# return -1
#endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":true},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1040,"desc":"tag value type should be number or string"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1041,"desc":"tag value is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"1022":"111"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1042,"desc":"table is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"host111111111111222222222222222222222host111111111111222222222222222222222"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1043,"desc":"table name length too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1045,"desc":"fields size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1048,"desc":"field name is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":"","Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1051,"desc":"field value is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":true,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1050,"desc":"field value type should be number or string"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1564641722000}' 127.0.0.1:6020/telegraf/db
print $system_content
if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":1,"status":"succ"}]}@ then
return -1
endi
sleep 3000
print =============== step2 - insert single data
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1564641722000}' 127.0.0.1:6020/telegraf/db/
print $system_content
if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":0,"status":"succ"}]}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select * from db.win_cpu_windows_1_Processor' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:02.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then
return -1
endi
print =============== step3 - multi-query data
system_content curl -u root:taosdata -d '{"metrics": [{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"window1","instance":"1","objectname":"Processor"},"timestamp":1564641723000},{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"window2","instance":"1","objectname":"Processor"},"timestamp":1564641723000}]}' 127.0.0.1:6020/telegraf/db/
print $system_content
if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_window1_1_Processor","timestamp":"1564641723000","affected_rows":1,"status":"succ"},{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_window2_1_Processor","timestamp":"1564641723000","affected_rows":1,"status":"succ"}]}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select * from db.win_cpu_window1_1_Processor' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:03.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then
return -1
endi
system_content curl -u root:taosdata -d 'select count(*) from db.win_cpu' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows":1}@ then
return -1
endi

View File

@ -0,0 +1,223 @@
package main
import (
"bytes"
"encoding/json"
"fmt"
"strings"
"io/ioutil"
"net/http"
"os"
"sync"
"sync/atomic"
"time"
"flag"
)
var (
token string
url string
config Config
request int64
period int64
errorNum int64
template string
)
type Config struct {
HostIp string `json:"hostIp"`
MachineNum int `json:"machineNum"`
LoopNum int `json:"loopNum"`
DbName string `json:"dbName"`
DataBegin int64 `json:"dataBegin"`
}
type TokenResult struct {
Status string `json:"status"`
Code int `json:"code"`
Desc string `json:"desc"`
}
type JsonResult struct {
Status string `json:"status"`
Code int `json:"code"`
}
func readConf(filename string) {
file, err := os.Open(filename)
if err != nil {
println("%s not found", filename)
panic(err)
}
defer file.Close()
dec := json.NewDecoder(file)
err = dec.Decode(&config)
if err != nil {
println("%s parse error", filename)
panic(err)
}
request = 0
period = 0
errorNum = 0
fmt.Println("================config parameters======================")
fmt.Println("HostIp:", config.HostIp)
fmt.Println("MachineNum:", config.MachineNum)
fmt.Println("LoopNum:", config.LoopNum)
fmt.Println("dbName:", config.DbName)
fmt.Println("dataBegin:", config.DataBegin)
fmt.Println("================http token=============================")
token, err = getToken()
url = fmt.Sprintf("http://%s:%d/telegraf/%s", config.HostIp, 6020, config.DbName)
fmt.Println("httpToken:", token)
fmt.Println("httpUrl:", url)
if err != nil {
panic(err)
}
}
func readReq(filename string) {
file, err := os.Open(filename)
if err != nil {
println("%s not found", filename)
panic(err)
}
defer file.Close()
data, _ := ioutil.ReadAll(file)
template = string(data[:])
//fmt.Println(template)
}
func getToken() (string, error) {
resp, err := http.Get(fmt.Sprintf("http://%s:%d/rest/login/%s/%s", config.HostIp, 6020, "root", "taosdata"))
if err != nil {
return "", err
}
defer resp.Body.Close()
var tokenResult TokenResult
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
err = json.Unmarshal(data, &tokenResult)
if err != nil {
return "", err
}
if tokenResult.Status != "succ" {
fmt.Println("get http token failed")
fmt.Println(tokenResult)
return "", err
}
return tokenResult.Desc, nil
}
func exec(client *http.Client, sql string) {
for times := 0; times < 10; times++ {
req, err1 := http.NewRequest("POST", url, bytes.NewReader([]byte(sql)))
if err1 != nil {
continue
}
req.Header.Add("Authorization", "Taosd "+token)
begin := time.Now()
resp, err := client.Do(req)
if err != nil {
continue
}
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(data)
resp.Body.Close()
continue
}
spend := (time.Since(begin).Nanoseconds())
var jsonResult JsonResult
err = json.Unmarshal(data, &jsonResult)
if err != nil {
fmt.Println("parse json error: ", string(data[:]))
resp.Body.Close()
continue
}
atomic.AddInt64(&request, 1)
atomic.AddInt64(&period, spend)
if request%1000 == 0 && request != 0 {
requestAvg := float64(period) / float64(1000000) / float64(request)
qps := float64(1000) / float64(requestAvg) * float64(config.MachineNum)
dps := qps * float64(22)
fmt.Println("====== req:", request, ", error:", errorNum, ", qps:", int64(qps), ", wait:", int64(requestAvg), "ms", ", data per second:", int64(dps))
}
return
}
//fmt.Println("xxxx>sql:", sql, ", retryTimes:", 10)
fmt.Println("exec sql failed")
errorNum++
}
func writeData(wg *sync.WaitGroup, tbIndex int) {
defer wg.Done()
client := &http.Client{}
tbName := fmt.Sprintf("t%d", tbIndex)
for j := 0; j < config.LoopNum; j++ {
tmVal := fmt.Sprintf("%d", int64(j)*int64(10000) + config.DataBegin)
//fmt.Println(tmVal)
req1 := strings.Replace(template, "panshi-gsl", tbName, -1)
req2 := strings.Replace(req1, "1536750390000", tmVal, -1)
//fmt.Println(req2)
exec(client, req2)
}
}
func main() {
filename := flag.String("config", "telegraf.json", "config file name")
flag.Parse()
readReq("telegraf.req")
readConf(*filename)
fmt.Println("\n================telegraf test start======================")
var wg sync.WaitGroup
for i := 0; i < config.MachineNum; i++ {
wg.Add(1)
go writeData(&wg, i)
}
wg.Wait()
fmt.Println("\n================telegraf test stop ======================")
requestAvg := float64(period) / float64(1000000) / float64(request)
qps := float64(1000) / float64(requestAvg) * float64(config.MachineNum)
dps := qps * float64(22)
fmt.Println("====== req:", request, ", error:", errorNum, ", qps:", int64(qps), ", wait:", int64(requestAvg), "ms", ", data per second:", int64(dps))
}

View File

@ -0,0 +1,24 @@
1.编译
将main.go编译成可执行文件telegrafTest
2.执行
./telegrafTest
3.参数 telegraf.json的配置文件
hostIp TDengine机器IP地址
machineNum 模拟的机器数量
loopNum 每个机器发送请求的次数
dbName 创建的数据库名称
dataBegin 生成模拟数据的开始时间戳
4.telegraf.req通常不变
1替换panshi-gsl和1536750380000这两个字符串生成http请求
2通过http发送给TDengine
5.注意
1修改配置文件/etc/taos/taos.cfg
httpDebugFlag 设置为131131-httpDebug,135-httpDebug
httpMaxThreads 按照机器情况设置设置范围为1-cpu cores)
httpCacheSessions 设置为可能的http连接的2倍
maxVnodeConnections 设置为100000
maxMeterConnections 设置为100000
maxShellConns 设置为100000
maxMgmtConnections 设置为100000
2设置linux参数例如
ulimit -n 600000

View File

@ -0,0 +1,7 @@
run lite/http/grafana.sim
run lite/http/restful.sim
run lite/http/restful_full.sim
run lite/http/telegraf.sim
run lite/http/prepare.sim
run lite/http/grafana_bug.sim
#run lite/http/opentsdb.sim

Some files were not shown because too many files have changed in this diff Show More