提交 10774f58 编写于 作者: P Ping Xiao

[TD-350]: add filter test cases for range

上级 5a6ce277
......@@ -88,6 +88,19 @@ class TDTestCase:
tdSql.query("select * from st%s where num != 50" % curType)
tdSql.checkRows(101)
# range for int type on column
tdSql.query("select * from st%s where num > 50 and num < 100" % curType)
tdSql.checkRows(49)
tdSql.query("select * from st%s where num >= 50 and num < 100" % curType)
tdSql.checkRows(50)
tdSql.query("select * from st%s where num > 50 and num <= 100" % curType)
tdSql.checkRows(50)
tdSql.query("select * from st%s where num >= 50 and num <= 100" % curType)
tdSql.checkRows(51)
# > for int type on tag
tdSql.query("select * from st%s where id > 5" % curType)
tdSql.checkRows(52)
......@@ -116,6 +129,23 @@ class TDTestCase:
tdSql.query("select * from st%s where id != 5" % curType)
tdSql.checkRows(92)
# != for int type on tag
tdSql.query("select * from st%s where id != 5" % curType)
tdSql.checkRows(92)
# range for int type on tag
tdSql.query("select * from st%s where id > 5 and id < 7" % curType)
tdSql.checkRows(10)
tdSql.query("select * from st%s where id >= 5 and id < 7" % curType)
tdSql.checkRows(20)
tdSql.query("select * from st%s where id > 5 and id <= 7" % curType)
tdSql.checkRows(20)
tdSql.query("select * from st%s where id >= 5 and id <= 7" % curType)
tdSql.checkRows(30)
print(
"======= Verify filter for %s type finished =========" %
curType)
......
......@@ -67,6 +67,19 @@ class TDTestCase:
tdSql.query("select * from st where num < 5.5")
tdSql.checkRows(4)
# range for float type on column
tdSql.query("select * from st where num > 5.5 and num < 11.0")
tdSql.checkRows(4)
tdSql.query("select * from st where num >= 5.5 and num < 11.0")
tdSql.checkRows(5)
tdSql.query("select * from st where num > 5.5 and num <= 11.0")
tdSql.checkRows(5)
tdSql.query("select * from st where num >= 5.5 and num <= 11.0")
tdSql.checkRows(6)
# > for float type on tag
tdSql.query("select * from st where tagcol1 > 1.1")
tdSql.checkRows(0)
......@@ -123,6 +136,19 @@ class TDTestCase:
tdSql.query("select * from st where speed < 11.5")
tdSql.checkRows(4)
# range for double type on column
tdSql.query("select * from st where speed > 11.5 and speed < 20.7")
tdSql.checkRows(3)
tdSql.query("select * from st where speed >= 11.5 and speed < 20.7")
tdSql.checkRows(4)
tdSql.query("select * from st where speed > 11.5 and speed <= 20.7")
tdSql.checkRows(4)
tdSql.query("select * from st where speed >= 11.5 and speed <= 20.7")
tdSql.checkRows(5)
# > for double type on tag
tdSql.query("select * from st where tagcol2 > 2.3")
tdSql.checkRows(0)
......
......@@ -30,9 +30,9 @@ class TDTestCase:
print("======= Verify filter for bool, nchar and binary type =========")
tdLog.debug(
"create table st(ts timestamp, tbcol1 bool, tbcol2 nchar(10), tbcol3 binary(20)) tags(tagcol1 bool, tagcol2 nchar(10), tagcol3 binary(10))")
"create table st(ts timestamp, tbcol1 bool, tbcol2 binary(10), tbcol3 nchar(20)) tags(tagcol1 bool, tagcol2 binary(10), tagcol3 nchar(10))")
tdSql.execute(
"create table st(ts timestamp, tbcol1 bool, tbcol2 nchar(10), tbcol3 binary(20)) tags(tagcol1 bool, tagcol2 nchar(10), tagcol3 binary(10))")
"create table st(ts timestamp, tbcol1 bool, tbcol2 binary(10), tbcol3 nchar(20)) tags(tagcol1 bool, tagcol2 binary(10), tagcol3 nchar(10))")
tdSql.execute("create table st1 using st tags(true, 'table1', '水表')")
for i in range(1, 6):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册