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 join_tb0.ts desc;
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 asc;
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 asc;
$val = 100
if $rows != $val then
return -1
endi
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(*) from sliding_tb0 interval(30s) sliding(30s);
sql select _wstart, count(*) from sliding_tb0 interval(30s) sliding(30s);
if $row != 10 then
if $row != 10 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 1000 then
if $data01 != 1000 then
return -1
return -1
endi
endi
if $data10 != @00-01-01 00:00:30.000@ then
if $data10 != @00-01-01 00:00:30.000@ then
return -1
return -1
endi
endi
if $data11 != 1000 then
if $data11 != 1000 then
return -1
return -1
endi
endi
sql select stddev(c1) from sliding_tb0 interval(10a) sliding(10a)
sql select _wstart, stddev(c1) from sliding_tb0 interval(10a) sliding(10a);
if $row != 10000 then
if $row != 10000 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 0.000000000 then
if $data01 != 0.000000000 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:00:00.270@ then
if $data90 != @00-01-01 00:00:00.270@ then
return -1
return -1
endi
endi
if $data91 != 0.000000000 then
if $data91 != 0.000000000 then
return -1
return -1
endi
endi
sql select stddev(c1),count(c2),first(c3),last(c4) from sliding_tb0 interval(10a) sliding(10a) order by ts desc;
sql select _wstart, stddev(c1),count(c2),first(c3),last(c4) from sliding_tb0 interval(10a) sliding(10a) order by _wstart desc;
if $row != 10000 then
if $row != 10000 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:04:59.970@ then
if $data00 != @00-01-01 00:04:59.970@ then
return -1
return -1
endi
endi
if $data01 != 0.000000000 then
if $data01 != 0.000000000 then
return -1
return -1
endi
endi
if $data02 != 1 then
if $data02 != 1 then
return -1
return -1
endi
endi
if $data03 != 99 then
if $data03 != 99 then
return -1
return -1
endi
endi
if $data04 != 99 then
if $data04 != 99 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:04:59.700@ then
if $data90 != @00-01-01 00:04:59.700@ then
return -1
return -1
endi
endi
if $data91 != 0.000000000 then
if $data91 != 0.000000000 then
return -1
return -1
endi
endi
if $data92 != 1 then
if $data92 != 1 then
return -1
return -1
endi
endi
if $data93 != 90 then
if $data93 != 90 then
return -1
return -1
endi
endi
if $data94 != 90 then
if $data94 != 90 then
return -1
return -1
endi
endi
sql select count(c2),last(c4) from sliding_tb0 interval(30s) sliding(10s) order by ts asc;
sql select _wstart, count(c2),last(c4) from sliding_tb0 interval(30s) sliding(10s) order by _wstart asc;
if $row != 32 then
if $row != 32 then
return -1
return -1
endi
endi
if $data00 != @99-12-31 23:59:40.000@ then
if $data00 != @99-12-31 23:59:40.000@ then
print expect 12-31 23:59:40.000, actual: $data00
print expect 12-31 23:59:40.000, actual: $data00
return -1
return -1
endi
endi
if $data01 != 334 then
if $data01 != 334 then
return -1
return -1
endi
endi
if $data02 != 33 then
if $data02 != 33 then
return -1
return -1
endi
endi
sql select count(c2),stddev(c3),first(c4),last(c4) from sliding_tb0 where ts>'2000-01-01 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by ts asc;
sql select _wstart, count(c2),stddev(c3),first(c4),last(c4) from sliding_tb0 where ts>'2000-01-01 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by _wstart asc;
if $row != 2 then
if $row != 2 then
return -1
return -1
endi
endi
if $data04 != 99 then
if $data04 != 99 then
return -1
return -1
endi
endi
if $data01 != 999 then
if $data01 != 999 then
return -1
return -1
endi
endi
if $data02 != 28.837977152 then
if $data02 != 28.837977152 then
return -1
return -1
endi
endi
#interval offset + limit
#interval offset + limit
sql select count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) sliding(10a) order by ts desc limit 10 offset 990;
sql select _wstart, count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) sliding(10a) order by _wstart desc limit 10 offset 990;
if $row != 10 then
if $row != 10 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:04:30.270@ then
if $data00 != @00-01-01 00:04:30.270@ then
return -1
return -1
endi
endi
if $data01 != 1 then
if $data01 != 1 then
return -1
return -1
endi
endi
if $data02 != 9 then
if $data02 != 9 then
return -1
return -1
endi
endi
if $data03 != 0.000000000 then
if $data03 != 0.000000000 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:04:30.000@ then
if $data90 != @00-01-01 00:04:30.000@ then
return -1
return -1
endi
endi
if $data91 != 1 then
if $data91 != 1 then
return -1
return -1
endi
endi
if $data92 != 0 then
if $data92 != 0 then
return -1
return -1
endi
endi
if $data93 != 0.000000000 then
if $data93 != 0.000000000 then
return -1
return -1
endi
endi
#interval offset test
#interval offset test
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(30s) order by ts asc limit 1000 offset 1;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(30s) order by _wstart asc limit 1000 offset 1;
if $row != 9 then
if $row != 9 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:30.000@ then
if $data00 != @00-01-01 00:00:30.000@ then
return -1
return -1
endi
endi
if $data01 != 1000 then
if $data01 != 1000 then
return -1
return -1
endi
endi
if $data02 != 99 then
if $data02 != 99 then
return -1
return -1
endi
endi
if $data80 != @00-01-01 00:04:30.000@ then
if $data80 != @00-01-01 00:04:30.000@ then
return -1
return -1
endi
endi
if $data81 != 1000 then
if $data81 != 1000 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 where ts>'2000-1-1 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by ts asc limit 1000 offset 0;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 where ts>'2000-1-1 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by _wstart asc limit 1000 offset 0;
if $row != 2 then
if $row != 2 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 999 then
if $data01 != 999 then
return -1
return -1
endi
endi
if $data02 != 99 then
if $data02 != 99 then
return -1
return -1
endi
endi
if $data03 != 28.837977152 then
if $data03 != 28.837977152 then
return -1
return -1
endi
endi
if $data10 != @00-01-01 00:00:30.000@ then
if $data10 != @00-01-01 00:00:30.000@ then
return -1
return -1
endi
endi
if $data11 != 34 then
if $data11 != 34 then
return -1
return -1
endi
endi
if $data12 != 33 then
if $data12 != 33 then
return -1
return -1
endi
endi
if $data13 != 9.810708435 then
if $data13 != 9.810708435 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 1;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 1;
if $row != 15 then
if $row != 15 then
return -1
return -1
endi
endi
if $data00 != @00-01-01 00:00:00.000@ then
if $data00 != @00-01-01 00:00:00.000@ then
return -1
return -1
endi
endi
if $data01 != 1000 then
if $data01 != 1000 then
return -1
return -1
endi
endi
if $data02 != 99 then
if $data02 != 99 then
return -1
return -1
endi
endi
if $data03 != 28.866070048 then
if $data03 != 28.866070048 then
return -1
return -1
endi
endi
if $data90 != @00-01-01 00:03:00.000@ then
if $data90 != @00-01-01 00:03:00.000@ then
return -1
return -1
endi
endi
if $data91 != 1000 then
if $data91 != 1000 then
return -1
return -1
endi
endi
if $data92 != 99 then
if $data92 != 99 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 5;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 5;
if $row != 11 then
if $row != 11 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 6;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 6;
if $row != 10 then
if $row != 10 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 7;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 7;
if $row != 9 then
if $row != 9 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 8;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 8;
if $row != 8 then
if $row != 8 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 9;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 9;
if $row != 7 then
if $row != 7 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 10;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 10;
if $row != 6 then
if $row != 6 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 11;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 11;
if $row != 5 then
if $row != 5 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 12;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 12;
if $row != 4 then
if $row != 4 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 13;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 13;
if $row != 3 then
if $row != 3 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 14;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 14;
if $row != 2 then
if $row != 2 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 15;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 15;
if $row != 1 then
if $row != 1 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 16;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 16;
if $row != 0 then
if $row != 0 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) order by ts desc;
sql select _wstart, count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) order by _wstart desc;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by ts desc limit 1 offset 15;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by _wstart desc limit 1 offset 15;
if $row != 1 then
if $row != 1 then
return -1
return -1
endi
endi
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by ts desc limit 1 offset 16;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by _wstart desc limit 1 offset 16;
if $row != 0 then
if $row != 0 then
return -1
return -1
endi
endi
sql select count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) order by ts desc limit 10 offset 2;
sql select _wstart, count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) order by _wstart desc limit 10 offset 2;
if $data00 != @00-01-01 00:04:59.910@ then
if $data00 != @00-01-01 00:04:59.910@ then
return -1
return -1
endi
endi
sql select count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by ts asc limit 1000;
sql select _wstart, count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by _wstart asc limit 1000;
if $row != 3 then
if $row != 3 then
return -1
return -1
endi
endi
if $data00 != @99-12-31 23:59:40.000@ then
if $data00 != @99-12-31 23:59:40.000@ then
return -1
return -1
endi
endi
if $data02 != 9.521904571 then
if $data02 != 9.521904571 then
return -1
return -1
endi
endi
if $data05 != 33 then
if $data05 != 33 then
return -1
return -1
endi
endi
if $data10 != @99-12-31 23:59:50.000@ then
if $data10 != @99-12-31 23:59:50.000@ then
return -1
return -1
endi
endi
if $data12 != 9.521904571 then
if $data12 != 9.521904571 then
return -1
return -1
endi
endi
if $data15 != 33 then
if $data15 != 33 then
return -1
return -1
endi
endi
if $data25 != 33 then
if $data25 != 33 then
return -1
return -1
endi
endi
sql select count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by ts desc limit 1000;
sql select _wstart, count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by _wstart desc limit 1000;
sql_error select count(*) as a from union_mt0 union all select avg(c1) as a from union_mt0
sql select count(*) as a from union_mt0 union all select avg(c1) as a from union_mt0
sql_error select count(*) as a from union_mt0 union all select spread(c1) as a from union_mt0;
sql select count(*) as a from union_mt0 union all select spread(c1) as a from union_mt0;
## union not supported
## union not supported
sql_error (select count(*) from union_mt0) union (select count(*) from union_mt0);
sql (select count(*) from union_mt0) union (select count(*) from union_mt0);
## column type not identical
## column type not identical
sql_error select c1 from union_mt0 limit 10 union all select c2 from union_tb1 limit 20;
sql_error select c1 from union_mt0 limit 10 union all select c2 from union_tb1 limit 20;
...
@@ -123,145 +123,114 @@ sql (((select c1 from union_tb0)))
...
@@ -123,145 +123,114 @@ sql (((select c1 from union_tb0)))
if $rows != 10000 then
if $rows != 10000 then
return -1
return -1
endi
endi
if $data00 != 0 then
if $data00 != 0 then
return -1
return -1
endi
endi
if $data10 != 1 then
if $data10 != 1 then
return -1
return -1
endi
endi
sql select 'ab' as options from union_tb1 limit 1 union all select 'dd' as options from union_tb0 limit 1;
sql (select 'ab' as options from union_tb1 limit 1) union all (select 'dd' as options from union_tb0 limit 1) order by options;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != @ab@ then
if $data00 != @ab@ then
return -1
return -1
endi
endi
if $data10 != @dd@ then
if $data10 != @dd@ then
return -1
return -1
endi
endi
sql (select 'ab12345' as options from union_tb1 limit 1) union all (select '1234567' as options from union_tb0 limit 1) order by options desc;
sql select 'ab' as options from union_tb1 limit 1 union all select '1234567' as options from union_tb0 limit 1;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != @ab12345@ then
if $data00 != @ab@ then
return -1
return -1
endi
endi
if $data10 != @1234567@ then
if $data10 != @1234567@ then
return -1
return -1
endi
endi
# mixed order
# mixed order
sql select ts, c1 from union_tb1 order by ts asc limit 10 union all select ts, c1 from union_tb0 order by ts desc limit 2 union all select ts, c1 from union_tb2 order by ts asc limit 10
sql (select ts, c1 from union_tb1 order by ts asc limit 10) union all (select ts, c1 from union_tb0 order by ts desc limit 2) union all (select ts, c1 from union_tb2 order by ts asc limit 10) order by ts
if $rows != 22 then
if $rows != 22 then
return -1
return -1
endi
endi
if $data00 != @20-01-05 13:51:24.000@ then
if $data00 != @20-01-05 13:51:24.000@ then
return -1
return -1
endi
endi
if $data01 != 0 then
if $data01 != 0 then
return -1
return -1
endi
endi
if $data10 != @20-01-05 13:51:24.000@ then
if $data10 != @20-01-05 13:52:24.000@ then
return -1
return -1
endi
endi
if $data11 != 0 then
if $data11 != 1 then
return -1
return -1
endi
endi
print $data90 $data91
if $data90 != @20-01-05 14:00:24.000@ then
if $data90 != @20-01-05 13:55:24.000@ then
return -1
return -1
endi
endi
if $data91 != 4 then
if $data91 != 9 then
return -1
return -1
endi
endi
# different sort order
# different sort order
# super table & normal table mixed up
# super table & normal table mixed up
sql select c3 from union_tb0 limit 2 union all select sum(c1) as c3 from union_mt0;
sql (select c3 from union_tb0 limit 2) union all (select sum(c1) as c3 from union_mt0) order by c3;
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data00 != 0 then
if $data00 != 0 then
return -1
return -1
endi
endi
if $data10 != 1 then
if $data10 != 1 then
return -1
return -1
endi
endi
if $data20 != 4950000 then
if $data20 != 4950000 then
return -1
return -1
endi
endi
# type compatible
# type compatible
sql select c3 from union_tb0 limit 2 union all select sum(c1) as c3 from union_tb1;
sql (select c3 from union_tb0 limit 2) union all (select sum(c1) as c3 from union_tb1) order by c3;
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data00 != 0 then
if $data00 != 0 then
return -1
return -1
endi
endi
if $data10 != 1 then
if $data10 != 1 then
return -1
return -1
endi
endi
if $data20 != 495000 then
if $data20 != 495000 then
return -1
return -1
endi
endi
# two join subclause
# two join subclause
sql select count(*) as c from union_tb0, union_tb1 where union_tb0.ts=union_tb1.ts union all select union_tb0.c3 as c from union_tb0, union_tb1 where union_tb0.ts=union_tb1.ts limit 10
sql (select count(*) as c from union_tb0, union_tb1 where union_tb0.ts=union_tb1.ts) union all (select union_tb0.c3 as c from union_tb0, union_tb1 where union_tb0.ts=union_tb1.ts limit 10) order by c desc
if $rows != 11 then
if $rows != 11 then
return -1
return -1
endi
endi
if $data00 != 10000 then
if $data00 != 10000 then
return -1
return -1
endi
endi
if $data10 != 9 then
if $data10 != 0 then
return -1
return -1
endi
endi
if $data20 != 8 then
if $data20 != 1 then
return -1
return -1
endi
endi
if $data90 != 1 then
if $data90 != 8 then
return -1
return -1
endi
endi
print ===========================================tags union
print ===========================================tags union
# two super table tag union, limit is not active during retrieve tags query
# two super table tag union, limit is not active during retrieve tags query
sql select t1 from union_mt0 union all select t1 from union_mt0
sql (select t1 from union_mt0) union all (select t1 from union_mt0)
if $rows != 20 then
if $rows != 200000 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data90 != 9 then
return -1
return -1
endi
endi
...
@@ -271,39 +240,35 @@ endi
...
@@ -271,39 +240,35 @@ endi
#endi
#endi
#========================================== two super table join subclause
#========================================== two super table join subclause
print ================two super table join subclause
print ================two super table join subclause
sql select avg(union_mt0.c1) as c from union_mt0 interval(1h) limit 10 union all select union_mt1.ts, union_mt1.c1/1.0 as c from union_mt0, union_mt1 where union_mt1.ts=union_mt0.ts and union_mt1.t1=union_mt0.t1 limit 5;
sql (select _wstart as ts, avg(union_mt0.c1) as c from union_mt0 interval(1h) limit 10) union all (select union_mt1.ts, union_mt1.c1/1.0 as c from union_mt0, union_mt1 where union_mt1.ts=union_mt0.ts and union_mt1.t1=union_mt0.t1 limit 5);
print the rows value is: $rows
print the rows value is: $rows
if $rows != 15 then
if $rows != 15 then
return -1
return -1
endi
endi
# first subclause are empty
# first subclause are empty
sql select count(*) as c from union_tb0 where ts > now + 3650d union all select sum(c1) as c from union_tb1;
sql (select count(*) as c from union_tb0 where ts > now + 3650d) union all (select sum(c1) as c from union_tb1);
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != 495000 then
if $data00 != 495000 then
return -1
return -1
endi
endi
# all subclause are empty
# all subclause are empty
sql select c1 from union_tb0 limit 0 union all select c1 from union_tb1 where ts>'2021-1-1 0:0:0'
sql (select c1 from union_tb0 limit 0) union all (select c1 from union_tb1 where ts>'2021-1-1 0:0:0')
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
# middle subclause empty
# middle subclause empty
sql select c1 from union_tb0 limit 1 union all select c1 from union_tb1 where ts>'2030-1-1 0:0:0' union all select last(c1) as c1 from union_tb1;
sql (select c1 from union_tb0 limit 1) union all (select c1 from union_tb1 where ts>'2030-1-1 0:0:0' union all select last(c1) as c1 from union_tb1) order by c1;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != 0 then
if $data00 != 0 then
return -1
return -1
endi
endi
if $data10 != 99 then
if $data10 != 99 then
return -1
return -1
endi
endi
...
@@ -319,141 +284,90 @@ sql (select ts, c1 from union_mt0 limit 1) union all (select ts, c1 from union_m
...
@@ -319,141 +284,90 @@ sql (select ts, c1 from union_mt0 limit 1) union all (select ts, c1 from union_m
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != @20-01-05 13:51:24.000@ then
if $data00 != @20-01-05 13:51:24.000@ then
return -1
return -1
endi
endi
if $data01 != 0 then
if $data01 != 0 then
return -1
return -1
endi
endi
if $data10 != @20-01-05 13:51:24.000@ then
if $data10 != @20-01-05 13:51:24.000@ then
return -1
return -1
endi
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
return -1
endi
endi
# two aggregated functions for super tables
# two aggregated functions for super tables
sql select sum(c1) as a from union_mt0 interval(1s) limit 9 union all select ts, max(c3) as a from union_mt0 limit 2;
sql (select _wstart as ts, sum(c1) as a from union_mt0 interval(1s) limit 9) union all (select ts, max(c3) as a from union_mt0 limit 2) order by ts;
sql select sum(c1) as a from union_tb0 limit 1 union all select sum(c3) as a from union_tb1 limit 2;
sql (select sum(c1) as a from union_tb0 limit 1) union all (select sum(c3) as a from union_tb1 limit 2);
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != 495000 then
if $data00 != 495000 then
return -1
return -1
endi
endi
if $data10 != 495000 then
if $data10 != 495000 then
return -1
return -1
endi
endi
# two super table query + interval + limit
# two super table query + interval + limit
sql select ts, first(c3) as a from union_mt0 limit 1 union all select sum(c3) as a from union_mt0 interval(1h) limit 1;
sql (select ts, first(c3) as a from union_mt0 limit 1) union all (select _wstart as ts, sum(c3) as a from union_mt0 interval(1h) limit 1) order by ts desc;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != @20-01-05 13:51:24.000@ then
if $data00 != @20-01-05 13:51:24.000@ then
return -1
return -1
endi
endi
if $data01 != 0 then
if $data01 != 0 then
return -1
return -1
endi
endi
if $data10 != @20-01-05 13:00:00.000@ then
if $data10 != @20-01-05 13:00:00.000@ then
return -1
return -1
endi
endi
if $data11 != 360 then
if $data11 != 360 then
return -1
return -1
endi
endi
sql select server_status() union all select server_status()
sql (select 'aaa' as option from union_tb1 where c1 < 0 limit 1) union all (select 'bbb' as option from union_tb0 limit 1)
if $rows != 2 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
return -1
endi
sql select client_version() union all select server_version()
if $rows != 2 then
return -1
endi
sql select database() union all select database()
if $rows != 2 then
return -1
endi
if $data00 != @union_db0@ then
return -1
endi
if $data10 != @union_db0@ then
return -1
endi
sql select 'aaa' as option from union_tb1 where c1 < 0 limit 1 union all select 'bbb' as option from union_tb0 limit 1
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != @bbb@ then
if $data00 != @bbb@ then
return -1
return -1
endi
endi
sql_error (show tables) union all (show tables)
sql_error show tables union all show tables
sql_error (show stables) union all (show stables)
sql_error show stables union all show stables
sql_error (show databases) union all (show databases)
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
tdSql.query("select max(c5), count(c5) from ct1")
# bug fix for count
# bug fix for count
tdSql.query("select count(c1) from ct4 ")
tdSql.query("select count(c1) from ct4 ")
tdSql.checkData(0,0,9)
tdSql.checkData(0,0,9)
...
@@ -450,7 +450,7 @@ class TDTestCase:
...
@@ -450,7 +450,7 @@ class TDTestCase:
tdSql.query("select count(*) from stb1 ")
tdSql.query("select count(*) from stb1 ")
tdSql.checkData(0,0,25)
tdSql.checkData(0,0,25)
# # bug fix for compute
# # bug fix for compute
tdSql.query("select c1, log(c1 ,2) -0 ,log(c1-4 ,2)-0 from ct4 ")
tdSql.query("select c1, log(c1 ,2) -0 ,log(c1-4 ,2)-0 from ct4 ")
tdSql.checkData(0,0,None)
tdSql.checkData(0,0,None)
tdSql.checkData(0,1,None)
tdSql.checkData(0,1,None)
...
@@ -507,40 +507,40 @@ class TDTestCase:
...
@@ -507,40 +507,40 @@ class TDTestCase:
# base is an regular number ,int or double
# base is an regular number ,int or double
tdSql.query("select c1, log(c1, 2) from ct1")
tdSql.query("select c1, log(c1, 2) from ct1")
tdSql.checkData(0,1,3.000000000)
tdSql.checkData(0,1,3.000000000)
tdSql.query("select c1, log(c1, 2.0) from ct1")
tdSql.query("select c1, log(c1, 2.0) from ct1")
tdSql.checkData(0,1,3.000000000)
tdSql.checkData(0,1,3.000000000)
tdSql.query("select c1, log(1, 2.0) from ct1")
tdSql.query("select c1, log(1, 2.0) from ct1")
tdSql.checkData(0,1,0.000000000)
tdSql.checkData(0,1,0.000000000)
tdSql.checkRows(13)
tdSql.checkRows(13)
# # bug for compute in functions
# # bug for compute in functions
# tdSql.query("select c1, abs(1/0) from ct1")
# tdSql.query("select c1, abs(1/0) from ct1")
# tdSql.checkData(0, 0, 8)
# tdSql.checkData(0, 0, 8)
# tdSql.checkData(0, 1, 1)
# tdSql.checkData(0, 1, 1)
tdSql.query("select c1, log(1, 2.0) from ct1")
tdSql.query("select c1, log(1, 2.0) from ct1")
tdSql.checkData(0,1,0.000000000)
tdSql.checkData(0,1,0.000000000)
tdSql.checkRows(13)
tdSql.checkRows(13)
# two cols start log(x,y)
# two cols start log(x,y)
tdSql.query("select c1,c2, log(c1,c2) from ct1")
tdSql.query("select c1,c2, log(c1,c2) from ct1")
tdSql.checkData(0,2,0.182485070)
tdSql.checkData(0,2,0.182485070)
tdSql.checkData(1,2,0.172791608)
tdSql.checkData(1,2,0.172791608)
tdSql.checkData(4,2,None)
tdSql.checkData(4,2,None)
tdSql.query("select c1,c2, log(c2,c1) from ct1")
tdSql.query("select c1,c2, log(c2,c1) from ct1")
tdSql.checkData(0,2,5.479900349)
tdSql.checkData(0,2,5.479900349)
tdSql.checkData(1,2,5.787318105)
tdSql.checkData(1,2,5.787318105)
tdSql.checkData(4,2,None)
tdSql.checkData(4,2,None)
tdSql.query("select c1, log(2.0 , c1) from ct1")
tdSql.query("select c1, log(2.0 , c1) from ct1")
tdSql.checkData(0,1,0.333333333)
tdSql.checkData(0,1,0.333333333)
tdSql.checkData(1,1,0.356207187)
tdSql.checkData(1,1,0.356207187)
tdSql.checkData(4,1,None)
tdSql.checkData(4,1,None)
tdSql.query("select c1, log(2.0 , ceil(abs(c1))) from ct1")
tdSql.query("select c1, log(2.0 , ceil(abs(c1))) from ct1")
tdSql.checkData(0,1,0.333333333)
tdSql.checkData(0,1,0.333333333)
tdSql.checkData(1,1,0.356207187)
tdSql.checkData(1,1,0.356207187)
tdSql.checkData(4,1,None)
tdSql.checkData(4,1,None)
...
@@ -580,10 +580,10 @@ class TDTestCase:
...
@@ -580,10 +580,10 @@ class TDTestCase:
tdSql.checkData(0,3,8.000000000)
tdSql.checkData(0,3,8.000000000)
tdSql.checkData(0,4,7.900000000)
tdSql.checkData(0,4,7.900000000)
tdSql.checkData(0,5,3.000000000)
tdSql.checkData(0,5,3.000000000)
deflog_Arithmetic(self):
deflog_Arithmetic(self):
pass
pass
defcheck_boundary_values(self):
defcheck_boundary_values(self):
tdSql.execute("drop database if exists bound_test")
tdSql.execute("drop database if exists bound_test")
...
@@ -612,13 +612,13 @@ class TDTestCase:
...
@@ -612,13 +612,13 @@ class TDTestCase:
self.check_result_auto_log("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select log(c1), log(c2) ,log(c3), log(c4), log(c5) ,log(c6) from sub1_bound")
self.check_result_auto_log("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select log(c1), log(c2) ,log(c3), log(c4), log(c5) ,log(c6) from sub1_bound")
self.check_result_auto_log2("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select log(c1,2), log(c2,2) ,log(c3,2), log(c4,2), log(c5,2) ,log(c6,2) from sub1_bound")
self.check_result_auto_log2("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select log(c1,2), log(c2,2) ,log(c3,2), log(c4,2), log(c5,2) ,log(c6,2) from sub1_bound")
self.check_result_auto_log__10("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select log(c1,-10), log(c2,-10) ,log(c3,-10), log(c4,-10), log(c5,-10) ,log(c6,-10) from sub1_bound")
self.check_result_auto_log__10("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ","select log(c1,-10), log(c2,-10) ,log(c3,-10), log(c4,-10), log(c5,-10) ,log(c6,-10) from sub1_bound")
self.check_result_auto_log2("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select log(c1,2), log(c2,2) ,log(c3,2), log(c3,2), log(c2,2) ,log(c1,2) from sub1_bound")
self.check_result_auto_log2("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select log(c1,2), log(c2,2) ,log(c3,2), log(c3,2), log(c2,2) ,log(c1,2) from sub1_bound")
self.check_result_auto_log("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select log(c1), log(c2) ,log(c3), log(c3), log(c2) ,log(c1) from sub1_bound")
self.check_result_auto_log("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select log(c1), log(c2) ,log(c3), log(c3), log(c2) ,log(c1) from sub1_bound")
self.check_result_auto_log2("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound","select log(abs(c1) ,2) from sub1_bound")
self.check_result_auto_log2("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound","select log(abs(c1) ,2) from sub1_bound")
self.check_result_auto_log2(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select log(t1,2) ,log(c5,2) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_log2(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select log(t1,2) ,log(c5,2) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_log2(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select log(t1,2) , log(c5,2) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_log2(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select log(t1,2) , log(c5,2) from stb1 where c1 > 0 order by tbname")
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c1 > 2 and c1 >= 3 or c1 < 1 or c1 <= 0 or c1 =2 or c1 != 1 or c1 <> 1 and c1 is null or c1 between 2 and 3 and c1 not between 1 and 1 and c1 in (2, 3) and c1 not in (1, 2)'
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c1 > 2 and c1 >= 3 or c1 < 1 or c1 <= 0 or c1 =2 or c1 != 1 or c1 <> 1 and c1 is null or c1 between 2 and 3 and c1 not between 1 and 1 and c1 in (2, 3) and c1 not in (1, 2)'
res=tdSql.query(query_sql)
res=tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkRows(1)
defqueryUtinyintCol(self,tb_name,check_elm=None):
defqueryUtinyintCol(self,tb_name,check_elm=None):
select_elm="*"ifcheck_elmisNoneelsecheck_elm
select_elm="*"ifcheck_elmisNoneelsecheck_elm
# >
# >
...
@@ -497,7 +497,7 @@ class TDTestCase:
...
@@ -497,7 +497,7 @@ class TDTestCase:
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c10 > 2 and c10 >= 3 or c10 < 1 or c10 <= 0 or c10 =2 or c10 != 1 or c10 <> 1 and c10 is null or c10 between 2 and 3 and c10 not between 1 and 1 and c10 in (2, 3) and c10 not in (1, 2)'
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c10 > 2 and c10 >= 3 or c10 < 1 or c10 <= 0 or c10 =2 or c10 != 1 or c10 <> 1 and c10 is null or c10 between 2 and 3 and c10 not between 1 and 1 and c10 in (2, 3) and c10 not in (1, 2)'
res=tdSql.query(query_sql)
res=tdSql.query(query_sql)
tdSql.checkRows(10)
tdSql.checkRows(10)
defquerySmallintCol(self,tb_name,check_elm=None):
defquerySmallintCol(self,tb_name,check_elm=None):
select_elm="*"ifcheck_elmisNoneelsecheck_elm
select_elm="*"ifcheck_elmisNoneelsecheck_elm
# >
# >
...
@@ -582,7 +582,7 @@ class TDTestCase:
...
@@ -582,7 +582,7 @@ class TDTestCase:
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c2 > 0 and c2 >= 1 or c2 < 4 and c2 <= 3 and c2 != 1 and c2 <> 2 and c2 = 3 or c2 is not null and c2 between 2 and 3 and c2 not between 1 and 2 and c2 in (2,3) and c2 not in (1,2)'
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c2 > 0 and c2 >= 1 or c2 < 4 and c2 <= 3 and c2 != 1 and c2 <> 2 and c2 = 3 or c2 is not null and c2 between 2 and 3 and c2 not between 1 and 2 and c2 in (2,3) and c2 not in (1,2)'
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c3 > 0 and c3 >= 1 or c3 < 5 and c3 <= 4 and c3 != 2 and c3 <> 2 and c3 = 4 or c3 is not null and c3 between 2 and 4 and c3 not between 1 and 2 and c3 in (2,4) and c3 not in (1,2)'
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c3 > 0 and c3 >= 1 or c3 < 5 and c3 <= 4 and c3 != 2 and c3 <> 2 and c3 = 4 or c3 is not null and c3 between 2 and 4 and c3 not between 1 and 2 and c3 in (2,4) and c3 not in (1,2)'
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkRows(11)
defqueryUintCol(self,tb_name,check_elm=None):
defqueryUintCol(self,tb_name,check_elm=None):
select_elm="*"ifcheck_elmisNoneelsecheck_elm
select_elm="*"ifcheck_elmisNoneelsecheck_elm
# >
# >
...
@@ -1086,7 +1086,7 @@ class TDTestCase:
...
@@ -1086,7 +1086,7 @@ class TDTestCase:
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c5 > 0 and c5 >= 1 or c5 < 5 and c5 <= 6.6 and c5 != 2 and c5 <> 2 and c5 = 4 or c5 is not null and c5 between 2 and 4 and c5 not between 1 and 2 and c5 in (2,4) and c5 not in (1,2)'
query_sql=f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c5 > 0 and c5 >= 1 or c5 < 5 and c5 <= 6.6 and c5 != 2 and c5 <> 2 and c5 = 4 or c5 is not null and c5 between 2 and 4 and c5 not between 1 and 2 and c5 in (2,4) and c5 not in (1,2)'
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkRows(11)
defqueryDoubleCol(self,tb_name,check_elm=None):
defqueryDoubleCol(self,tb_name,check_elm=None):
select_elm="*"ifcheck_elmisNoneelsecheck_elm
select_elm="*"ifcheck_elmisNoneelsecheck_elm
# >
# >
...
@@ -1711,19 +1711,19 @@ class TDTestCase:
...
@@ -1711,19 +1711,19 @@ class TDTestCase:
tdSql.checkRows(4)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql),7)
tdSql.checkEqual(self.queryLastC10(query_sql),7)
## condition_A or (condition_B and condition_C) or (condition_D and condition_E) and condition_F
## condition_A or (condition_B and condition_C) or (condition_D and condition_E) and condition_F
query_sql=f'select * from {tb_name} where c1 != 1 or (c2 <= 1 and c3 <4) or (c3 >= 4 or c7 is not Null) and c9 <> true'
query_sql=f'select * from {tb_name} where c1 != 1 or (c2 <= 1 and c3 <4) or (c3 >= 4 or c7 is not Null) and c9 <> true'
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(3)
tdSql.checkRows(3)
tdSql.checkEqual(self.queryLastC10(query_sql),10)
tdSql.checkEqual(self.queryLastC10(query_sql),10)
## (condition_A or (condition_B and condition_C) or (condition_D and condition_E)) and condition_F
## (condition_A or (condition_B and condition_C) or (condition_D and condition_E)) and condition_F
query_sql=f'select * from {tb_name} where (c1 != 1 or (c2 <= 2 and c3 >= 4) or (c3 >= 4 or c7 is not Null)) and c9 != false'
query_sql=f'select * from {tb_name} where (c1 != 1 or (c2 <= 2 and c3 >= 4) or (c3 >= 4 or c7 is not Null)) and c9 != false'
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(9)
tdSql.checkRows(9)
tdSql.checkEqual(self.queryLastC10(query_sql),9)
tdSql.checkEqual(self.queryLastC10(query_sql),9)
## (condition_A or condition_B) or (condition_C or condition_D) and (condition_E or condition_F or condition_G)
## (condition_A or condition_B) or (condition_C or condition_D) and (condition_E or condition_F or condition_G)
query_sql=f'select * from {tb_name} where c1 != 1 or (c2 <= 3 and c3 > 4) and c3 <= 5 and (c7 is not Null and c9 != false)'
query_sql=f'select * from {tb_name} where c1 != 1 or (c2 <= 3 and c3 > 4) and c3 <= 5 and (c7 is not Null and c9 != false)'
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkRows(2)
...
@@ -1780,17 +1780,17 @@ class TDTestCase:
...
@@ -1780,17 +1780,17 @@ class TDTestCase:
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(55)
tdSql.checkRows(55)
## condition_A or (condition_B and condition_C) or (condition_D and condition_E) and condition_F
## condition_A or (condition_B and condition_C) or (condition_D and condition_E) and condition_F
query_sql=f'select * from {tb_name} where t1 != 1 or (t2 <= 1 and t3 <4) or (t3 >= 4 or t7 is not Null) and t9 <> true'
query_sql=f'select * from {tb_name} where t1 != 1 or (t2 <= 1 and t3 <4) or (t3 >= 4 or t7 is not Null) and t9 <> true'
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(55)
tdSql.checkRows(55)
## (condition_A or (condition_B and condition_C) or (condition_D and condition_E)) and condition_F
## (condition_A or (condition_B and condition_C) or (condition_D and condition_E)) and condition_F
query_sql=f'select * from {tb_name} where (t1 != 1 or (t2 <= 2 and t3 >= 4) or (t3 >= 4 or t7 is not Null)) and t9 != false'
query_sql=f'select * from {tb_name} where (t1 != 1 or (t2 <= 2 and t3 >= 4) or (t3 >= 4 or t7 is not Null)) and t9 != false'
tdSql.query(query_sql)
tdSql.query(query_sql)
tdSql.checkRows(55)
tdSql.checkRows(55)
## (condition_A or condition_B) or (condition_C or condition_D) and (condition_E or condition_F or condition_G)
## (condition_A or condition_B) or (condition_C or condition_D) and (condition_E or condition_F or condition_G)
query_sql=f'select * from {tb_name} where t1 != 1 or (t2 <= 3 and t3 > 4) and t3 <= 5 and (t7 is not Null and t9 != false)'
query_sql=f'select * from {tb_name} where t1 != 1 or (t2 <= 3 and t3 > 4) and t3 <= 5 and (t7 is not Null and t9 != false)'