@@ -946,3 +946,320 @@ sql select cast(cast(cast(cast(ts as bigint) as binary(5)) as bigint)+cast(cast(
if $rows != 0 then
return -1
endi
sql select cast(a as bigint) from (select avg(c2) as a from stb1 interval(1s));
if $rows != 7 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 2 then
return -1
endi
if $data20 != 2 then
return -1
endi
if $data30 != 4 then
return -1
endi
if $data40 != 4 then
return -1
endi
if $data50 != 66 then
return -1
endi
if $data60 != -60 then
return -1
endi
sql select cast(c2 as binary(10)) from (select * from stb1);
if $rows != 14 then
return -1
endi
sql select cast(a as binary(10)) from (select avg(c2) as a from stb1 where ts >= '2021-11-11 09:00:00.000' and ts <= '2021-11-11 09:00:09.000' interval(1s) fill(null));
if $rows != 10 then
return -1
endi
if $data00 != 1.000000 then
return -1
endi
if $data10 != 2.000000 then
return -1
endi
if $data20 != 2.500000 then
return -1
endi
if $data30 != 4.000000 then
return -1
endi
if $data40 != 4.500000 then
return -1
endi
if $data50 != 66.500000 then
return -1
endi
if $data60 != -60.000000 then
return -1
endi
if $data70 != NULL then
return -1
endi
if $data80 != NULL then
return -1
endi
if $data90 != NULL then
return -1
endi
sql select cast(a as bigint) from (select avg(c2) as a from stb1 where ts >= '2021-11-11 09:00:00.000' and ts <= '2021-11-11 09:00:09.000' interval(1s) fill(null)) order by ts;
if $rows != 10 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 2 then
return -1
endi
if $data20 != 2 then
return -1
endi
if $data30 != 4 then
return -1
endi
if $data40 != 4 then
return -1
endi
if $data50 != 66 then
return -1
endi
if $data60 != -60 then
return -1
endi
if $data70 != NULL then
return -1
endi
if $data80 != NULL then
return -1
endi
if $data90 != NULL then
return -1
endi
sql select cast(a as bigint) from (select avg(c2) as a from stb1 where ts >= '2021-11-11 09:00:00.000' and ts <= '2021-11-11 09:00:09.000' interval(1s) fill(null)) order by ts desc;
if $rows != 10 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != -60 then
return -1
endi
if $data40 != 66 then
return -1
endi
if $data50 != 4 then
return -1
endi
if $data60 != 4 then
return -1
endi
if $data70 != 2 then
return -1
endi
if $data80 != 2 then
return -1
endi
if $data90 != 1 then
return -1
endi
sql select cast(a as bigint) from (select avg(c2) as a from stb1 where ts >= '2021-11-11 09:00:00.000' and ts <= '2021-11-11 09:00:09.000' interval(1s) fill(null)) order by a desc;
if $rows != 10 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != 66 then
return -1
endi
if $data40 != 4 then
return -1
endi
if $data50 != 4 then
return -1
endi
if $data60 != 2 then
return -1
endi
if $data70 != 2 then
return -1
endi
if $data80 != 1 then
return -1
endi
if $data90 != -60 then
return -1
endi
sql select cast(a as bigint) from (select avg(c2) as a from stb1 where ts >= '2021-11-11 09:00:00.000' and ts <= '2021-11-11 09:00:09.000' interval(1s) fill(null)) order by a;
if $rows != 10 then
return -1
endi
if $data00 != -60 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 2 then
return -1
endi
if $data30 != 2 then
return -1
endi
if $data40 != 4 then
return -1
endi
if $data50 != 4 then
return -1
endi
if $data60 != 66 then
return -1
endi
if $data70 != NULL then
return -1
endi
if $data80 != NULL then
return -1
endi
if $data90 != NULL then
return -1
endi
sql select cast(a as bigint) from (select cast(c2 as binary(2)) as a from tb1);
if $rows != 7 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != 2 then
return -1
endi
if $data30 != NULL then
return -1
endi
if $data40 != 4 then
return -1
endi
if $data50 != 12 then
return -1
endi
if $data60 != -1 then
return -1
endi
sql select cast(tb1.c3 as binary(10)),cast(tb2.c3 as binary(10)) from tb1,tb2 where tb1.ts=tb2.ts;
if $rows != 7 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data11 != 2 then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data21 != 3 then
return -1
endi
if $data30 != 3 then
return -1
endi
if $data31 != 4 then
return -1
endi
if $data40 != 4 then
return -1
endi
if $data41 != 5 then
return -1
endi
if $data50 != 32767 then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != -32767 then
return -1
endi
if $data61 != 7 then
return -1
endi
sql select cast(c3 as binary(10)) from tb1 union all select cast(c3 as binary(10)) from tb2;