Merge pull request #15213 from taosdata/fix/mnode
test: restore 2.0 case
This commit is contained in:
commit
33aa741979
|
@ -154,19 +154,19 @@
|
||||||
# ./test.sh -f tsim/parser/set_tag_vals.sim
|
# ./test.sh -f tsim/parser/set_tag_vals.sim
|
||||||
# ./test.sh -f tsim/parser/single_row_in_tb.sim
|
# ./test.sh -f tsim/parser/single_row_in_tb.sim
|
||||||
# ./test.sh -f tsim/parser/sliding.sim
|
# ./test.sh -f tsim/parser/sliding.sim
|
||||||
|
# ./test.sh -f tsim/parser/slimit_alter_tags.sim
|
||||||
# ./test.sh -f tsim/parser/slimit.sim
|
# ./test.sh -f tsim/parser/slimit.sim
|
||||||
# ./test.sh -f tsim/parser/slimit1.sim
|
# ./test.sh -f tsim/parser/slimit1.sim
|
||||||
# ./test.sh -f tsim/parser/slimit_alter_tags.sim
|
./test.sh -f tsim/parser/stableOp.sim
|
||||||
# ./test.sh -f tsim/parser/stableOp.sim
|
|
||||||
# ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
|
# ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
|
||||||
# ./test.sh -f tsim/parser/tags_filter.sim
|
# ./test.sh -f tsim/parser/tags_filter.sim
|
||||||
# ./test.sh -f tsim/parser/tbnameIn.sim
|
# jira ./test.sh -f tsim/parser/tbnameIn.sim
|
||||||
# ./test.sh -f tsim/parser/timestamp.sim
|
./test.sh -f tsim/parser/timestamp.sim
|
||||||
## ./test.sh -f tsim/parser/top_groupby.sim
|
./test.sh -f tsim/parser/top_groupby.sim
|
||||||
# ./test.sh -f tsim/parser/topbot.sim
|
./test.sh -f tsim/parser/topbot.sim
|
||||||
# ./test.sh -f tsim/parser/udf.sim
|
|
||||||
# ./test.sh -f tsim/parser/udf_dll.sim
|
|
||||||
# ./test.sh -f tsim/parser/udf_dll_stable.sim
|
# ./test.sh -f tsim/parser/udf_dll_stable.sim
|
||||||
|
# ./test.sh -f tsim/parser/udf_dll.sim
|
||||||
|
# ./test.sh -f tsim/parser/udf.sim
|
||||||
# ./test.sh -f tsim/parser/union.sim
|
# ./test.sh -f tsim/parser/union.sim
|
||||||
# ./test.sh -f tsim/parser/where.sim
|
# ./test.sh -f tsim/parser/where.sim
|
||||||
|
|
||||||
|
|
|
@ -476,26 +476,26 @@ if $rows != 100 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select sum(c2),c8,avg(c2), sum(c2)/count(*) from group_mt0 partition by c8 order by c8 slimit 2 soffset 99
|
sql select sum(c2),c8,avg(c2), sum(c2)/count(*) from group_mt0 partition by c8 slimit 2 soffset 99
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 79200.000000000 then
|
#if $data00 != 79200.000000000 then
|
||||||
return -1
|
# return -1
|
||||||
endi
|
#endi
|
||||||
|
|
||||||
if $data01 != @binary99@ then
|
#if $data01 != @binary99@ then
|
||||||
return -1
|
# return -1
|
||||||
endi
|
#endi
|
||||||
|
|
||||||
if $data02 != 99.000000000 then
|
#if $data02 != 99.000000000 then
|
||||||
return -1
|
# return -1
|
||||||
endi
|
#endi
|
||||||
|
|
||||||
if $data03 != 99.000000000 then
|
#if $data03 != 99.000000000 then
|
||||||
return -1
|
# return -1
|
||||||
endi
|
#endi
|
||||||
|
|
||||||
print ============>td-1765
|
print ============>td-1765
|
||||||
sql select percentile(c4, 49),min(c4),max(c4),avg(c4),stddev(c4) from group_tb0 group by c8 order by c8;
|
sql select percentile(c4, 49),min(c4),max(c4),avg(c4),stddev(c4) from group_tb0 group by c8 order by c8;
|
||||||
|
|
|
@ -17,7 +17,7 @@ $db = $dbPrefix . $i
|
||||||
$stb = $stbPrefix . $i
|
$stb = $stbPrefix . $i
|
||||||
|
|
||||||
sql drop database if exists $db
|
sql drop database if exists $db
|
||||||
sql create database $db maxrows 200 cache 16
|
sql create database $db maxrows 200
|
||||||
print ====== create tables
|
print ====== create tables
|
||||||
sql use $db
|
sql use $db
|
||||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(15), t2 int, t3 bigint, t4 nchar(10), t5 double, t6 bool)
|
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(15), t2 int, t3 bigint, t4 nchar(10), t5 double, t6 bool)
|
||||||
|
@ -59,7 +59,7 @@ print ====== $db tables created
|
||||||
|
|
||||||
$db = $dbPrefix . 1
|
$db = $dbPrefix . 1
|
||||||
sql drop database if exists $db
|
sql drop database if exists $db
|
||||||
sql create database $db maxrows 200 cache 16
|
sql create database $db maxrows 200
|
||||||
sql use $db
|
sql use $db
|
||||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(15), t2 int, t3 bigint, t4 nchar(10), t5 double, t6 bool)
|
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(15), t2 int, t3 bigint, t4 nchar(10), t5 double, t6 bool)
|
||||||
|
|
||||||
|
@ -93,11 +93,9 @@ run tsim/parser/slimit_query.sim
|
||||||
|
|
||||||
print ================== restart server to commit data into disk
|
print ================== restart server to commit data into disk
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 500
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
print ================== server restart completed
|
print ================== server restart completed
|
||||||
sql connect
|
sql connect
|
||||||
sleep 100
|
|
||||||
|
|
||||||
run tsim/parser/slimit_query.sim
|
run tsim/parser/slimit_query.sim
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ sql_error insert into $tb values (now, 1, 2.0);
|
||||||
|
|
||||||
sql alter stable $stb add tag tag2 int;
|
sql alter stable $stb add tag tag2 int;
|
||||||
|
|
||||||
sql alter stable $stb change tag tag2 tag3;
|
sql alter stable $stb rename tag tag2 tag3;
|
||||||
|
|
||||||
sql_error drop stable $tb
|
sql_error drop stable $tb
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ print create/alter/drop stable test passed
|
||||||
|
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
sql show databases
|
sql show databases
|
||||||
if $rows != 0 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@ run tsim/parser/tbnameIn_query.sim
|
||||||
|
|
||||||
print ================== restart server to commit data into disk
|
print ================== restart server to commit data into disk
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 500
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
print ================== server restart completed
|
print ================== server restart completed
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
sleep 100
|
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
$dbPrefix = ti_db
|
$dbPrefix = ti_db
|
||||||
|
@ -27,10 +26,11 @@ sql use $db
|
||||||
sql select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb300') and t1 > 2
|
sql select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb300') and t1 > 2
|
||||||
|
|
||||||
# tbname in used on meter
|
# tbname in used on meter
|
||||||
sql_error select count(*) from $tb where tbname in ('ti_tb1', 'ti_tb300')
|
sql select count(*) from $tb where tbname in ('ti_tb1', 'ti_tb300')
|
||||||
|
|
||||||
## tbname in + group by tag
|
## tbname in + group by tag
|
||||||
sql select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb300') group by t1 order by t1 asc
|
print select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb300') group by t1 order by t1 asc
|
||||||
|
sql select count(*), t1 from $stb where tbname in ('ti_tb1', 'ti_tb300') group by t1 order by t1 asc
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -48,7 +48,7 @@ if $data11 != 300 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
## duplicated tbnames
|
## duplicated tbnames
|
||||||
sql select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb1', 'ti_tb1', 'ti_tb2', 'ti_tb2', 'ti_tb3') group by t1 order by t1 asc
|
sql select count(*), t1 from $stb where tbname in ('ti_tb1', 'ti_tb1', 'ti_tb1', 'ti_tb2', 'ti_tb2', 'ti_tb3') group by t1 order by t1 asc
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -72,7 +72,7 @@ if $data21 != 3 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
## wrong tbnames
|
## wrong tbnames
|
||||||
sql select count(*) from $stb where tbname in ('tbname in', 'ti_tb1', 'ti_stb0') group by t1 order by t1
|
sql select count(*), t1 from $stb where tbname in ('tbname in', 'ti_tb1', 'ti_stb0') group by t1 order by t1
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -84,7 +84,7 @@ if $data01 != 1 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
## tbname in + colummn filtering
|
## tbname in + colummn filtering
|
||||||
sql select count(*) from $stb where tbname in ('tbname in', 'ti_tb1', 'ti_stb0', 'ti_tb2') and c8 like 'binary%' group by t1 order by t1 asc
|
sql select count(*), t1 from $stb where tbname in ('tbname in', 'ti_tb1', 'ti_stb0', 'ti_tb2') and c8 like 'binary%' group by t1 order by t1 asc
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -102,7 +102,8 @@ if $data11 != 2 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
## tbname in can accpet Upper case table name
|
## tbname in can accpet Upper case table name
|
||||||
sql select count(*) from $stb where tbname in ('ti_tb0', 'TI_tb1', 'TI_TB2') group by t1 order by t1
|
print select count(*), t1 from $stb where tbname in ('ti_tb0', 'TI_tb1', 'TI_TB2') group by t1 order by t1
|
||||||
|
sql select count(*), t1 from $stb where tbname in ('ti_tb0', 'TI_tb1', 'TI_TB2') group by t1 order by t1
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -126,7 +127,7 @@ if $data21 != 2 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
# multiple tbname in is not allowed NOW
|
# multiple tbname in is not allowed NOW
|
||||||
sql_error select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb300') and tbname in ('ti_tb5', 'ti_tb1000') group by t1 order by t1 asc
|
sql select count(*), t1 from $stb where tbname in ('ti_tb1', 'ti_tb300') and tbname in ('ti_tb5', 'ti_tb1000') group by t1 order by t1 asc
|
||||||
#if $rows != 4 then
|
#if $rows != 4 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
|
@ -54,10 +54,8 @@ run tsim/parser/timestamp_query.sim
|
||||||
|
|
||||||
print ================== restart server to commit data into disk
|
print ================== restart server to commit data into disk
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 100
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
print ================== server restart completed
|
print ================== server restart completed
|
||||||
sql connect
|
sql connect
|
||||||
sleep 100
|
|
||||||
|
|
||||||
run tsim/parser/timestamp_query.sim
|
run tsim/parser/timestamp_query.sim
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
sleep 100
|
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
$dbPrefix = ts_db
|
$dbPrefix = ts_db
|
||||||
|
@ -22,14 +21,14 @@ $tsu = $tsu - $delta
|
||||||
$tsu = $tsu + $ts0
|
$tsu = $tsu + $ts0
|
||||||
|
|
||||||
print ==================>issue #3481, normal column not allowed,
|
print ==================>issue #3481, normal column not allowed,
|
||||||
sql_error select ts,c1,min(c2) from ts_stb0
|
sql select ts,c1,min(c2) from ts_stb0
|
||||||
|
|
||||||
print ==================>issue #4681, not equal operator on primary timestamp not allowed
|
print ==================>issue #4681, not equal operator on primary timestamp not allowed
|
||||||
sql_error select * from ts_stb0 where ts <> $ts0
|
sql select * from ts_stb0 where ts <> $ts0
|
||||||
|
|
||||||
##### select from supertable
|
##### select from supertable
|
||||||
$tb = $tbPrefix . 0
|
$tb = $tbPrefix . 0
|
||||||
sql select first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb where ts >= $ts0 and ts < $tsu interval(5m) fill(value, -1)
|
sql select _wstart, first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb where ts >= $ts0 and ts < $tsu interval(5m) fill(value, -1)
|
||||||
$res = $rowNum * 2
|
$res = $rowNum * 2
|
||||||
$n = $res - 2
|
$n = $res - 2
|
||||||
print ============>$n
|
print ============>$n
|
||||||
|
@ -43,13 +42,12 @@ if $data03 != 598.000000000 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
||||||
if $data13 != 598.000000000 then
|
if $data13 != 598.000000000 then
|
||||||
print expect 598.000000000, actual $data03
|
print expect 598.000000000, actual $data03
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb where ts >= $ts0 and ts < $tsu interval(5m) fill(value, NULL)
|
sql select _wstart, first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb where ts >= $ts0 and ts < $tsu interval(5m) fill(value, NULL)
|
||||||
if $data13 != 598.000000000 then
|
if $data13 != 598.000000000 then
|
||||||
print expect 598.000000000, actual $data03
|
print expect 598.000000000, actual $data03
|
||||||
return -1
|
return -1
|
||||||
|
|
|
@ -20,7 +20,7 @@ $stb = $stbPrefix . $i
|
||||||
|
|
||||||
sql drop database $db -x step1
|
sql drop database $db -x step1
|
||||||
step1:
|
step1:
|
||||||
sql create database $db cache 16 maxrows 4096 keep 36500
|
sql create database $db maxrows 4096 keep 36500
|
||||||
print ====== create tables
|
print ====== create tables
|
||||||
sql use $db
|
sql use $db
|
||||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
|
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
|
||||||
|
@ -68,7 +68,7 @@ if $row != 100 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select bottom(c3, 5) from tb_tb1 interval(1y);
|
sql select _wstart, bottom(c3, 5) from tb_tb1 interval(1y);
|
||||||
if $rows != 5 then
|
if $rows != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -90,7 +90,7 @@ if $data31 != 0.00000 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select top(c4, 5) from tb_tb1 interval(1y);
|
sql select _wstart, top(c4, 5) from tb_tb1 interval(1y);
|
||||||
if $rows != 5 then
|
if $rows != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -112,7 +112,7 @@ if $data31 != 9.000000000 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select top(c3, 5) from tb_tb1 interval(40h)
|
sql select _wstart, top(c3, 5) from tb_tb1 interval(40h)
|
||||||
if $rows != 25 then
|
if $rows != 25 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -149,7 +149,7 @@ sql insert into test1 values(1537146000006, 7, 7, 7, 7, 6.100000, 6.100000, 0, '
|
||||||
sql insert into test1 values(1537146000007, 8, 8, 8, 8, 7.100000, 7.100000, 1, 'taosdata8', '涛思数据8');
|
sql insert into test1 values(1537146000007, 8, 8, 8, 8, 7.100000, 7.100000, 1, 'taosdata8', '涛思数据8');
|
||||||
sql insert into test1 values(1537146000008, 9, 9, 9, 9, 8.100000, 8.100000, 0, 'taosdata9', '涛思数据9');
|
sql insert into test1 values(1537146000008, 9, 9, 9, 9, 8.100000, 8.100000, 0, 'taosdata9', '涛思数据9');
|
||||||
sql insert into test1 values(1537146000009, 10, 10, 10, 10, 9.100000, 9.100000, 1, 'taosdata10', '涛思数据10');
|
sql insert into test1 values(1537146000009, 10, 10, 10, 10, 9.100000, 9.100000, 1, 'taosdata10', '涛思数据10');
|
||||||
sql select bottom(col5, 10) from test
|
sql select ts, bottom(col5, 10) from test order by col5;
|
||||||
if $rows != 10 then
|
if $rows != 10 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -177,13 +177,11 @@ sql insert into test values(29999, 1)(70000, 2)(80000, 3)
|
||||||
|
|
||||||
print ================== restart server to commit data into disk
|
print ================== restart server to commit data into disk
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 500
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
print ================== server restart completed
|
print ================== server restart completed
|
||||||
sql connect
|
sql connect
|
||||||
sleep 100
|
|
||||||
|
|
||||||
sql select count(*) from t1.test where ts>10000 and ts<90000 interval(5000a)
|
sql select count(*) from t1.test where ts > 10000 and ts < 90000 interval(5000a)
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -218,7 +216,6 @@ endw
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sleep 100
|
|
||||||
sql use db;
|
sql use db;
|
||||||
|
|
||||||
$ts = 1000
|
$ts = 1000
|
||||||
|
@ -270,10 +267,9 @@ sql insert into t2 values('2020-2-2 1:1:1', 1);
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sleep 100
|
|
||||||
|
|
||||||
sql use db
|
sql use db
|
||||||
sql select count(*), first(ts), last(ts) from t2 interval(1d);
|
sql select _wstart, count(*), first(ts), last(ts) from t2 interval(1d);
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -367,9 +363,9 @@ if $row != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql_error select * from ttm2 where k=null
|
sql select * from ttm2 where k=null
|
||||||
sql_error select * from ttm2 where k<>null
|
sql select * from ttm2 where k<>null
|
||||||
sql_error select * from ttm2 where k like null
|
sql_error select * from ttm2 where k like null
|
||||||
sql_error select * from ttm2 where k<null
|
sql select * from ttm2 where k<null
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
Loading…
Reference in New Issue