diff --git a/tests/pytest/alter/alter_table.py b/tests/pytest/alter/alter_table.py index f1d1da29900b4d703ef6a011a46650a2e05c2f9d..2982492f6567ad54a62a3fcca44d4f1ac9560697 100644 --- a/tests/pytest/alter/alter_table.py +++ b/tests/pytest/alter/alter_table.py @@ -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() diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index cb233f85b8132910b316fd130983769e99452bf9..d9bc185b6c326b79d933dafc50cd7db0e0d396f4 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -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 diff --git a/tests/pytest/query/query.py b/tests/pytest/query/query.py index d0750ac4a5cbe631e38017e6c81746659ad16e49..756aa0eda998aaa0aad30e94b2a7192d7d53bb65 100644 --- a/tests/pytest/query/query.py +++ b/tests/pytest/query/query.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() diff --git a/tests/pytest/table/create.py b/tests/pytest/table/create.py index a0991d674a23065cbec5ae3b69d6bdf37ee363ac..ecd4d011418ed7eca0d028262159c5614c0f490c 100644 --- a/tests/pytest/table/create.py +++ b/tests/pytest/table/create.py @@ -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__)