Merge pull request #6033 from taosdata/xiaoping/test_case

[TD-4019]<test> add test case
This commit is contained in:
huili 2021-05-08 15:01:07 +08:00 committed by GitHub
commit 939e5d4110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -56,6 +56,24 @@ class TDTestCase:
tdSql.query(sql) tdSql.query(sql)
tdSql.checkRows(6) tdSql.checkRows(6)
tdSql.execute("create table stb(ts timestamp, options binary(7), city binary(10)) tags(type int)")
tdSql.execute("insert into tb1 using stb tags(1) values(%d, 'option1', 'beijing')" % self.ts)
tdSql.execute("insert into tb2 using stb tags(2) values(%d, 'option2', 'shanghai')" % self.ts)
tdSql.query("select options from stb where type = 1 limit 1 union all select options from stb where type = 2 limit 1")
tdSql.checkData(0, 0, "option1")
tdSql.checkData(1, 0, "option2")
tdSql.query("select 'dc' as options from stb where type = 1 limit 1 union all select 'ad' as options from stb where type = 2 limit 1")
tdSql.checkData(0, 0, "dc")
tdSql.checkData(1, 0, "ad")
tdSql.query("select 'dc' as options from stb where type = 1 limit 1 union all select 'adc' as options from stb where type = 2 limit 1")
tdSql.checkData(0, 0, "dc")
tdSql.checkData(1, 0, "adc")
tdSql.error("select 'dc' as options from stb where type = 1 limit 1 union all select 'ad' as city from stb where type = 2 limit 1")
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)