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

test: restore 2.0 case

上级 f52ad00d
......@@ -104,7 +104,7 @@
## ./test.sh -f tsim/parser/create_tb_with_tag_name.sim
# ./test.sh -f tsim/parser/dbtbnameValidate.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.sim
./test.sh -f tsim/parser/first_last.sim
......@@ -112,8 +112,8 @@
## ./test.sh -f tsim/parser/function.sim
./test.sh -f tsim/parser/groupby-basic.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.sim
## ./test.sh -f tsim/parser/import.sim
# ./test.sh -f tsim/parser/import_commit1.sim
# ./test.sh -f tsim/parser/import_commit2.sim
......
......@@ -97,10 +97,11 @@ $tsu = $tsu + $ts0
#endi
# 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)
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)
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 _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 = $val - 1
print $rows $val
if $rows != $val then
return -1
endi
......
......@@ -67,8 +67,6 @@ while $i < $half
$tstart = 100000
endw
sleep 100
$i1 = 1
$i2 = 0
......@@ -85,7 +83,7 @@ $ts1 = $tb1 . .ts
$ts2 = $tb2 . .ts
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
return -1
endi
......@@ -106,7 +104,7 @@ if $data11 != 1 then
return -1
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
return -1
endi
......@@ -127,7 +125,7 @@ if $data91 != 9 then
return -1
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
if $row != 20 then
return -1
......@@ -161,7 +159,7 @@ if $data92 != 9 then
return -1
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
return -1
endi
......@@ -211,20 +209,20 @@ if $data14 != 1.00000 then
endi
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), 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 ts from group_tb0 group by c1;
#===========================interval=====not support======================
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=====================
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
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
return -1
endi
......@@ -253,7 +251,7 @@ if $data91 != 9 then
return -1
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
return -1
endi
......@@ -290,7 +288,7 @@ if $data92 != @70-01-01 08:01:40.009@ then
return -1
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
return -1
endi
......@@ -351,7 +349,7 @@ if $data94 != 9 then
return -1
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
return -1
endi
......@@ -364,7 +362,7 @@ if $data11 != 800 then
return -1
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
return -1
endi
......@@ -395,39 +393,8 @@ if $data06 != 100 then
return -1
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
return -1
endi
......@@ -469,7 +436,7 @@ if $rows != 100 then
return -1
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
return -1
endi
......@@ -504,12 +471,12 @@ if $data13 != 4951.000000000 then
endi
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
return -1
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
return -1
endi
......@@ -531,7 +498,7 @@ if $data03 != 99.000000000 then
endi
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
return -1
endi
......@@ -577,7 +544,7 @@ if $data14 != 2886.607004772 then
endi
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
return -1
endi
......@@ -607,13 +574,13 @@ print =================>TD-2665
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 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
return -1
endi
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
return -1
endi
......@@ -651,7 +618,7 @@ if $data31 != @20-03-27 05:10:19.000@ then
endi
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
return -1
endi
......@@ -689,14 +656,11 @@ if $data31 != 4 then
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 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
return -1
endi
if $data01 != 1.000000000 then
return -1
endi
if $data02 != t1 then
return -1
endi
......@@ -707,9 +671,6 @@ if $data04 != 1 then
return -1
endi
if $data11 != 1.000000000 then
return -1
endi
if $data12 != t1 then
return -1
endi
......@@ -720,21 +681,21 @@ if $data14 != 1 then
return -1
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;
if $rows != 2 then
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 != 1 then
return -1
endi
if $data11 != 1.000000000 then
if $data01 != 1.000000000 then
return -1
endi
if $data12 != t2 then
if $data02 != t2 then
return -1
endi
if $data13 != 1 then
if $data03 != 1 then
return -1
endi
if $data14 != 2 then
if $data04 != 2 then
return -1
endi
......@@ -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);
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 100
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
sleep 100
sql use group_db0;
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
return -1
endi
......@@ -778,14 +735,13 @@ if $data11 != 2 then
return -1
endi
sql_error select count(*) from m1 group by tbname,k,f1;
sql_error select count(*) from m1 group by tbname,k,a;
sql_error select count(*) from m1 group by k, tbname;
sql_error select count(*) from m1 group by k,f1;
sql_error select count(*) from tm0 group by tbname;
sql_error select count(*) from tm0 group by a;
sql_error select count(*) from tm0 group by k,f1;
sql select count(*) from m1 group by tbname,k,f1;
sql select count(*) from m1 group by tbname,k,a;
sql select count(*) from m1 group by k, tbname;
sql select count(*) from m1 group by k,f1;
sql select count(*) from tm0 group by tbname;
sql select count(*) from tm0 group by a;
sql select count(*) from tm0 group by k,f1;
sql_error select count(*),f1 from m1 group by tbname,k;
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -27,7 +27,7 @@ sql insert into tb1 values (now+100s,4,4.0,4.0,4,4,4,true ,"4","4")
sql insert into tb1 values (now+150s,4,4.0,4.0,4,4,4,false,"4","4")
sql select count(*),f1 from tb1 group by f1 having count(f1) > 0;
sql select count(*),f1 from tb1 group by f1 having count(f1) > 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -57,7 +57,7 @@ if $data31 != 4 then
endi
sql select count(*),f1 from tb1 group by f1 having count(*) > 0;
sql select count(*),f1 from tb1 group by f1 having count(*) > 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -86,8 +86,7 @@ if $data31 != 4 then
return -1
endi
sql select count(*),f1 from tb1 group by f1 having count(f2) > 0;
sql select count(*),f1 from tb1 group by f1 having count(f2) > 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -118,7 +117,7 @@ endi
sql_error select top(f1,2) from tb1 group by f1 having count(f2) > 0;
sql select last(f1) from tb1 group by f1 having count(f2) > 0;
sql select last(f1) from tb1 group by f1 having count(f2) > 0 order by f1;;
if $rows != 4 then
return -1
endi
......@@ -141,7 +140,7 @@ sql_error select top(f1,2) from tb1 group by f1 having count(f2) > 0;
sql_error select top(f1,2) from tb1 group by f1 having avg(f1) > 0;
sql select avg(f1),count(f1) from tb1 group by f1 having avg(f1) > 2;
sql select avg(f1),count(f1) from tb1 group by f1 having avg(f1) > 2 order by f1;
if $rows != 2 then
return -1
endi
......@@ -158,8 +157,7 @@ if $data11 != 2 then
return -1
endi
sql select avg(f1),count(f1) from tb1 group by f1 having avg(f1) > 2 and sum(f1) > 0;
sql select avg(f1),count(f1) from tb1 group by f1 having avg(f1) > 2 and sum(f1) > 0 order by f1;
if $rows != 2 then
return -1
endi
......@@ -176,7 +174,7 @@ if $data11 != 2 then
return -1
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having avg(f1) > 2 and sum(f1) > 0;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having avg(f1) > 2 and sum(f1) > 0 order by f1;
if $rows != 2 then
return -1
endi
......@@ -199,7 +197,7 @@ if $data12 != 8 then
return -1
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having avg(f1) > 2;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having avg(f1) > 2 order by f1;
if $rows != 2 then
return -1
endi
......@@ -222,7 +220,7 @@ if $data12 != 8 then
return -1
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 0;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -263,7 +261,7 @@ if $data32 != 8 then
return -1
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 2 and sum(f1) < 6;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 2 and sum(f1) < 6 order by f1;
if $rows != 1 then
return -1
endi
......@@ -278,7 +276,7 @@ if $data02 != 4 then
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having 1 <= sum(f1) and 5 >= sum(f1);
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having 1 <= sum(f1) and 5 >= sum(f1) order by f1;
if $rows != 2 then
return -1
endi
......@@ -309,7 +307,7 @@ sql_error select avg(f1),count(f1),sum(f1),twa(f1) from tb1 group by tbname havi
sql_error select avg(f1),count(f1),sum(f1),twa(f1) from tb1 group by f1 having sum(f1) = 4;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 0;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -350,7 +348,7 @@ if $data32 != 8 then
return -1
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 order by f1;
if $rows != 3 then
return -1
endi
......@@ -383,7 +381,7 @@ if $data22 != 8 then
endi
###########and issue
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 and sum(f1) > 1;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 and sum(f1) > 1 order by f1;
if $rows != 4 then
return -1
endi
......@@ -425,7 +423,7 @@ if $data32 != 8 then
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or sum(f1) > 1;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or sum(f1) > 1 order by f1;
if $rows != 4 then
return -1
endi
......@@ -466,7 +464,7 @@ if $data32 != 8 then
return -1
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or sum(f1) > 4;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or sum(f1) > 4 order by f1;
if $rows != 3 then
return -1
endi
......@@ -499,12 +497,12 @@ if $data22 != 8 then
endi
############or issue
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or avg(f1) > 4;
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or avg(f1) > 4 order by f1;
if $rows != 0 then
return -1
endi
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having (sum(f1) > 3);
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having (sum(f1) > 3) order by f1;
if $rows != 3 then
return -1
endi
......@@ -538,7 +536,7 @@ endi
sql_error select avg(f1),count(f1),sum(f1) from tb1 group by f1 having (sum(*) > 3);
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having (sum(tb1.f1) > 3);
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having (sum(tb1.f1) > 3) order by f1;
if $rows != 3 then
return -1
endi
......@@ -570,7 +568,7 @@ if $data22 != 8 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1) from tb1 group by f1 having (sum(tb1.f1) > 3);
sql select avg(f1),count(tb1.*),sum(f1) from tb1 group by f1 having (sum(tb1.f1) > 3) order by f1;
if $rows != 3 then
return -1
endi
......@@ -602,7 +600,7 @@ if $data22 != 8 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),stddev(f1) from tb1 group by f1;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),stddev(f1) from tb1 group by f1 order by f1;
if $rows != 4 then
return -1
endi
......@@ -667,12 +665,12 @@ if $data34 != 0.000000000 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having (stddev(tb1.f1) > 3);
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having (stddev(tb1.f1) > 3) order by f1;
if $rows != 0 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having (stddev(tb1.f1) < 1);
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having (stddev(tb1.f1) < 1) order by f1;
if $rows != 4 then
return -1
endi
......@@ -736,7 +734,7 @@ sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 ha
sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1),LEASTSQUARES(f1,1,1) from tb1 group by f1 having LEASTSQUARES(f1,1,1) > 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),LEASTSQUARES(f1,1,1) from tb1 group by f1 having sum(f1) > 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),LEASTSQUARES(f1,1,1) from tb1 group by f1 having sum(f1) > 2 order by f1;
if $rows != 3 then
return -1
endi
......@@ -777,7 +775,7 @@ if $data23 != 0.000000000 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having min(f1) > 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having min(f1) > 2 order by f1;
if $rows != 2 then
return -1
endi
......@@ -806,7 +804,7 @@ if $data13 != 0.000000000 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1) from tb1 group by f1 having min(f1) > 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1) from tb1 group by f1 having min(f1) > 2 order by f1;
if $rows != 2 then
return -1
endi
......@@ -841,7 +839,7 @@ if $data14 != 4 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1) from tb1 group by f1 having max(f1) > 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1) from tb1 group by f1 having max(f1) > 2 order by f1;
if $rows != 2 then
return -1
endi
......@@ -876,7 +874,7 @@ if $data14 != 4 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1) from tb1 group by f1 having max(f1) != 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1) from tb1 group by f1 having max(f1) != 2 order by f1;
if $rows != 3 then
return -1
endi
......@@ -935,7 +933,7 @@ if $data25 != 4 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1) from tb1 group by f1 having first(f1) != 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1) from tb1 group by f1 having first(f1) != 2 order by f1;
if $rows != 3 then
return -1
endi
......@@ -996,7 +994,7 @@ endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1),first(f1) from tb1 group by f1 having first(f1) != 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1),first(f1) from tb1 group by f1 having first(f1) != 2 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1078,7 +1076,7 @@ sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1),first(f
sql_error select PERCENTILE(f1) from tb1 group by f1 having sum(f1) > 1;
sql select PERCENTILE(f1,20) from tb1 group by f1 having sum(f1) = 4;
sql select PERCENTILE(f1,20) from tb1 group by f1 having sum(f1) = 4 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1086,7 +1084,7 @@ if $data00 != 2.000000000 then
return -1
endi
sql select aPERCENTILE(f1,20) from tb1 group by f1 having sum(f1) > 1;
sql select aPERCENTILE(f1,20) from tb1 group by f1 having sum(f1) > 1 order by f1;
if $rows != 4 then
return -1
endi
......@@ -1103,7 +1101,7 @@ if $data30 != 4.000000000 then
return -1
endi
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1;
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1117,7 +1115,7 @@ if $data20 != 4.000000000 then
return -1
endi
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,1) < 50;
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,1) < 50 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1131,7 +1129,7 @@ if $data20 != 4.000000000 then
return -1
endi
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,1) < 3;
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,1) < 3 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1139,7 +1137,7 @@ if $data00 != 2.000000000 then
return -1
endi
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,3) < 3;
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,3) < 3 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1161,12 +1159,12 @@ sql_error select avg(f1),diff(f1) from tb1 group by f1 having avg(f1) > 0;
sql_error select avg(f1),diff(f1) from tb1 group by f1 having spread(f2) > 0;
sql select avg(f1) from tb1 group by f1 having spread(f2) > 0;
sql select avg(f1) from tb1 group by f1 having spread(f2) > 0 order by f1;
if $rows != 0 then
return -1
endi
sql select avg(f1) from tb1 group by f1 having spread(f2) = 0;
sql select avg(f1) from tb1 group by f1 having spread(f2) = 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -1183,7 +1181,7 @@ if $data30 != 4.000000000 then
return -1
endi
sql select avg(f1),spread(f2) from tb1 group by f1;
sql select avg(f1),spread(f2) from tb1 group by f1 order by f1;
if $rows != 4 then
return -1
endi
......@@ -1212,7 +1210,7 @@ if $data31 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) = 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) = 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -1265,7 +1263,7 @@ if $data33 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) != 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) != 0 order by f1;
if $rows != 0 then
return -1
endi
......@@ -1301,12 +1299,12 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) > id1 and sum(f1) > 1;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) > 2 and sum(f1) > 1;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) > 2 and sum(f1) > 1 order by f1;
if $rows != 0 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) = 0 and sum(f1) > 1;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) = 0 and sum(f1) > 1 order by f1;
if $rows != 4 then
return -1
endi
......@@ -1359,7 +1357,7 @@ if $data33 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) = 0 and avg(f1) > 1;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having spread(f1) = 0 and avg(f1) > 1 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1410,7 +1408,7 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1),avg(id1) from tb1 group by id1 hav
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having avg(f1) > 0 and avg(f1) = 3;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having avg(f1) > 0 and avg(f1) = 3 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1430,7 +1428,7 @@ endi
#sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having avg(f1) < 0 and avg(f1) = 3;
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) < 2;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f1 > 0 group by f1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f1 > 0 group by f1 having avg(f1) > 0 order by f1;
if $rows != 4 then
return -1
endi
......@@ -1483,7 +1481,7 @@ if $data33 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f1 > 2 group by f1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f1 > 2 group by f1 having avg(f1) > 0 order by f1;
if $rows != 2 then
return -1
endi
......@@ -1512,7 +1510,7 @@ if $data13 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 2 group by f1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 2 group by f1 having avg(f1) > 0 order by f1;
if $rows != 2 then
return -1
endi
......@@ -1541,7 +1539,7 @@ if $data13 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f3 > 2 group by f1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f3 > 2 group by f1 having avg(f1) > 0 order by f1;
if $rows != 2 then
return -1
endi
......@@ -1570,7 +1568,7 @@ if $data13 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having avg(f1) > 0 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1595,7 +1593,7 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having avg(f9) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having count(f9) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having count(f9) > 0 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1614,7 +1612,7 @@ endi
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having last(f9) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having last(f2) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having last(f2) > 0 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1631,7 +1629,7 @@ if $data03 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having last(f3) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 3 group by f1 having last(f3) > 0 order by f1;
if $rows != 1 then
return -1
endi
......@@ -1648,7 +1646,7 @@ if $data03 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f3) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f3) > 0 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1689,7 +1687,7 @@ if $data23 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f4) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f4) > 0 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1730,7 +1728,7 @@ if $data23 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f5) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f5) > 0 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1771,7 +1769,7 @@ if $data23 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f6) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by f1 having last(f6) > 0 order by f1;
if $rows != 3 then
return -1
endi
......@@ -1823,7 +1821,7 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1),f1,f6 from tb1 where f2 > 1 group
sql_error select avg(f1),spread(f1,f2,tb1.f1),f1,f6 from tb1 where f2 > 1 group by id1 having last(f6) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 and f2 < 4 group by f1 having last(f6) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 and f2 < 4 group by f1 having last(f6) > 0 order by f1;
if $rows != 2 then
return -1
endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册