test case
This commit is contained in:
parent
2c91e12204
commit
8c453d5d2c
|
@ -515,6 +515,18 @@ class TDTestCase:
|
|||
tdSql.query(f"select t1 from {dbname}.stb1 where abs(c1+t1)=1")
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0,0,0)
|
||||
tdSql.query(f"select * from {dbname}.stb1")
|
||||
rows = tdSql.queryRows
|
||||
tdSql.query(f"select t1 from {dbname}.stb1 where abs(c1+t1)=1 or (1<2)")
|
||||
tdSql.checkRows(rows)
|
||||
tdSql.query(f"select t1 from {dbname}.stb1 where abs(c1+t1)=1 and (1<2)")
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0,0,0)
|
||||
tdSql.query(f"select t1 from {dbname}.stb1 where abs(c1+t1)=1 and (1>2)")
|
||||
tdSql.checkRows(0)
|
||||
tdSql.query(f"select t1 from {dbname}.stb1 where abs(c1+t1)=1 or (1>2)")
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0,0,0)
|
||||
|
||||
tdSql.query(
|
||||
f"select abs(c1+t1)*t1 from {dbname}.stb1 where abs(c1)/floor(abs(ceil(t1))) ==1")
|
||||
|
|
|
@ -64,6 +64,10 @@ class TDTestCase:
|
|||
tdSql.query(f"select tbname , max(c1) from {dbname}.sub_stb_1 where c1 is null group by c1 order by c1 desc ")
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0,0,"sub_stb_1")
|
||||
tdSql.query(f"select tbname , max(c1) from {dbname}.sub_stb_1 group by c1 order by c1 desc ")
|
||||
rows = tdSql.queryRows
|
||||
tdSql.query(f"select tbname , max(c1) from {dbname}.sub_stb_1 where c1 is null or (1<2) group by c1 order by c1 desc ")
|
||||
tdSql.checkRows(rows)
|
||||
|
||||
tdSql.query(f"select max(c1) ,c2 ,t2,tbname from {dbname}.stb group by abs(c1) order by abs(c1)")
|
||||
tdSql.checkRows(self.row_nums+1)
|
||||
|
|
|
@ -75,6 +75,25 @@ class TDTestCase:
|
|||
tdSql.checkData(1, 1, 3)
|
||||
tdSql.checkData(2, 1, 9)
|
||||
|
||||
tdSql.query(f"select * from {dbname}.stb_1 order by ts")
|
||||
rows = tdSql.queryRows
|
||||
tdSql.query(f"select * from {dbname}.stb_1 where col1 in (1, 2) or (1<2) order by ts")
|
||||
tdSql.checkRows(rows)
|
||||
|
||||
tdSql.query(f"select * from (select * from {dbname}.stb_1 where col1 in (1, 9, 3) or (1<2) order by ts)")
|
||||
tdSql.checkRows(rows)
|
||||
|
||||
tdSql.query(f"select * from {dbname}.stb_1 where col1 in (1, 2) and (1<2) order by ts")
|
||||
tdSql.checkRows(2)
|
||||
tdSql.checkData(0, 1, 1)
|
||||
tdSql.checkData(1, 1, 2)
|
||||
|
||||
tdSql.query(f"select * from {dbname}.stb_1 where col1 in (1, 9, 3) and (1<2) order by ts")
|
||||
tdSql.checkRows(3)
|
||||
tdSql.checkData(0, 1, 1)
|
||||
tdSql.checkData(1, 1, 3)
|
||||
tdSql.checkData(2, 1, 9)
|
||||
|
||||
tdSql.query(f"select * from {dbname}.stb_1 where col1 in (1, 9, 3, 'xy') order by ts")
|
||||
tdSql.checkRows(3)
|
||||
tdSql.checkData(0, 1, 1)
|
||||
|
@ -160,7 +179,7 @@ class TDTestCase:
|
|||
tdSql.prepare()
|
||||
|
||||
self.timeZoneTest()
|
||||
# self.inAndNotinTest()
|
||||
self.inAndNotinTest()
|
||||
|
||||
|
||||
def stop(self):
|
||||
|
|
|
@ -28,6 +28,10 @@ class TDTestCase:
|
|||
for type_name in stype:
|
||||
tdsql.execute(f"drop table if exists {dbname}.{stbname}")
|
||||
tdsql.execute(f"create table if not exists {dbname}.{stbname} (ts timestamp, v1 {type_name}) tags(t1 {type_name})")
|
||||
|
||||
tdsql.query(f"select t1, * from {dbname}.{stbname} where t1 not in (1, 2) or (1<2) order by t1")
|
||||
tdsql.checkRows(0)
|
||||
|
||||
tdsql.execute(f"insert into {dbname}.sub_1 using {dbname}.{stbname} tags(1) values({self.ts}, 10)")
|
||||
tdsql.execute(f"insert into {dbname}.sub_2 using {dbname}.{stbname} tags(2) values({self.ts + 1000}, 20)")
|
||||
tdsql.execute(f"insert into {dbname}.sub_3 using {dbname}.{stbname} tags(3) values({self.ts + 2000}, 30)")
|
||||
|
@ -36,6 +40,11 @@ class TDTestCase:
|
|||
tdsql.query(f"select t1, * from {dbname}.{stbname} where t1 not in (1, 2) order by t1")
|
||||
tdsql.checkRows(1)
|
||||
tdsql.checkData(0, 0, 3)
|
||||
tdsql.query(f"select * from {dbname}.{stbname} where t1 not in (1, 2) or (1<2) order by t1")
|
||||
tdsql.checkRows(3)
|
||||
tdsql.checkData(0, 1, 10)
|
||||
tdsql.checkData(1, 1, 20)
|
||||
tdsql.checkData(2, 1, 30)
|
||||
|
||||
# Test case 2: NOT BETWEEN
|
||||
tdsql.query(f"select * from {dbname}.{stbname} where v1 not between 10 and 20 order by t1")
|
||||
|
|
Loading…
Reference in New Issue