[TD-4019]<test> add test case
This commit is contained in:
parent
af53016793
commit
f4afe2f9d8
|
@ -56,6 +56,24 @@ class TDTestCase:
|
|||
tdSql.query(sql)
|
||||
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):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
|
Loading…
Reference in New Issue