sql select $ts1 , $ts2 from $tb1 , $tb2 where $ts1 = $ts2
$val = $rowNum
if $rows != $val then
return -1
endi
# select star1
sql select join_tb1.*, join_tb0.ts from $tb1 , $tb2 where $ts1 = $ts2
$val = $rowNum
if $rows != $val then
return -1
endi
# select star2
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2
$val = $rowNum
if $rows != $val then
return -1
endi
# select star2
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 limit 10;
$val = 10
if $rows != $val then
return -1
endi
# select star2
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 limit 10;
$val = 10
if $rows != $val then
return -1
endi
# select star2
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 limit 0;
$val = 0
if $rows != $val then
return -1
endi
# select star2
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 limit 0;
$val = 0
if $rows != $val then
return -1
endi
#select + where condition
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts = 100000 limit 10;
$val = 1
if $rows != $val then
return -1
endi
#select + where condition
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts >= 100000 and join_tb0.c7 = false limit 10;
$val = 10
if $rows != $val then
return -1
endi
#select + where condition
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts >= 100000 and join_tb0.c7 = false limit 10 offset 1;
print $rows
if $rows != 9 then
return -1
endi
if $data00 != @70-01-01 08:01:40.100@ then
print $data00
return -1
endi
if $data10 != @70-01-01 08:01:40.200@ then
print $data10
return -1
endi
print data06 = $data06
print data07 = $data07
print data08 = $data08
print data00 = $data00
if $data07 != 0 then
return -1
endi
#select + where condition ======reverse query
sql select join_tb1.*, join_tb0.* from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts >= 100000 and join_tb0.c7 = true order by join_tb0.ts asc limit 1;
print select count(join_tb1.*) from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts >= 100000 and join_tb0.c7 = true interval(10a) order by _wstart desc;
sql select count(join_tb1.*) from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts >= 100000 and join_tb0.c7 = true interval(10a) order by _wstart desc;
sql select count(join_tb1.*), count(join_tb0.*) from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts >= 100000 and join_tb0.c7 = false;
$val = 10
if $data00 != $val then
return -1
endi
if $data01 != $val then
return -1
endi
sql select count(join_tb1.*) + count(join_tb0.*) from join_tb1 , join_tb0 where join_tb1.ts = join_tb0.ts and join_tb1.ts >= 100000 and join_tb0.c7 = false;;
if $rows != 1 then
return -1
endi
if $data00 != 20.000000000 then
print expect 20.000000000 actual $data00
return -1
endi
sql select count(join_tb1.*)/10 from join_tb1 , join_tb0 where join_tb1.ts = join_tb0.ts and join_tb1.ts >= 100000 and join_tb0.c7 = false;;
if $data00 != 1.000000000 then
return -1
endi
print 3
#agg + where condition
sql select count(join_tb1.c3), count(join_tb0.ts) from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts <= 100002 and join_tb0.c7 = true;
if $rows != 1 then
return -1
endi
print $data00
if $data00 != 2 then
return -1
endi
if $data01 != 2 then
return -1
endi
print 4
#agg + where condition
sql select count(join_tb1.c3), count(join_tb0.ts), sum(join_tb0.c1), first(join_tb0.c7), last(join_tb1.c3), first(join_tb0.*) from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts <= 100002 and join_tb0.c7 = true;
$val = 2
if $data00 != $val then
return -1
endi
if $data01 != $val then
return -1
endi
if $data02 != 3 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 2 then
return -1
endi
print =============== join.sim -- error sql
sql_error select count(join_tb1.c3), count(join_tb0.ts), sum(join_tb0.c1), first(join_tb0.c7), last(join_tb1.c3) from $tb1 , $tb2 where join_tb1.ts <= 100002 and join_tb0.c7 = true;
sql_error select count(join_tb1.c3), last(join_tb1.c3) from $tb1 , $tb2 where join_tb1.ts = join_tb0.ts or join_tb1.ts <= 100002 and join_tb0.c7 = true;
sql_error select count(join_tb3.*) from $tb1 , $tb2 where join_tb1.ts = join_tb0.ts and join_tb1.ts <= 100002 and join_tb0.c7 = true;
sql_error select first(join_tb1.*) from $tb1 , $tb2 where join_tb1.ts = join_tb0.ts and join_tb1.ts <= 100002 or join_tb0.c7 = true;
sql_error select join_tb3.* from $tb1 , $tb2 where join_tb1.ts = join_tb0.ts and join_tb1.ts <= 100002 and join_tb0.c7 = true;
sql select join_mt0.* from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1;
$val = $rowNum + $rowNum
print $val
print $rows
if $rows != $val then
print expect $val , actual:$rows
return -1
endi
sql select join_mt0.* from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1 and join_mt0.ts = 100000;
$val = 2
if $rows != $val then
return -1
endi
sql select join_mt1.* from join_mt1
print $rows
if $rows != 2000 then
return -1
endi
sql select join_mt0.* from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1;
$val = 2000
if $rows != $val then
return -1
endi
sql select join_mt0.* from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1 and join_mt0.c2=99;
$val = 20
if $rows != $val then
return -1
endi
sql select count(*) from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1 and join_mt0.c2=99;
$val = 20
if $data00 != $val then
print expect 20, actual:$data00
return -1
endi
sql select count(*) from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1 and join_mt0.c2=99 and join_mt1.ts=100999;
$val = 2
if $data00 != $val then
return -1
endi
# agg
sql select sum(join_mt0.c1) from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1 and join_mt0.c2=99 and join_mt1.ts=100999;
$val = 198
if $data00 != $val then
return -1
endi
sql select sum(join_mt0.c1)+sum(join_mt0.c1) from join_mt0, join_mt1 where join_mt0.ts = join_mt1.ts and join_mt0.t1=join_mt1.t1 and join_mt0.c2=99 and join_mt1.ts=100999;
sql select count(join_mt0.c1), sum(join_mt1.c2) from join_mt0, join_mt1 where join_mt0.t1=join_mt1.t1 and join_mt0.ts=join_mt1.ts and join_mt0.t1=1 interval(10a) order by _wstart asc;
sql select count(join_mt0.c1), sum(join_mt1.c2) from join_mt0, join_mt1 where join_mt0.t1=join_mt1.t1 and join_mt0.ts=join_mt1.ts and join_mt0.t1=1 interval(10a) order by _wstart desc;
sql select first(join_tb0.c8),first(join_tb0.c9) from join_tb1 , join_tb0 where join_tb1.ts = join_tb0.ts and join_tb1.ts <= 100002 and join_tb1.ts>=100000 interval(1s) fill(linear);
sql select first(join_tb0.c8),first(join_tb0.c9) from join_tb1 , join_tb0 where join_tb1.ts = join_tb0.ts and join_tb1.ts <= 100002 and join_tb0.c7 = true