[TD-2671]<test>: add test case for STABLE
This commit is contained in:
parent
2257f93209
commit
0244298b60
|
@ -122,6 +122,7 @@ class TDTestCase:
|
|||
tdSql.query("select * from tb0")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
|
|
@ -47,6 +47,40 @@ class TDTestCase:
|
|||
tdSql.query("select * from db.st where dev='dev_02'")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
#For: https://jira.taosdata.com:18080/browse/TD-2671
|
||||
print("==============step3")
|
||||
tdSql.execute(
|
||||
"create stable if not exists stb (ts timestamp, tagtype int) tags(dev nchar(50))")
|
||||
tdSql.execute(
|
||||
'CREATE TABLE if not exists dev_01 using stb tags("dev_01")')
|
||||
tdSql.execute(
|
||||
'CREATE TABLE if not exists dev_02 using stb tags("dev_02")')
|
||||
|
||||
print("==============step4")
|
||||
|
||||
tdSql.execute(
|
||||
"""INSERT INTO dev_01(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
|
||||
('2020-05-13 10:00:00.001', 1)
|
||||
dev_02 VALUES('2020-05-13 10:00:00.001', 1)""")
|
||||
|
||||
tdSql.query("select * from db.stb where dev='dev_01'")
|
||||
tdSql.checkRows(2)
|
||||
|
||||
tdSql.query("select * from db.stb where dev='dev_02'")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("describe db.stb")
|
||||
tdSql.checkRows(3)
|
||||
|
||||
tdSql.execute("alter stable db.stb add tag t1 int")
|
||||
tdSql.query("describe db.stb")
|
||||
tdSql.checkRows(4)
|
||||
|
||||
tdSql.execute("drop stable db.stb")
|
||||
tdSql.query("show stables")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
|
Loading…
Reference in New Issue