From 5ea788fb7e6d9d25f5e77d7dd15dc3de49da159f Mon Sep 17 00:00:00 2001 From: Chris Zhai Date: Mon, 6 May 2024 11:36:56 +0800 Subject: [PATCH] add test cases for td-29157 --- tests/parallel_test/cases.task | 1 + tests/system-test/1-insert/test_td29157.py | 35 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/system-test/1-insert/test_td29157.py diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 3fca381fda..5770497c7d 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -383,6 +383,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_ts4479.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_td29793.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/insert_timestamp.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_td29157.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show_tag_index.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/information_schema.py diff --git a/tests/system-test/1-insert/test_td29157.py b/tests/system-test/1-insert/test_td29157.py new file mode 100644 index 0000000000..a5a04f2f51 --- /dev/null +++ b/tests/system-test/1-insert/test_td29157.py @@ -0,0 +1,35 @@ +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + """Verify td-29157 + """ + def init(self, conn, logSql, replicaVer=1): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), True) + self.conn = conn + self.db_name = "td29157" + + def run(self): + # self.conn = taos.self.connect(host='192.168.1.51', user='root', password='taosdata') + self.conn.execute(f"drop database if exists {self.db_name}") + self.conn.execute(f"CREATE DATABASE {self.db_name}") + self.conn.execute(f"USE {self.db_name}") + + tdSql.execute("create table stb3 (ts timestamp, c0 varbinary(10)) tags(t0 varbinary(10));") + tdSql.execute("insert into ctb3 using stb3 tags(\"0x01\") values(now,NULL);") + tdSql.query("show tags from ctb3;") + + tdSql.execute("create table stb7 (ts timestamp, c0 geometry(500)) tags(t0 geometry(100));") + tdSql.execute("insert into ctb7 using stb7 tags('LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)') values(now,'POLYGON((1.0 1.0, 2.0 2.0, 1.0 1.0))');") + tdSql.query("show tags from ctb7;") + + def stop(self): + tdSql.execute("drop database if exists %s" % self.db_name) + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase())