sql create stable st (ts timestamp, c2 int) tags(tg int)
print -------- insert 300 rows data
$i = 0
while $i < 300
$t = 1577807983000
$cc = $i * 1000
$t = $t + $cc
sql select $i % 3
if $data00 != 0.000000000 then
goto continue_while
endi
sql select $i % 4
if $data00 == 0.000000000 then
goto continue_while
endi
sql insert into t1 using st tags(1) values ( $t , $i )
continue_while:
$i = $i + 1
endw
$ms1 = 1577808120000
$ms2 = 1577808000000
sql select * from (select _wstart, last(ts) as ts, avg(c2) as av from t1 where ts <= $ms1 and ts >= $ms2 interval(10s) sliding(1s) fill(NULL)) order by ts asc
print ----> select asc rows: $rows
$asc_rows = $rows
sql select * from (select _wstart, last(ts) as ts, avg(c2) as av from t1 where ts <= $ms1 and ts >= $ms2 interval(10s) sliding(1s) fill(NULL)) order by ts desc
print ----> select desc rows: $rows
$desc_rows = $rows
if $desc_rows != $asc_rows then
return -1
endi
print =============== clear
print =============== clear
#sql drop database $db
#sql drop database $db
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases