sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) limit 9
sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) limit 9
if $rows != 18 then
if $rows != 18 then
...
@@ -129,43 +116,41 @@ if $rows != 1 then
...
@@ -129,43 +116,41 @@ if $rows != 1 then
endi
endi
sql select count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1d) fill(NULL) slimit 1 soffset 1
sql select count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1d) fill(NULL) slimit 1 soffset 1
if $rows != 0 then
if $rows != 1 then
return -1
return -1
endi
endi
sql select count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1d) fill(NULL) slimit 1 soffset 0
sql select count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1d) fill(NULL) slimit 1 soffset 0
if $rows != 0 then
if $rows != 1 then
return -1
return -1
endi
endi
return
sql select t1,t1,count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1s) fill(NULL) slimit 2 soffset 0 limit 250000 offset 1
sql select t1,t1,count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1s) fill(NULL) slimit 2 soffset 0 limit 250000 offset 1
if $rows != 172799 then
if $rows != 172798 then
return -1
return -1
endi
endi
sql select t1,t1,count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1s) fill(NULL) slimit 1 soffset 0 limit 250000 offset 1
sql select t1,t1,count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1s) fill(NULL) slimit 1 soffset 0 limit 250000 offset 1
if $rows != 86399 then
if $rows != 85648 then
return -1
return -1
endi
endi
sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) order by ts DESC limit 30
sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) limit 30
if $rows != 30 then
if $rows != 48 then
return -1
return -1
endi
endi
sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) limit 2
sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) limit 2
if $rows != 2 then
if $rows != 4 then
return -1
return -1
endi
endi
sql select t1,t1,count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1s) fill(NULL) slimit 1 soffset 1 limit 250000 offset 1
sql select t1,t1,count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1s) fill(NULL) slimit 1 soffset 1 limit 250000 offset 1
if $rows != 86399 then
if $rows != 87150 then
return -1
return -1
endi
endi
sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) order by ts desc limit 1
sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by t1 interval(1h) fill(NULL) limit 1
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
...
@@ -174,68 +159,3 @@ sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000'
...
@@ -174,68 +159,3 @@ sql select t1,t1,count(*),t1,t1 from lr_stb0 where ts>'2018-09-24 00:00:00.000'
#sql_error select top(c1, 1) from $stb where ts >= $ts0 and ts <= $tsu slimit 5 offset 1
#sql_error select top(c1, 1) from $stb where ts >= $ts0 and ts <= $tsu slimit 5 offset 1
#sql_error select bottom(c1, 1) from $stb where ts >= $ts0 and ts <= $tsu slimit 5 offset 1
#sql_error select bottom(c1, 1) from $stb where ts >= $ts0 and ts <= $tsu slimit 5 offset 1
### select from stb + group by + slimit offset
### select from stb + partition by + slimit offset
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb group by t1 slimit 5 soffset 0
sql select t1, max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb partition by t1
if $rows != 5 then
if $rows != 10 then
return -1
endi
if $data(slm_tb0)[1] != 9 then
return -1
return -1
endi
endi
#if $data08 != NULL then
if $data(slm_tb0)[1] != 9 then
#if $data08 != 涛思nchar9 then
# return -1
#endi
$res = $tbPrefix . 0
if $data09 != $res then
return -1
return -1
endi
endi
$res = $tbPrefix . 1
if $data(slm_tb0)[2] != 0 then
if $data19 != $res then
return -1
return -1
endi
endi
$res = $tbPrefix . 4
if $data(slm_tb0)[3] != 4.500000000 then
if $data49 != $res then
return -1
return -1
endi
endi
#sql reset query cache
#sql reset query cache
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb group by t1 order by t1 asc slimit 5
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb partition by t1 slimit 5
if $rows != 5 then
if $rows != 5 then
return -1
return -1
endi
endi
if $data00 != 9 then
return -1
endi
$res = $tbPrefix . 0
print res = $res
if $data09 != $res then
return -1
endi
$res = $tbPrefix . 4
if $data49 != $res then
return -1
endi
## asc
## asc
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb group by t1 order by t1 asc slimit 4 soffset 1
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb partition by t1 slimit 4 soffset 1
if $rows != 4 then
if $rows != 4 then
return -1
return -1
endi
endi
if $data00 != 9 then
return -1
endi
$res = $tbPrefix . 1
if $data09 != $res then
return -1
endi
$res = $tbPrefix . 4
if $data39 != $res then
return -1
endi
## desc
## desc
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb group by t1 order by t1 desc slimit 4 soffset 1
sql select max(c1), min(c2), avg(c3), sum(c4), spread(c5), sum(c6), count(c7), first(c8), last(c9) from $stb partition by t1 slimit 4 soffset 1
if $rows != 4 then
if $rows != 4 then
return -1
return -1
endi
endi
if $data00 != 9 then
return -1
endi
$res = $tbPrefix . 8
if $data09 != $res then
return -1
endi
$res = $tbPrefix . 5
if $data39 != $res then
return -1
endi
### limit + slimit
### limit + slimit
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb group by t1 order by t1 asc slimit 4 soffset 1 limit 0
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 5 group by t1,t2,t3 order by t1 asc slimit 3 soffset 1 limit 1 offset 0
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 5 partition by t1,t2,t3 slimit 3 soffset 1 limit 1 offset 0
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data00 != 9 then
return -1
endi
$res = $tbPrefix . 3
if $data08 != $res then
return -1
endi
if $data09 != 3 then
return -1
endi
$res = $tbPrefix . 4
if $data18 != $res then
return -1
endi
if $data19 != 4 then
return -1
endi
$res = $tbPrefix . 5
if $data28 != $res then
return -1
endi
if $data29 != 5 then
return -1
endi
### slimit + fill
### slimit + fill
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 5 interval(5m) fill(value, -1, -2) group by t1 slimit 4 soffset 4 limit 0 offset 0
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 5 partition by t1 interval(5m) fill(value, -1, -2) slimit 4 soffset 4 limit 0 offset 0
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 interval(5m) fill(value, -1, -2) group by t1 slimit 4 soffset 4 limit 2 offset 0
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 partition by t1 interval(5m) fill(value, -1, -2) slimit 4 soffset 4 limit 2 offset 0
print select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 interval(5m) fill(value, -1, -2) group by t1 slimit 4 soffset 4 limit 2 offset 0
print select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 partition by t1 interval(5m) fill(value, -1, -2) slimit 4 soffset 4 limit 2 offset 0
print $rows $data00 $data01 $data02 $data03
print $rows $data00 $data01 $data02 $data03
if $rows != 8 then
if $rows != 8 then
return -1
return -1
endi
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data09 != slm_tb6 then
return -1
endi
if $data10 != @18-09-17 09:05:00.000@ then
return -1
endi
if $data11 != -1 then
return -1
endi
if $data12 != -2 then
return -1
endi
if $data13 != -2.000000000 then
return -1
endi
if $data17 != NULL then
return -1
endi
if $data18 != NULL then
return -1
endi
if $data19 != slm_tb6 then
return -1
endi
if $data20 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data29 != slm_tb7 then
return -1
endi
if $data30 != @18-09-17 09:05:00.000@ then
return -1
endi
if $data31 != -1 then
return -1
endi
if $data36 != -2 then
return -1
endi
if $data39 != slm_tb7 then
return -1
endi
if $data40 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data49 != slm_tb8 then
return -1
endi
if $data50 != @18-09-17 09:05:00.000@ then
return -1
endi
if $data59 != slm_tb8 then
return -1
endi
if $data69 != slm_tb9 then
return -1
endi
if $data79 != slm_tb9 then
return -1
endi
# desc
# desc
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 interval(5m) fill(value, -1, -2) group by t1 order by t1 desc slimit 4 soffset 4 limit 2 offset 0
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 partition by t1 interval(5m) fill(value, -1, -2) slimit 4 soffset 4 limit 2 offset 0
if $rows != 8 then
if $rows != 8 then
return -1
return -1
endi
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data09 != slm_tb5 then
return -1
endi
if $data10 != @18-09-17 09:05:00.000@ then
return -1
endi
if $data11 != -1 then
return -1
endi
if $data12 != -2 then
return -1
endi
if $data13 != -2.000000000 then
return -1
endi
if $data17 != NULL then
return -1
endi
if $data18 != NULL then
return -1
endi
if $data19 != slm_tb5 then
return -1
endi
if $data20 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data29 != slm_tb4 then
return -1
endi
if $data30 != @18-09-17 09:05:00.000@ then
return -1
endi
if $data31 != -1 then
return -1
endi
if $data36 != -2 then
return -1
endi
if $data39 != slm_tb4 then
return -1
endi
if $data40 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data49 != slm_tb3 then
return -1
endi
if $data50 != @18-09-17 09:05:00.000@ then
return -1
endi
if $data59 != slm_tb3 then
return -1
endi
if $data69 != slm_tb2 then
return -1
endi
if $data79 != slm_tb2 then
return -1
endi
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 interval(5m) fill(value, -1, -2) group by t1 order by t1 asc slimit 4 soffset 4 limit 2 offset 598
sql select max(c1), min(c2), avg(c3), sum(c4), sum(c6), count(c7), first(c8), last(c9) from $stb where ts >= $ts0 and ts <= $tsu and t2 >= 2 and t3 <= 9 partition by t1 interval(5m) fill(value, -1, -2) slimit 4 soffset 4 limit 2 offset 598
if $rows != 4 then
if $rows != 4 then
return -1
return -1
endi
endi
if $data00 != @18-09-19 10:50:00.000@ then
return -1
endi
if $data01 != 9 then
return -1
endi
if $data09 != slm_tb6 then
return -1
endi
if $data10 != @18-09-19 10:50:00.000@ then
return -1
endi
if $data12 != 9 then
return -1
endi
if $data13 != 9.000000000 then
return -1
endi
if $data19 != slm_tb7 then
return -1
endi
if $data20 != @18-09-19 10:50:00.000@ then
return -1
endi
if $data24 != 9.000000000 then
return -1
endi
if $data29 != slm_tb8 then
return -1
endi
if $data30 != @18-09-19 10:50:00.000@ then
return -1
endi
if $data35 != 9 then
return -1
endi
if $data36 != 1 then
return -1
endi
if $data37 != binary9 then
return -1
endi
if $data38 != 涛思nchar9 then
return -1
endi
if $data39 != slm_tb9 then
return -1
endi
sql select count(ts) from $stb group by t1,t2,t3,t4,t5,t6 order by t1 desc
sql select count(ts) from $stb partition by t1,t2,t3,t4,t5,t6 order by t1 desc
if $rows != $tbNum then
if $rows != $tbNum then
return -1
return -1
endi
endi
$res = $rowNum + 1
if $data00 != $res then
return -1
endi
if $data90 != $res then
return -1
endi
if $data01 != slm_tb9 then
return -1
endi
if $data12 != 8 then
return -1
endi
if $data23 != 7 then
return -1
endi
if $data34 != 涛思slm_tb6 then
return -1
endi
if $data45 != 5.000000000 then
return -1
endi
if $data56 != 1 then
return -1
endi
$res = $rowNum + 1
if $data60 != $res then
return -1
endi
if $data71 != slm_tb2 then
return -1
endi
sql select count(c1) from $stb group by t1,t2,t3,t4,t5,t6 order by t1 desc
sql select count(c1) from $stb partition by t1,t2,t3,t4,t5,t6 order by t1 desc
if $rows != 10 then
if $rows != 10 then
return -1
return -1
endi
endi
if $data00 != $rowNum then
return -1
endi
if $data90 != $rowNum then
return -1
endi
if $data01 != slm_tb9 then
return -1
endi
if $data12 != 8 then
return -1
endi
if $data23 != 7 then
return -1
endi
if $data34 != 涛思slm_tb6 then
return -1
endi
if $data45 != 5.000000000 then
return -1
endi
if $data56 != 1 then
return -1
endi
if $data60 != $rowNum then
return -1
endi
if $data71 != slm_tb2 then
return -1
endi
## [TBASE-604]
## [TBASE-604]
#sql_error select count(tbname) from slm_stb0 group by t1
#sql_error select count(tbname) from slm_stb0 partition by t1
#sql show databases
#sql show databases
## [TBASE-605]
## [TBASE-605]
sql_error select * from slm_stb0 where t2 >= 2 and t3 <= 9 group by tbname slimit 40 limit 1;
sql select * from slm_stb0 where t2 >= 2 and t3 <= 9 partition by tbname slimit 40 limit 1;