From 1626e4aeb8e4987793f18c5468effe10d9a27911 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Sat, 26 Mar 2022 14:29:35 +0800 Subject: [PATCH] [TS-1366]: add test case --- tests/parallel_test/cases.task | 1 + tests/pytest/table/create.py | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 89716f7a98..cf6ddf7206 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -748,3 +748,4 @@ 3,,develop-test,python3 ./test.py -f 2-query/TD-13414.py 8,,pytest,python3 test.py -f update/update2.py 4,,pytest,python3 test.py -f insert/line_insert.py +20,,pytest,python3 test.py -f table/create.py diff --git a/tests/pytest/table/create.py b/tests/pytest/table/create.py index a1eee6be63..4bd630f4c0 100644 --- a/tests/pytest/table/create.py +++ b/tests/pytest/table/create.py @@ -106,9 +106,9 @@ class TDTestCase: tdSql.query("select _block_dist() from db.`%s` ; " %self.stb1) tdSql.checkRows(0) - tdSql.query("show create stable db.`%s` ; " %self.stb1) + tdSql.query("show create table db.`%s` ; " %self.stb1) tdSql.checkData(0, 0, self.stb1) - tdSql.checkData(0, 1, "create table `%s` (ts TIMESTAMP,i INT) TAGS (j INT)" %self.stb1) + tdSql.checkData(0, 1, "CREATE TABLE `%s` (`ts` TIMESTAMP,`i` INT) TAGS (`j` INT)" %self.stb1) tdSql.execute("create table db.`table!1` using db.`%s` tags(1)" %self.stb1) tdSql.query("describe db.`table!1` ; ") @@ -221,7 +221,7 @@ class TDTestCase: tdSql.query("show create stable `%s` ; " %self.stb2) tdSql.checkData(0, 0, self.stb2) - tdSql.checkData(0, 1, "create table `%s` (ts TIMESTAMP,i INT) TAGS (j INT)" %self.stb2) + tdSql.checkData(0, 1, "CREATE TABLE `%s` (`ts` TIMESTAMP,`i` INT) TAGS (`j` INT)" %self.stb2) tdSql.execute("create table `table!2` using `%s` tags(1)" %self.stb2) tdSql.query("describe `table!2` ; ") @@ -310,7 +310,7 @@ class TDTestCase: tdSql.query("show create table `%s` ; " %self.regular_table) tdSql.checkData(0, 0, self.regular_table) - tdSql.checkData(0, 1, "CREATE TABLE `%s` (ts TIMESTAMP,i INT)" %self.regular_table) + tdSql.checkData(0, 1, "CREATE TABLE `%s` (`ts` TIMESTAMP,`i` INT)" %self.regular_table) tdSql.execute("insert into `%s` values(now, 1)" %self.regular_table) tdSql.query("select * from `%s` ; " %self.regular_table) @@ -341,7 +341,12 @@ class TDTestCase: tdSql.error("select * from `%s`" %self.regular_table) - + # TS-1366 + tdSql.execute("create table meters(ts timestamp, c1 int) tags(t1 int, t2 tinyint unsigned, t3 smallint unsigned, t4 int unsigned, t5 bigint unsigned, t6 int)") + tdSql.execute("create table meter1 using meters tags(1, 2, 3, 4, 5, 6)") + + tdSql.query("show create table meter1") + tdSql.checkData(0, 1, "CREATE TABLE `meter1` USING `meters` TAGS (1,2,3,4,5,6)") def stop(self): -- GitLab