add tag filter sim

This commit is contained in:
yihaoDeng 2022-05-31 19:55:12 +08:00
parent 64ffbc1eea
commit 13694d0352
1 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,59 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== prepare stb and ctb
sql create database db vgroups 1
sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 binary(16)) comment "abd"
sql create table db.ctb1 using db.stb tags(1, "102")
sql insert into db.ctb1 values(now, 1, "2")
sql create table db.ctb2 using db.stb tags(2, "102")
sql insert into db.ctb2 values(now, 2, "2")
sql create table db.ctb3 using db.stb tags(3, "102")
sql insert into db.ctb3 values(now, 3, "2")
sql create table db.ctb4 using db.stb tags(4, "102")
sql insert into db.ctb4 values(now, 4, "2")
sql create table db.ctb5 using db.stb tags(5, "102")
sql insert into db.ctb5 values(now, 5, "2")
sql create table db.ctb6 using db.stb tags(6, "102")
sql insert into db.ctb6 values(now, 6, "2")
sql select * from db.stb where t1 = 1
if $rows != 1 then
return -1
endi
sql select * from db.stb where t1 < 1
if $rows != 0 then
return -=1
endi
sql select * from db.stb where t1 < 2
if $rows != 1 then
return -1
endi
sql select * from db.stb where t1 <= 2
if $rows != 2 then
return -1
endi
sql select * from db.stb where t1 >= 1
if $rows != 6 then
return -1
endi
sql select * from db.stb where t1 > 1
if $rows != 5 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT