add test case
This commit is contained in:
parent
c7b294d03b
commit
b8ada78305
|
@ -0,0 +1,73 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print ======== step0
|
||||||
|
$dbPrefix = ta_3_db
|
||||||
|
$tbPrefix = ta_3_tb
|
||||||
|
$mtPrefix = ta_3_mt
|
||||||
|
$tbNum = 101
|
||||||
|
$rowNum = 20
|
||||||
|
$totalNum = 200
|
||||||
|
|
||||||
|
print =============== create database
|
||||||
|
sql create database $dbPrefix
|
||||||
|
sql use $dbPrefix
|
||||||
|
|
||||||
|
print =============== create super table and register tag index
|
||||||
|
sql create table if not exists $mtPrefix (ts timestamp, c1 int) tags (t1 int, t2 int, t3 int, t4 int, t5 int)
|
||||||
|
|
||||||
|
sql show stables
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== create child table
|
||||||
|
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
$tb = $tbPrefix . $i
|
||||||
|
sql create table $tb using $mtPrefix tags( $i , $i , $i , $i , $i );
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
sql show tables
|
||||||
|
if $rows != $tbNum then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print =============== insert data into each table
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
$tb = $tbPrefix . $i
|
||||||
|
sql insert into $tb values(now, 10);
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
|
||||||
|
sql create index ti2 on $mtPrefix (t2)
|
||||||
|
|
||||||
|
# equal
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
sql select * from $mtPrefix where t2= $i ;
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
sql select * from $mtPrefix where t2 >= $i ;
|
||||||
|
$tmp = $tbNum - $i
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -47,7 +47,7 @@ endw
|
||||||
|
|
||||||
|
|
||||||
sql create index ti2 on $tb(t2)
|
sql create index ti2 on $tb(t2)
|
||||||
//sql create index ti2 on $tb(t3)
|
#sql create index ti2 on $tb(t3)
|
||||||
|
|
||||||
|
|
||||||
$i = 0
|
$i = 0
|
||||||
|
|
Loading…
Reference in New Issue