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

test: restore 2.0 case

上级 f52ad00d
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
## ./test.sh -f tsim/parser/create_tb_with_tag_name.sim ## ./test.sh -f tsim/parser/create_tb_with_tag_name.sim
# ./test.sh -f tsim/parser/dbtbnameValidate.sim # ./test.sh -f tsim/parser/dbtbnameValidate.sim
##./test.sh -f tsim/parser/distinct.sim ##./test.sh -f tsim/parser/distinct.sim
./test.sh -f tsim/parser/fill_stb.sim #./test.sh -f tsim/parser/fill_stb.sim
./test.sh -f tsim/parser/fill_us.sim ./test.sh -f tsim/parser/fill_us.sim
./test.sh -f tsim/parser/fill.sim ./test.sh -f tsim/parser/fill.sim
./test.sh -f tsim/parser/first_last.sim ./test.sh -f tsim/parser/first_last.sim
...@@ -112,8 +112,8 @@ ...@@ -112,8 +112,8 @@
## ./test.sh -f tsim/parser/function.sim ## ./test.sh -f tsim/parser/function.sim
./test.sh -f tsim/parser/groupby-basic.sim ./test.sh -f tsim/parser/groupby-basic.sim
# ./test.sh -f tsim/parser/groupby.sim # ./test.sh -f tsim/parser/groupby.sim
## ./test.sh -f tsim/parser/having.sim
# ./test.sh -f tsim/parser/having_child.sim # ./test.sh -f tsim/parser/having_child.sim
## ./test.sh -f tsim/parser/having.sim
## ./test.sh -f tsim/parser/import.sim ## ./test.sh -f tsim/parser/import.sim
# ./test.sh -f tsim/parser/import_commit1.sim # ./test.sh -f tsim/parser/import_commit1.sim
# ./test.sh -f tsim/parser/import_commit2.sim # ./test.sh -f tsim/parser/import_commit2.sim
......
...@@ -97,10 +97,11 @@ $tsu = $tsu + $ts0 ...@@ -97,10 +97,11 @@ $tsu = $tsu + $ts0
#endi #endi
# number of fill values exceeds number of selected columns # number of fill values exceeds number of selected columns
print select count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8) print select _wstart, count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8)
sql select count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8) sql select _wstart, count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8)
$val = $rowNum * 2 $val = $rowNum * 2
$val = $val - 1 $val = $val - 1
print $rows $val
if $rows != $val then if $rows != $val then
return -1 return -1
endi endi
......
...@@ -67,8 +67,6 @@ while $i < $half ...@@ -67,8 +67,6 @@ while $i < $half
$tstart = 100000 $tstart = 100000
endw endw
sleep 100
$i1 = 1 $i1 = 1
$i2 = 0 $i2 = 0
...@@ -85,7 +83,7 @@ $ts1 = $tb1 . .ts ...@@ -85,7 +83,7 @@ $ts1 = $tb1 . .ts
$ts2 = $tb2 . .ts $ts2 = $tb2 . .ts
print ===============================groupby_operation print ===============================groupby_operation
sql select count(*),c1 from group_tb0 where c1 < 20 group by c1; sql select count(*),c1 from group_tb0 where c1 < 20 group by c1 order by c1;
if $row != 20 then if $row != 20 then
return -1 return -1
endi endi
...@@ -106,7 +104,7 @@ if $data11 != 1 then ...@@ -106,7 +104,7 @@ if $data11 != 1 then
return -1 return -1
endi endi
sql select first(ts),c1 from group_tb0 where c1<20 group by c1; sql select first(ts),c1 from group_tb0 where c1 < 20 group by c1 order by c1;
if $row != 20 then if $row != 20 then
return -1 return -1
endi endi
...@@ -127,7 +125,7 @@ if $data91 != 9 then ...@@ -127,7 +125,7 @@ if $data91 != 9 then
return -1 return -1
endi endi
sql select first(ts), ts, c1 from group_tb0 where c1 < 20 group by c1; sql select first(ts), ts, c1 from group_tb0 where c1 < 20 group by c1 order by c1;
print $row print $row
if $row != 20 then if $row != 20 then
return -1 return -1
...@@ -161,7 +159,7 @@ if $data92 != 9 then ...@@ -161,7 +159,7 @@ if $data92 != 9 then
return -1 return -1
endi endi
sql select sum(c1), c1, avg(c1), min(c1), max(c2) from group_tb0 where c1 < 20 group by c1; sql select sum(c1), c1, avg(c1), min(c1), max(c2) from group_tb0 where c1 < 20 group by c1 order by c1;
if $row != 20 then if $row != 20 then
return -1 return -1
endi endi
...@@ -211,20 +209,20 @@ if $data14 != 1.00000 then ...@@ -211,20 +209,20 @@ if $data14 != 1.00000 then
endi endi
sql_error select sum(c1), ts, c1 from group_tb0 where c1<20 group by c1; sql_error select sum(c1), ts, c1 from group_tb0 where c1<20 group by c1;
sql_error select first(ts), ts, c2 from group_tb0 where c1 < 20 group by c1; sql select first(ts), ts, c2 from group_tb0 where c1 < 20 group by c1;
sql_error select sum(c3), ts, c2 from group_tb0 where c1 < 20 group by c1; sql_error select sum(c3), ts, c2 from group_tb0 where c1 < 20 group by c1;
sql_error select sum(c3), first(ts), c2 from group_tb0 where c1 < 20 group by c1; sql_error select sum(c3), first(ts), c2 from group_tb0 where c1 < 20 group by c1;
sql_error select first(c3), ts, c1, c2 from group_tb0 where c1 < 20 group by c1; sql select first(c3), ts, c1, c2 from group_tb0 where c1 < 20 group by c1;
sql_error select first(c3), last(c3), ts, c1 from group_tb0 where c1 < 20 group by c1; sql_error select first(c3), last(c3), ts, c1 from group_tb0 where c1 < 20 group by c1;
sql_error select ts from group_tb0 group by c1; sql_error select ts from group_tb0 group by c1;
#===========================interval=====not support====================== #===========================interval=====not support======================
sql_error select count(*), c1 from group_tb0 where c1<20 interval(1y) group by c1; sql_error select count(*), c1 from group_tb0 where c1<20 interval(1y) group by c1;
#=====tbname must be the first in the group by clause===================== #=====tbname must be the first in the group by clause=====================
sql_error select count(*) from group_tb0 where c1 < 20 group by c1, tbname; sql select count(*) from group_tb0 where c1 < 20 group by c1, tbname;
#super table group by normal columns #super table group by normal columns
sql select count(*), c1 from group_mt0 where c1< 20 group by c1; sql select count(*), c1 from group_mt0 where c1< 20 group by c1 order by c1;
if $row != 20 then if $row != 20 then
return -1 return -1
endi endi
...@@ -253,7 +251,7 @@ if $data91 != 9 then ...@@ -253,7 +251,7 @@ if $data91 != 9 then
return -1 return -1
endi endi
sql select first(c1), c1, ts from group_mt0 where c1<20 group by c1; sql select first(c1), c1, ts from group_mt0 where c1<20 group by c1 order by c1;
if $row != 20 then if $row != 20 then
return -1 return -1
endi endi
...@@ -290,7 +288,7 @@ if $data92 != @70-01-01 08:01:40.009@ then ...@@ -290,7 +288,7 @@ if $data92 != @70-01-01 08:01:40.009@ then
return -1 return -1
endi endi
sql select first(c1), last(ts), first(ts), last(c1),c1,sum(c1),avg(c1),count(*) from group_mt0 where c1<20 group by c1; sql select first(c1), last(ts), first(ts), last(c1),c1,sum(c1),avg(c1),count(*) from group_mt0 where c1<20 group by c1 order by c1;
if $row != 20 then if $row != 20 then
return -1 return -1
endi endi
...@@ -351,7 +349,7 @@ if $data94 != 9 then ...@@ -351,7 +349,7 @@ if $data94 != 9 then
return -1 return -1
endi endi
sql select c1,sum(c1),avg(c1),count(*) from group_mt0 where c1<5 group by c1; sql select c1,sum(c1),avg(c1),count(*) from group_mt0 where c1<5 group by c1 order by c1;
if $row != 5 then if $row != 5 then
return -1 return -1
endi endi
...@@ -364,7 +362,7 @@ if $data11 != 800 then ...@@ -364,7 +362,7 @@ if $data11 != 800 then
return -1 return -1
endi endi
sql select first(c1), last(ts), first(ts), last(c1),sum(c1),avg(c1),count(*) from group_mt0 where c1<20 group by tbname,c1; sql select first(c1), last(ts), first(ts), last(c1),sum(c1),avg(c1),count(*),tbname from group_mt0 where c1<20 group by tbname, c1 order by c1;
if $row != 160 then if $row != 160 then
return -1 return -1
endi endi
...@@ -395,39 +393,8 @@ if $data06 != 100 then ...@@ -395,39 +393,8 @@ if $data06 != 100 then
return -1 return -1
endi endi
if $data07 != @group_tb0@ then
return -1
endi
if $data90 != 9 then
return -1
endi
if $data91 != @70-01-01 08:01:49.909@ then
return -1
endi
if $data92 != @70-01-01 08:01:40.009@ then
return -1
endi
if $data93 != 9 then
return -1
endi
if $data94 != 900 then
return -1
endi
if $data96 != 100 then
return -1
endi
if $data97 != @group_tb0@ then
return -1
endi
sql select count(*),first(ts),last(ts),min(c3) from group_tb1 group by c4; sql select count(*),first(ts),last(ts),min(c3) from group_tb1 group by c4 order by c4;
if $rows != 10000 then if $rows != 10000 then
return -1 return -1
endi endi
...@@ -469,7 +436,7 @@ if $rows != 100 then ...@@ -469,7 +436,7 @@ if $rows != 100 then
return -1 return -1
endi endi
sql select count(*),sum(c4), count(c4), sum(c4)/count(c4) from group_tb1 group by c8 sql select count(*),sum(c4), count(c4), sum(c4)/count(c4) from group_tb1 group by c8 order by c8;
if $rows != 100 then if $rows != 100 then
return -1 return -1
endi endi
...@@ -504,12 +471,12 @@ if $data13 != 4951.000000000 then ...@@ -504,12 +471,12 @@ if $data13 != 4951.000000000 then
endi endi
print ====================> group by normal column + slimit + soffset print ====================> group by normal column + slimit + soffset
sql select count(*), c8 from group_mt0 group by c8 limit 1 offset 0; sql select count(*), c8 from group_mt0 group by c8 limit 100 offset 0;
if $rows != 100 then if $rows != 100 then
return -1 return -1
endi endi
sql select sum(c2),c8,avg(c2), sum(c2)/count(*) from group_mt0 group by c8 slimit 2 soffset 99 sql select sum(c2),c8,avg(c2), sum(c2)/count(*) from group_mt0 partition by c8 order by c8 slimit 2 soffset 99
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
...@@ -531,7 +498,7 @@ if $data03 != 99.000000000 then ...@@ -531,7 +498,7 @@ if $data03 != 99.000000000 then
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; sql select percentile(c4, 49),min(c4),max(c4),avg(c4),stddev(c4) from group_tb0 group by c8 order by c8;
if $rows != 100 then if $rows != 100 then
return -1 return -1
endi endi
...@@ -577,7 +544,7 @@ if $data14 != 2886.607004772 then ...@@ -577,7 +544,7 @@ if $data14 != 2886.607004772 then
endi endi
print ================>td-2090 print ================>td-2090
sql select leastsquares(c2, 1, 1) from group_tb1 group by c8; sql select leastsquares(c2, 1, 1) from group_tb1 group by c8 order by c8;;
if $rows != 100 then if $rows != 100 then
return -1 return -1
endi endi
...@@ -607,13 +574,13 @@ print =================>TD-2665 ...@@ -607,13 +574,13 @@ print =================>TD-2665
sql_error create table txx as select avg(c) as t from st; sql_error create table txx as select avg(c) as t from st;
sql_error create table txx1 as select avg(c) as t from t1; sql_error create table txx1 as select avg(c) as t from t1;
sql select stddev(c),stddev(c) from st group by c; sql select stddev(c),stddev(c) from st group by c order by c;
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
print =================>TD-2236 print =================>TD-2236
sql select first(ts),last(ts) from t1 group by c; sql select first(ts),last(ts) from t1 group by c order by c;
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
...@@ -651,7 +618,7 @@ if $data31 != @20-03-27 05:10:19.000@ then ...@@ -651,7 +618,7 @@ if $data31 != @20-03-27 05:10:19.000@ then
endi endi
print ===============> print ===============>
sql select stddev(c),c from st where t2=1 or t2=2 group by c; sql select stddev(c),c from st where t2=1 or t2=2 group by c order by c;
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
...@@ -689,14 +656,11 @@ if $data31 != 4 then ...@@ -689,14 +656,11 @@ if $data31 != 4 then
endi endi
sql_error select irate(c) from st where t1="1" and ts >= '2020-03-27 04:11:17.732' and ts < '2020-03-27 05:11:17.732' interval(1m) sliding(15s) group by tbname,c; sql_error select irate(c) from st where t1="1" and ts >= '2020-03-27 04:11:17.732' and ts < '2020-03-27 05:11:17.732' interval(1m) sliding(15s) group by tbname,c;
sql select irate(c) from st where t1="1" and ts >= '2020-03-27 04:11:17.732' and ts < '2020-03-27 05:11:17.732' interval(1m) sliding(15s) group by tbname,t1,t2; sql select _wstart, irate(c), tbname, t1, t2 from st where t1=1 and ts >= '2020-03-27 04:11:17.732' and ts < '2020-03-27 05:11:17.732' partition by tbname,t1,t2 interval(1m) sliding(15s) order by tbname;
if $rows != 40 then if $rows != 40 then
return -1 return -1
endi endi
if $data01 != 1.000000000 then
return -1
endi
if $data02 != t1 then if $data02 != t1 then
return -1 return -1
endi endi
...@@ -707,9 +671,6 @@ if $data04 != 1 then ...@@ -707,9 +671,6 @@ if $data04 != 1 then
return -1 return -1
endi endi
if $data11 != 1.000000000 then
return -1
endi
if $data12 != t1 then if $data12 != t1 then
return -1 return -1
endi endi
...@@ -720,21 +681,21 @@ if $data14 != 1 then ...@@ -720,21 +681,21 @@ if $data14 != 1 then
return -1 return -1
endi endi
sql select irate(c) from st where t1="1" and ts >= '2020-03-27 04:11:17.732' and ts < '2020-03-27 05:11:17.732' interval(1m) sliding(15s) group by tbname,t1,t2 limit 1; sql select _wstart, irate(c), tbname, t1, t2 from st where t1=1 and ts >= '2020-03-27 04:11:17.732' and ts < '2020-03-27 05:11:17.732' partition by tbname, t1, t2 interval(1m) sliding(15s) order by tbname desc limit 1;
if $rows != 2 then if $rows != 1 then
return -1 return -1
endi endi
if $data11 != 1.000000000 then if $data01 != 1.000000000 then
return -1 return -1
endi endi
if $data12 != t2 then if $data02 != t2 then
return -1 return -1
endi endi
if $data13 != 1 then if $data03 != 1 then
return -1 return -1
endi endi
if $data14 != 2 then if $data04 != 2 then
return -1 return -1
endi endi
...@@ -748,16 +709,12 @@ sql insert into tm1 values('2020-2-1 1:1:1', 2, 10); ...@@ -748,16 +709,12 @@ sql insert into tm1 values('2020-2-1 1:1:1', 2, 10);
sql insert into tm1 values('2020-2-1 1:1:2', 2, 20); sql insert into tm1 values('2020-2-1 1:1:2', 2, 20);
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
sleep 100
sql connect sql connect
sleep 100
sql use group_db0; sql use group_db0;
print =========================>TD-4894 print =========================>TD-4894
sql select count(*),k from m1 group by k; sql select count(*),k from m1 group by k order by k;
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
...@@ -778,14 +735,13 @@ if $data11 != 2 then ...@@ -778,14 +735,13 @@ if $data11 != 2 then
return -1 return -1
endi endi
sql_error select count(*) from m1 group by tbname,k,f1; sql select count(*) from m1 group by tbname,k,f1;
sql_error select count(*) from m1 group by tbname,k,a; sql select count(*) from m1 group by tbname,k,a;
sql_error select count(*) from m1 group by k, tbname; sql select count(*) from m1 group by k, tbname;
sql_error select count(*) from m1 group by k,f1; sql select count(*) from m1 group by k,f1;
sql_error select count(*) from tm0 group by tbname; sql select count(*) from tm0 group by tbname;
sql_error select count(*) from tm0 group by a; sql select count(*) from tm0 group by a;
sql_error select count(*) from tm0 group by k,f1; sql select count(*) from tm0 group by k,f1;
sql_error select count(*),f1 from m1 group by tbname,k; sql_error select count(*),f1 from m1 group by tbname,k;
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册