From 75b0d86bb91a336d98deea674462e767c450958c Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Wed, 20 Oct 2021 14:18:55 +0800 Subject: [PATCH] [TS-424] add test case for update option 2 --- tests/pytest/update/update_options.py | 35 ++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/pytest/update/update_options.py b/tests/pytest/update/update_options.py index dd1b82fc59..f70ac6cc1d 100644 --- a/tests/pytest/update/update_options.py +++ b/tests/pytest/update/update_options.py @@ -63,6 +63,7 @@ class TDTestCase: tdLog.sleep(3) # test case for https://jira.taosdata.com:18080/browse/TS-402 + tdLog.info("test case for update option 1") tdSql.execute("create database test update 1") tdSql.execute("use test") @@ -75,7 +76,39 @@ class TDTestCase: tdSql.checkData(0, 2, None) tdSql.checkData(0, 3, 9) - + tdSql.execute("drop table if exists tb") + tdSql.execute("create table tb (ts timestamp, c1 int, c2 int, c3 int)") + tdSql.execute("insert into tb values(%d, 1, 2, 3)(%d, null, 4, 5)(%d, 6, null, 7)" % (self.ts, self.ts, self.ts)) + + tdSql.query("select * from tb") + tdSql.checkRows(1) + tdSql.checkData(0, 1, 6) + tdSql.checkData(0, 2, None) + tdSql.checkData(0, 3, 7) + + # https://jira.taosdata.com:18080/browse/TS-424 + tdLog.info("test case for update option 2") + tdSql.execute("create database db2 update 2") + tdSql.execute("use db2") + + tdSql.execute("create table tb (ts timestamp, c1 int, c2 int, c3 int)") + tdSql.execute("insert into tb values(%d, 1, 2, 3)(%d, null, null, 9)" % (self.ts, self.ts)) + + tdSql.query("select * from tb") + tdSql.checkRows(1) + tdSql.checkData(0, 1, 1) + tdSql.checkData(0, 2, 2) + tdSql.checkData(0, 3, 9) + + tdSql.execute("drop table if exists tb") + tdSql.execute("create table tb (ts timestamp, c1 int, c2 int, c3 int)") + tdSql.execute("insert into tb values(%d, 1, 2, 3)(%d, null, 4, 5)(%d, 6, null, 7)" % (self.ts, self.ts, self.ts)) + + tdSql.query("select * from tb") + tdSql.checkRows(1) + tdSql.checkData(0, 1, 6) + tdSql.checkData(0, 2, 4) + tdSql.checkData(0, 3, 7) def stop(self): -- GitLab