提交 0244298b 编写于 作者: P Ping Xiao

[TD-2671]<test>: add test case for STABLE

上级 2257f932
......@@ -121,6 +121,7 @@ class TDTestCase:
tdSql.query("select * from tb0")
tdSql.checkRows(1)
def stop(self):
tdSql.close()
......
......@@ -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__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册