From 50d9a1c5a5f3ab85c3b90db96c55f16b360e1e10 Mon Sep 17 00:00:00 2001 From: bryanchang0603 Date: Mon, 31 May 2021 11:11:02 +0800 Subject: [PATCH 1/2] [TD-4439] add test case --- tests/pytest/fulltest.sh | 1 + tests/pytest/insert/insert_before_use_db.py | 35 +++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/pytest/insert/insert_before_use_db.py diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index be2cfee04b..c93fbc5eb3 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -334,5 +334,6 @@ python3 ./test.py -f tag_lite/alter_tag.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py +python3 test.py -f insert/insert_before_use_db.py #======================p4-end=============== diff --git a/tests/pytest/insert/insert_before_use_db.py b/tests/pytest/insert/insert_before_use_db.py new file mode 100644 index 0000000000..94ee83b691 --- /dev/null +++ b/tests/pytest/insert/insert_before_use_db.py @@ -0,0 +1,35 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.error('insert into tb values (now + 10m, 10)') + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) From 39342aec9b2cee57fe5d5d29520b749360418a2d Mon Sep 17 00:00:00 2001 From: bryanchang0603 Date: Mon, 31 May 2021 11:16:56 +0800 Subject: [PATCH 2/2] [TD-4439] moldifying the test case --- tests/pytest/insert/insert_before_use_db.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/pytest/insert/insert_before_use_db.py b/tests/pytest/insert/insert_before_use_db.py index 94ee83b691..8cc02b3d4b 100644 --- a/tests/pytest/insert/insert_before_use_db.py +++ b/tests/pytest/insert/insert_before_use_db.py @@ -24,6 +24,10 @@ class TDTestCase: def run(self): tdSql.error('insert into tb values (now + 10m, 10)') + tdSql.prepare() + tdSql.error('insert into tb values (now + 10m, 10)') + tdSql.execute('drop database db') + tdSql.error('insert into tb values (now + 10m, 10)') def stop(self):