Merge pull request #4895 from taosdata/xiaoping/add_test_case
[TD-2693]<test>: add test case
This commit is contained in:
commit
06225de834
|
@ -131,7 +131,7 @@ class TDTestCase:
|
|||
tdSql.execute("alter table t0 set tag t1=2.1")
|
||||
|
||||
tdSql.query("show tables")
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkRows(2)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -190,6 +190,7 @@ python3 ./test.py -f stream/table_n.py
|
|||
|
||||
#alter table
|
||||
python3 ./test.py -f alter/alter_table_crash.py
|
||||
python3 ./test.py -f alter/alter_table.py
|
||||
|
||||
# client
|
||||
python3 ./test.py -f client/client.py
|
||||
|
|
|
@ -23,6 +23,8 @@ class TDTestCase:
|
|||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor(), logSql)
|
||||
|
||||
self.ts = 1538548685000
|
||||
|
||||
def run(self):
|
||||
tdSql.prepare()
|
||||
|
||||
|
@ -77,7 +79,37 @@ class TDTestCase:
|
|||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0, 0, 1)
|
||||
|
||||
## test case for https://jira.taosdata.com:18080/browse/TD-1930
|
||||
tdSql.execute("create table tb(ts timestamp, c1 int, c2 binary(10), c3 nchar(10), c4 float, c5 bool)")
|
||||
for i in range(10):
|
||||
tdSql.execute("insert into tb values(%d, %d, 'binary%d', 'nchar%d', %f, %d)" % (self.ts + i, i, i, i, i + 0.1, i % 2))
|
||||
|
||||
tdSql.error("select * from tb where c2 = binary2")
|
||||
tdSql.error("select * from tb where c3 = nchar2")
|
||||
|
||||
tdSql.query("select * from tb where c2 = 'binary2' ")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("select * from tb where c3 = 'nchar2' ")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("select * from tb where c1 = '2' ")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("select * from tb where c1 = 2 ")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("select * from tb where c4 = '0.1' ")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("select * from tb where c4 = 0.1 ")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("select * from tb where c5 = true ")
|
||||
tdSql.checkRows(5)
|
||||
|
||||
tdSql.query("select * from tb where c5 = 'true' ")
|
||||
tdSql.checkRows(5)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -56,6 +56,12 @@ class TDTestCase:
|
|||
tdSql.query("show stables like 'st%' ")
|
||||
tdSql.checkRows(3)
|
||||
|
||||
# case for defect: https://jira.taosdata.com:18080/browse/TD-2693
|
||||
tdSql.execute("create database db2")
|
||||
tdSql.execute("use db2")
|
||||
tdSql.execute("create table stb(ts timestamp, c int) tags(t int)")
|
||||
tdSql.error("insert into db2.tb6 using db2.stb tags(1) values(now 1) tb2 using db2. tags( )values(now 2)")
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
|
Loading…
Reference in New Issue