sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2");
sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2");
sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3");
sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3");
...
@@ -25,132 +19,102 @@ sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
...
@@ -25,132 +19,102 @@ sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
sql insert into tb1 values (now+100s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+100s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+200s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+200s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+300s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb2 values (now+300s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+400s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb3 values (now+400s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+500s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb4 values (now+500s,4,4.0,4.0,4,4,4,true,"4","4")
sql select tbname,id1 from st2;
sql select distinct(tbname), id1 from st2;
if $rows != 4 then
if $rows != 4 then
return -1
return -1
endi
endi
sql select * from st2;
sql select * from st2;
if $rows != 8 then
if $rows != 8 then
return -1
return -1
endi
endi
sql select * from st2 where ts between now-50s and now+450s
sql select * from st2 where ts between now-50s and now+450s
if $rows != 5 then
if $rows != 5 then
return -1
return -1
endi
endi
sql select tbname,id1 from st2 where id1 between 2 and 3;
sql select tbname, id1 from st2 where id1 between 2 and 3;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != tb2 then
sql select tbname, id2 from st2 where id2 between 0.0 and 3.0;
return -1
if $rows != 7 then
endi
if $data01 != 2 then
return -1
endi
if $data10 != tb3 then
return -1
endi
if $data11 != 3 then
return -1
endi
sql select tbname,id2 from st2 where id2 between 2.0 and 3.0;
if $rows != 2 then
return -1
return -1
endi
endi
if $data(tb2)[0] != tb2 then
if $data00 != tb2 then
return -1
return -1
endi
endi
if $data01 != 2.00000 then
if $data(tb2)[1] != 2.00000 then
return -1
return -1
endi
endi
if $data10 != tb3 then
if $data(tb3)[0] != tb3 then
return -1
return -1
endi
endi
if $data11 != 3.00000 then
if $data(tb3)[1] != 3.00000 then
return -1
return -1
endi
endi
sql select tbname, id4 from st2 where id2 between 2.0 and 3.0;
sql select tbname,id4 from st2 where id4 between 2.0 and 3.0;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data(tb2)[0] != tb2 then
if $data00 != tb2 then
return -1
return -1
endi
endi
if $data01 != 2.000000000 then
if $data(tb2)[1] != 2.000000000 then
return -1
return -1
endi
endi
if $data10 != tb3 then
if $data(tb3)[0] != tb3 then
return -1
return -1
endi
endi
if $data11 != 3.000000000 then
if $data(tb3)[1] != 3.000000000 then
return -1
return -1
endi
endi
sql select tbname, id5 from st2 where id5 between 2.0 and 3.0;
sql select tbname,id5 from st2 where id5 between 2.0 and 3.0;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data(tb2)[0] != tb2 then
if $data00 != tb2 then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data(tb2)[1] != 2 then
return -1
return -1
endi
endi
if $data10 != tb3 then
if $data(tb3)[0] != tb3 then
return -1
return -1
endi
endi
if $data11 != 3 then
if $data(tb3)[1] != 3 then
return -1
return -1
endi
endi
sql select tbname,id6 from st2 where id6 between 2.0 and 3.0;
sql select tbname,id6 from st2 where id6 between 2.0 and 3.0;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data(tb2)[0] != tb2 then
if $data00 != tb2 then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data(tb2)[1] != 2 then
return -1
return -1
endi
endi
if $data10 != tb3 then
if $data(tb3)[0] != tb3 then
return -1
return -1
endi
endi
if $data11 != 3 then
if $data(tb3)[1] != 3 then
return -1
return -1
endi
endi
sql select * from st2 where f1 between 2 and 3 and f2 between 2.0 and 3.0 and f3 between 2.0 and 3.0 and f4 between 2.0 and 3.0 and f5 between 2.0 and 3.0 and f6 between 2.0 and 3.0;
sql select * from st2 where f1 between 2 and 3 and f2 between 2.0 and 3.0 and f3 between 2.0 and 3.0 and f4 between 2.0 and 3.0 and f5 between 2.0 and 3.0 and f6 between 2.0 and 3.0;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data01 != 2 then
return -1
return -1
endi
endi
...
@@ -158,8 +122,8 @@ if $data11 != 3 then
...
@@ -158,8 +122,8 @@ if $data11 != 3 then
return -1
return -1
endi
endi
sql_error select * from st2 where f7 between 2.0 and 3.0;
sql select * from st2 where f7 between 2.0 and 3.0;
sql_error select * from st2 where f8 between 2.0 and 3.0;
sql select * from st2 where f8 between 2.0 and 3.0;
sql_error select * from st2 where f9 between 2.0 and 3.0;
sql select * from st2 where f9 between 2.0 and 3.0;