Merge pull request #24313 from taosdata/TEST/3.0/TS-4348-TD-27939
Add test cases for TS-4348 and TD-27939
This commit is contained in:
commit
af0f2ecf34
|
@ -0,0 +1,46 @@
|
||||||
|
from util.cases import *
|
||||||
|
from util.sql import *
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor(), True)
|
||||||
|
|
||||||
|
tdSql.execute("drop database if exists ts_4338;")
|
||||||
|
tdSql.execute("create database ts_4338;")
|
||||||
|
tdSql.execute("drop table if exists ts_4338.t;")
|
||||||
|
tdSql.execute("create database if not exists ts_4338;")
|
||||||
|
tdSql.execute("create table ts_4338.t (ts timestamp, i8 tinyint);")
|
||||||
|
tdSql.execute("insert into ts_4338.t (ts, i8) values (now(), 1) (now()+1s, 2);")
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
# TS-4348
|
||||||
|
tdSql.query(f'select i8 from ts_4338.t;')
|
||||||
|
tdSql.checkRows(2)
|
||||||
|
|
||||||
|
tdSql.query(f'select i8 from ts_4338.t where 1 = 1;')
|
||||||
|
tdSql.checkRows(2)
|
||||||
|
|
||||||
|
tdSql.query(f'select i8 from ts_4338.t where i8 = 1;')
|
||||||
|
tdSql.checkRows(1)
|
||||||
|
|
||||||
|
tdSql.query(f'select * from (select * from ts_4338.t where i8 = 3);')
|
||||||
|
tdSql.checkRows(0)
|
||||||
|
|
||||||
|
# TD-27939
|
||||||
|
tdSql.query(f'select * from (select * from ts_4338.t where 1 = 100);')
|
||||||
|
tdSql.checkRows(0)
|
||||||
|
|
||||||
|
tdSql.query(f'select * from (select * from (select * from ts_4338.t where 1 = 200));')
|
||||||
|
tdSql.checkRows(0)
|
||||||
|
|
||||||
|
tdSql.execute("drop database if exists ts_4338;")
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
Loading…
Reference in New Issue