diff --git a/tests/pytest/query/filterAllIntTypes.py b/tests/pytest/query/filterAllIntTypes.py index cf65d2b1021c22200b89a94a8f6093bc45937872..a2bab63c886558d87eb63e3b26b222c83afdebc0 100644 --- a/tests/pytest/query/filterAllIntTypes.py +++ b/tests/pytest/query/filterAllIntTypes.py @@ -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) diff --git a/tests/pytest/query/filterFloatAndDouble.py b/tests/pytest/query/filterFloatAndDouble.py index bd349a2a25c556723775e558d890cbca19803156..8d0e5baeca6775b129c5fc2438bb1a6bc8957b87 100644 --- a/tests/pytest/query/filterFloatAndDouble.py +++ b/tests/pytest/query/filterFloatAndDouble.py @@ -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) diff --git a/tests/pytest/query/filterOtherTypes.py b/tests/pytest/query/filterOtherTypes.py index bc7df18c8da9dafce62f20b13800b266815c2cbf..1db5497604923cecd8111015dd0ba497b914b453 100644 --- a/tests/pytest/query/filterOtherTypes.py +++ b/tests/pytest/query/filterOtherTypes.py @@ -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):