sql select * from $tb order by ts desc limit 5 offset 5
if $rows != 5 then
return -1
endi
if $data01 != 4 then
return -1
endi
if $data41 != 0 then
return -1
endi
$offset = $rowNum - 1
sql select * from $tb order by ts desc limit 5 offset $offset
if $rows != 1 then
return -1
endi
sql select ts, c1, c2, c3, c4, c5, c6, c7, c8, c9 from $tb order by ts desc limit 5 offset 5
if $rows != 5 then
return -1
endi
if $data01 != 4 then
return -1
endi
if $data02 != 4 then
return -1
endi
if $data03 != 4.00000 then
return -1
endi
if $data04 != 4.000000000 then
return -1
endi
if $data05 != 4 then
return -1
endi
if $data06 != 4 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary4 then
return -1
endi
if $data09 != nchar4 then
return -1
endi
sql select ts, c1, c2, c3, c4, c5, c6, c7, c8, c9 from $tb order by ts desc limit 5 offset $offset
if $rows != 1 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary0 then
return -1
endi
if $data09 != nchar0 then
return -1
endi
## TBASE-329
sql select * from $tb where c1 < 9 order by ts desc limit 1 offset 1
if $rows != 1 then
return -1
endi
if $data01 != 7 then
return -1
endi
sql select * from $tb where c1 < 9 order by ts desc limit 2 offset 1
if $rows != 2 then
return -1
endi
if $data01 != 7 then
return -1
endi
if $data11 != 6 then
return -1
endi
sql select * from $tb where c1 < 9 order by ts desc limit 3 offset 1
if $rows != 3 then
return -1
endi
if $data01 != 7 then
return -1
endi
if $data11 != 6 then
return -1
endi
if $data21 != 5 then
return -1
endi
sql select * from $tb where c1 < 0 order by ts desc limit 3 offset 1
if $rows != 0 then
return -1
endi
sql select * from $tb where c1 > 0 order by ts desc limit 1 offset 1
if $rows != 1 then
return -1
endi
if $data01 != 8 then
return -1
endi
sql select * from $tb where c1 > 0 order by ts desc limit 2 offset 1
if $rows != 2 then
return -1
endi
if $data01 != 8 then
return -1
endi
if $data11 != 7 then
return -1
endi
sql_error select * from $tb limit
sql_error select * from $tb offset
sql_error select * from $tb offset 1
sql_error select * from $tb offset 1 limit 5
sql_error select * from $tb offset 1 limit -1
#### aggregation function + limit offset
$tsu = $rowNum * $delta
$tsu = $tsu - $delta
$tsu = $tsu + $ts0
### aggregation function + limit offset (non-interval case)
sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5
if $rows != 1 then
return -1
endi
sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 0
if $rows != 0 then
return -1
endi
sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu and c1 < 9 and c2 < 8 and c3 >0 and c4 <= 7 and c5 <7 limit 5 offset 0
if $rows != 1 then
return -1
endi
sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 1
if $rows != 0 then
return -1
endi
sql select min(c1), min(c2), min(c3), min(c4), min(c5), min(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5
if $rows != 1 then
return -1
endi
sql select min(c1), min(c2), min(c3), min(c4), min(c5), min(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 0 offset 0
if $rows != 0 then
return -1
endi
sql select min(c1), min(c2), min(c3), min(c4), min(c5), min(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 1
if $rows != 0 then
return -1
endi
sql select sum(c1), avg(c2), stddev(c3), max(c4), min(c5), count(c6), first(c7), last(c8), last(c9) from $tb where ts >= $ts0 and ts <= $tsu limit 5
sql select sum(c1), avg(c2), stddev(c3), max(c4), min(c5), count(c6), first(c7), last(c8), last(c9) from $tb where ts >= $ts0 and ts <= $tsu limit 0
if $rows != 0 then
return -1
endi
sql select sum(c1), avg(c2), stddev(c3), max(c4), min(c5), count(c6), first(c7), last(c8), last(c9) from $tb where ts >= $ts0 and ts <= $tsu and c1>1 and c2<9 and c3>2 and c4<8 and c5>4 and c6<6 limit 1 offset 0
if $rows != 1 then
return -1
endi
if $data00 != 5 then
return -1
endi
if $data01 != 5.000000000 then
return -1
endi
if $data02 != 0.000000000 then
return -1
endi
if $data03 != 5.000000000 then
return -1
endi
if $data04 != 5 then
return -1
endi
if $data05 != 1 then
return -1
endi
if $data06 != 1 then
return -1
endi
if $data07 != binary5 then
return -1
endi
if $data08 != nchar5 then
return -1
endi
sql select sum(c1), avg(c2), stddev(c3), max(c4), min(c5), count(c6), first(c7), last(c8), last(c9) from $tb where ts >= $ts0 and ts <= $tsu limit 3 offset 1
if $rows != 0 then
return -1
endi
sql select spread(ts), spread(c1), spread(c2), spread(c3), spread(c4), spread(c5), spread(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 0
if $rows != 1 then
return -1
endi
if $data00 != 5400000.000000000 then
return -1
endi
if $data01 != 9.000000000 then
return -1
endi
if $data02 != 9.000000000 then
return -1
endi
if $data03 != 9.000000000 then
return -1
endi
if $data04 != 9.000000000 then
return -1
endi
if $data05 != 9.000000000 then
return -1
endi
if $data06 != 9.000000000 then
return -1
endi
sql select spread(ts), spread(c1), spread(c2), spread(c3), spread(c4), spread(c5), spread(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 1
if $rows != 0 then
return -1
endi
sql select twa(c1), twa(c2), twa(c3), twa(c4), twa(c5), twa(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 0
if $rows != 1 then
return -1
endi
if $data00 != 4.500000000 then
return -1
endi
if $data01 != 4.500000000 then
return -1
endi
if $data02 != 4.500000000 then
return -1
endi
if $data03 != 4.500000000 then
return -1
endi
if $data04 != 4.500000000 then
return -1
endi
if $data05 != 4.500000000 then
return -1
endi
sql select twa(c1), twa(c2), twa(c3), twa(c4), twa(c5), twa(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 1
if $rows != 0 then
return -1
endi
sql select top(c1, 1) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 1
if $rows != 0 then
return -1
endi
print ========> TD-6017
sql select * from (select ts, top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1)