diff --git a/src/connector/python/linux/python3/taos/cursor.py b/src/connector/python/linux/python3/taos/cursor.py index ea7e9e5404d171a7f90291bc8574e18ca172055b..dc038a72bab142f128235fe67740f02f98216f8d 100644 --- a/src/connector/python/linux/python3/taos/cursor.py +++ b/src/connector/python/linux/python3/taos/cursor.py @@ -36,6 +36,7 @@ class TDengineCursor(object): self._block_rows = -1 self._block_iter = 0 self._affected_rows = 0 + self._logfile = "" if connection is not None: self._connection = connection @@ -85,6 +86,9 @@ class TDengineCursor(object): """ pass + def log(self, logfile): + self._logfile = logfile + def close(self): """Close the cursor. """ @@ -121,6 +125,10 @@ class TDengineCursor(object): res = CTaosInterface.query(self._connection._conn, stmt) # print(" << Query ({}) Exec Done".format(localSeqNum)) + if (self._logfile): + with open(self._logfile, "a") as logfile: + logfile.write("%s;\n" % operation) + if res == 0: if CTaosInterface.fieldsCount(self._connection._conn) == 0: self._affected_rows += CTaosInterface.affectedRows( diff --git a/tests/pytest/account/account_create.py b/tests/pytest/account/account_create.py index 24bcc8df2f2bee27c9b2bde93e0262fa607aeb96..85adfff19994a3fbb12611e28d9872fb6cb1aeca 100644 --- a/tests/pytest/account/account_create.py +++ b/tests/pytest/account/account_create.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): try: diff --git a/tests/pytest/account/account_del.py b/tests/pytest/account/account_del.py index 43690c6e3712f204bda424182778c45fd1479a49..7f05a39765099e896a56af9cfafcfce3957076e1 100644 --- a/tests/pytest/account/account_del.py +++ b/tests/pytest/account/account_del.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): print("==========step1") diff --git a/tests/pytest/alter/alter_stable.py b/tests/pytest/alter/alter_stable.py index 5772edcf7ff52a2ef4113bbea21ed877af4c85e4..6852f4ef4ab6730f6423ba388d4f088ca229312e 100644 --- a/tests/pytest/alter/alter_stable.py +++ b/tests/pytest/alter/alter_stable.py @@ -9,9 +9,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) self.types = [ "int", "bigint", diff --git a/tests/pytest/alter/alter_table.py b/tests/pytest/alter/alter_table.py index 6e0c591da695b5f8f573fe470017e1f4ba31b068..6d4f72556b4d1d4ae1a439ab6a56b2925e3d63aa 100644 --- a/tests/pytest/alter/alter_table.py +++ b/tests/pytest/alter/alter_table.py @@ -9,9 +9,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) self.types = [ "int", "bigint", diff --git a/tests/pytest/alter/file_corrupt.py b/tests/pytest/alter/file_corrupt.py index 51ea8822704829f49b1bcfde882b9055199c838e..28d50cdd38c9e7359f67996713f746fb0c213edb 100644 --- a/tests/pytest/alter/file_corrupt.py +++ b/tests/pytest/alter/file_corrupt.py @@ -19,9 +19,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/dbmgmt/database-name-boundary.py b/tests/pytest/dbmgmt/database-name-boundary.py index ff6dce22ae5751ecf1f353818833a7cdeb40b611..df3b027ba7ea8f315060be2820e8bea2c17fa8cc 100644 --- a/tests/pytest/dbmgmt/database-name-boundary.py +++ b/tests/pytest/dbmgmt/database-name-boundary.py @@ -23,9 +23,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): diff --git a/tests/pytest/dbmgmt/dropDB_memory_test.py b/tests/pytest/dbmgmt/dropDB_memory_test.py index b029945be244fac873e73dcdb6cd1c0a7abfcec3..0f0925c2688f524d88701ec6cf0e3b302e6a519d 100644 --- a/tests/pytest/dbmgmt/dropDB_memory_test.py +++ b/tests/pytest/dbmgmt/dropDB_memory_test.py @@ -19,9 +19,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/import_merge/importBlock1H.py b/tests/pytest/import_merge/importBlock1H.py index aef29444d6dc5197cb2670806808447c8567b1dc..fca37ff1b1e3a1f9129e9498076fc995ba8f0918 100644 --- a/tests/pytest/import_merge/importBlock1H.py +++ b/tests/pytest/import_merge/importBlock1H.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock1HO.py b/tests/pytest/import_merge/importBlock1HO.py index ad4bcf128839ea2e2ddc6c8857b38ce0f53e7a79..c853d3a6afe216c9de3bc2f19eabbed56bce2bb2 100644 --- a/tests/pytest/import_merge/importBlock1HO.py +++ b/tests/pytest/import_merge/importBlock1HO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock1HPO.py b/tests/pytest/import_merge/importBlock1HPO.py index 6aabc035ec8a530f3f710600b4dc163e9e8fe791..968f21f50f0d11f7e70c8b4fb809690ab04c6982 100644 --- a/tests/pytest/import_merge/importBlock1HPO.py +++ b/tests/pytest/import_merge/importBlock1HPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock1S.py b/tests/pytest/import_merge/importBlock1S.py index 4b2adfb961a51a09f2e2b83521cd2f3adee72d05..6a0ce18edfe96512d84c3132b465c253769ff38c 100644 --- a/tests/pytest/import_merge/importBlock1S.py +++ b/tests/pytest/import_merge/importBlock1S.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock1Sub.py b/tests/pytest/import_merge/importBlock1Sub.py index 343b87c7570c00fc48bbfec6393705ff46439732..2eaf5fc26e0f901ba5dc2b0439f80c00bdada940 100644 --- a/tests/pytest/import_merge/importBlock1Sub.py +++ b/tests/pytest/import_merge/importBlock1Sub.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock1T.py b/tests/pytest/import_merge/importBlock1T.py index 40f4bbfdecceab83a8846ab8224dc734cda8206a..ffac67a7e11b7e5d26c14fe3b6a97769d9bf8322 100644 --- a/tests/pytest/import_merge/importBlock1T.py +++ b/tests/pytest/import_merge/importBlock1T.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock1TO.py b/tests/pytest/import_merge/importBlock1TO.py index db8b036d6fb86a633781119b26eae88bba96e5f1..5d6c6624d94f21a4ad9252da227dd846e2363e76 100644 --- a/tests/pytest/import_merge/importBlock1TO.py +++ b/tests/pytest/import_merge/importBlock1TO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock1TPO.py b/tests/pytest/import_merge/importBlock1TPO.py index f2361712e7c33feb643b17a4b1e81f73da5e7c10..e7807e892a4f0b889515674a2cde634d6cc7add9 100644 --- a/tests/pytest/import_merge/importBlock1TPO.py +++ b/tests/pytest/import_merge/importBlock1TPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2H.py b/tests/pytest/import_merge/importBlock2H.py index 62552980bd481e7c0fa234709210200d591453ec..eea1e4bcf809a5561fb4f93bf2e92832824f9d74 100644 --- a/tests/pytest/import_merge/importBlock2H.py +++ b/tests/pytest/import_merge/importBlock2H.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2HO.py b/tests/pytest/import_merge/importBlock2HO.py index 0f53210f4ab276734380be985054e5d0fdc22c0c..99a9662f1c3bc38c1cb08084eeebd9fd9a8cd20a 100644 --- a/tests/pytest/import_merge/importBlock2HO.py +++ b/tests/pytest/import_merge/importBlock2HO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2HPO.py b/tests/pytest/import_merge/importBlock2HPO.py index 3b7ffbbe4434b69d6350532678292a28e19a1859..54afef6c06d4beff95a8a5e8a5e9048d5b856529 100644 --- a/tests/pytest/import_merge/importBlock2HPO.py +++ b/tests/pytest/import_merge/importBlock2HPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2S.py b/tests/pytest/import_merge/importBlock2S.py index 69b029183983b2e22903cb3fd5c150e6c173a049..9d4757709a7b58dcdecbe652c374169381f54112 100644 --- a/tests/pytest/import_merge/importBlock2S.py +++ b/tests/pytest/import_merge/importBlock2S.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2Sub.py b/tests/pytest/import_merge/importBlock2Sub.py index 5b937505840f4cc1f4e9a86ea74bb2f932cf8657..db43a492bcd5ee5fea81867d1887d47e83cc8f18 100644 --- a/tests/pytest/import_merge/importBlock2Sub.py +++ b/tests/pytest/import_merge/importBlock2Sub.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2T.py b/tests/pytest/import_merge/importBlock2T.py index 0d9b70299d9aa8292278547d02cdcf66a9b0edaf..c0d85fa3b07d341f90a32d14cb1a62c7467cc4c2 100644 --- a/tests/pytest/import_merge/importBlock2T.py +++ b/tests/pytest/import_merge/importBlock2T.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2TO.py b/tests/pytest/import_merge/importBlock2TO.py index fe57308c4266530a73a0be80b5fa38866c4a84de..05692c336de67d48a0f973f5c296cfff6dc0f00e 100644 --- a/tests/pytest/import_merge/importBlock2TO.py +++ b/tests/pytest/import_merge/importBlock2TO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlock2TPO.py b/tests/pytest/import_merge/importBlock2TPO.py index 4da52bd3f45ffc407b9c2199829fd128d250118b..817d2db3827b7484d0134094aa2c6fb6aee61857 100644 --- a/tests/pytest/import_merge/importBlock2TPO.py +++ b/tests/pytest/import_merge/importBlock2TPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importBlockbetween.py b/tests/pytest/import_merge/importBlockbetween.py index eea7f7ea7c014f886f2ee3b02211c19e534c6158..2e4ac8a7370af0c0645b0ff15aba62ff18be3ced 100644 --- a/tests/pytest/import_merge/importBlockbetween.py +++ b/tests/pytest/import_merge/importBlockbetween.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileH.py b/tests/pytest/import_merge/importCacheFileH.py index cd2b3a73f10ca63b65bd14559b487ec2da5510e6..3398f7bdad8d7524e223f0a2847b579081686476 100644 --- a/tests/pytest/import_merge/importCacheFileH.py +++ b/tests/pytest/import_merge/importCacheFileH.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileHO.py b/tests/pytest/import_merge/importCacheFileHO.py index 2e65c337b7c2a77f25726ca5806bd0ca02a55a53..19520dc3d048a267c03850b608d47db20394c43d 100644 --- a/tests/pytest/import_merge/importCacheFileHO.py +++ b/tests/pytest/import_merge/importCacheFileHO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileHPO.py b/tests/pytest/import_merge/importCacheFileHPO.py index f01ebd0d60dc5ef1bbcfa4e2e8ea45d75454d627..9e0a57fb462cdb6ae1dee3c8bfee4488c99a76a0 100644 --- a/tests/pytest/import_merge/importCacheFileHPO.py +++ b/tests/pytest/import_merge/importCacheFileHPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileS.py b/tests/pytest/import_merge/importCacheFileS.py index 0bb9107562e72fc2dded3cf918f904920529b94d..2f0af569e564b64cbb88c048762e8d41dcf21cbd 100644 --- a/tests/pytest/import_merge/importCacheFileS.py +++ b/tests/pytest/import_merge/importCacheFileS.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileSub.py b/tests/pytest/import_merge/importCacheFileSub.py index cd5d2509687a9be414b9328d1f66749ffc5138e6..300bb6e8d09f4484e22e64a0f2caf50cab7c8ab4 100644 --- a/tests/pytest/import_merge/importCacheFileSub.py +++ b/tests/pytest/import_merge/importCacheFileSub.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileT.py b/tests/pytest/import_merge/importCacheFileT.py index be79e26bc7786387a2f04dadb79616f641812de2..ab33cf6a93c4bbd7f27967f6a70b61fc62230f65 100644 --- a/tests/pytest/import_merge/importCacheFileT.py +++ b/tests/pytest/import_merge/importCacheFileT.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileTO.py b/tests/pytest/import_merge/importCacheFileTO.py index dd17de3adf9fd9bf640c92fd6c53e492467747c6..00e22da976618b4ee870a5702542f669693e3727 100644 --- a/tests/pytest/import_merge/importCacheFileTO.py +++ b/tests/pytest/import_merge/importCacheFileTO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importCacheFileTPO.py b/tests/pytest/import_merge/importCacheFileTPO.py index 948b99ed21d971ea99f347bc7e83adcb63973df8..c6089e1d687fea6ac900931a8171e45f4923f0cb 100644 --- a/tests/pytest/import_merge/importCacheFileTPO.py +++ b/tests/pytest/import_merge/importCacheFileTPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataH2.py b/tests/pytest/import_merge/importDataH2.py index b5e53d862e75935a66303f096374374a298b6a25..a21f0c47be2eb11a57182d22b56d4447ff2d7ab6 100644 --- a/tests/pytest/import_merge/importDataH2.py +++ b/tests/pytest/import_merge/importDataH2.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataHO.py b/tests/pytest/import_merge/importDataHO.py index f6d65a5c53621c52712e0deea8edd9c1eba6c2ae..fdcaedd83c99482914805cb65a067cbcbc78a128 100644 --- a/tests/pytest/import_merge/importDataHO.py +++ b/tests/pytest/import_merge/importDataHO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataHO2.py b/tests/pytest/import_merge/importDataHO2.py index 6246b55b324b5ccbd2543af0d7f68c153a89d0bd..b094701132677d6e72e834b16b7edc106682be14 100644 --- a/tests/pytest/import_merge/importDataHO2.py +++ b/tests/pytest/import_merge/importDataHO2.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataHPO.py b/tests/pytest/import_merge/importDataHPO.py index c749dbd1138ac56942e4a38752e01d18226946e2..9d74c0c3522eba3687618132c27ce95f86f91b91 100644 --- a/tests/pytest/import_merge/importDataHPO.py +++ b/tests/pytest/import_merge/importDataHPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastH.py b/tests/pytest/import_merge/importDataLastH.py index 830711a420428e27dc5edf4b56b71d0dc866ba24..c8e5f62423dc21254d215fac41926aeb9ce5ba40 100644 --- a/tests/pytest/import_merge/importDataLastH.py +++ b/tests/pytest/import_merge/importDataLastH.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastHO.py b/tests/pytest/import_merge/importDataLastHO.py index 037c81f0872517e3343bb46aaa9694a658d38cc8..33215997a4220b65228b630ebc350bf9dae15046 100644 --- a/tests/pytest/import_merge/importDataLastHO.py +++ b/tests/pytest/import_merge/importDataLastHO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastHPO.py b/tests/pytest/import_merge/importDataLastHPO.py index 46a7e5909da922cbc554d4f5c9893346c19e9c87..fa8542f35b8e9639db20dc2e1886fca36140e825 100644 --- a/tests/pytest/import_merge/importDataLastHPO.py +++ b/tests/pytest/import_merge/importDataLastHPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastS.py b/tests/pytest/import_merge/importDataLastS.py index 2dd7cdb744e600c0d2b0508afe4b8ad46b139425..2f595fef542955e616ef2e6ebcce7f23bce71d80 100644 --- a/tests/pytest/import_merge/importDataLastS.py +++ b/tests/pytest/import_merge/importDataLastS.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastSub.py b/tests/pytest/import_merge/importDataLastSub.py index bb9953057e10a29298d613a1e4047d1d6e5d1299..5c2069c90f52b4c786739f4d58e1ce41185c0f93 100644 --- a/tests/pytest/import_merge/importDataLastSub.py +++ b/tests/pytest/import_merge/importDataLastSub.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastT.py b/tests/pytest/import_merge/importDataLastT.py index 29f0afaf1a3a003734c1cc42674e9b96b5a7ced2..08e944eb6836a6f7f938639b40a6124f7bb64ec6 100644 --- a/tests/pytest/import_merge/importDataLastT.py +++ b/tests/pytest/import_merge/importDataLastT.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastTO.py b/tests/pytest/import_merge/importDataLastTO.py index 47639130b59f2cc67be66bbf9e2f4a2f35a50112..a82c0541414298accfdfb447c318ffafd88e5852 100644 --- a/tests/pytest/import_merge/importDataLastTO.py +++ b/tests/pytest/import_merge/importDataLastTO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataLastTPO.py b/tests/pytest/import_merge/importDataLastTPO.py index 41908365051586bbe4628582e0bfffa3bb97d838..ff75a1b2ae87891853fa93f0f49fff339cf6e488 100644 --- a/tests/pytest/import_merge/importDataLastTPO.py +++ b/tests/pytest/import_merge/importDataLastTPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataS.py b/tests/pytest/import_merge/importDataS.py index daa4b2e0252920e8f98779f01d81c6a8353c4071..37627e8d6bcc8319805275525ef7874132e0da4d 100644 --- a/tests/pytest/import_merge/importDataS.py +++ b/tests/pytest/import_merge/importDataS.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataSub.py b/tests/pytest/import_merge/importDataSub.py index e946a254c205b94c6a89702d7a037960c124ab99..17e2b141b7014fd2ce4d31f8c335e122aca730ba 100644 --- a/tests/pytest/import_merge/importDataSub.py +++ b/tests/pytest/import_merge/importDataSub.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataT.py b/tests/pytest/import_merge/importDataT.py index abb5e312ef5217e3b1b67583d28a09ea07d6a896..b0b7b82b790e81c475c714ba570a9a6f1801cc13 100644 --- a/tests/pytest/import_merge/importDataT.py +++ b/tests/pytest/import_merge/importDataT.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataTO.py b/tests/pytest/import_merge/importDataTO.py index 2a6d9e272b1cbe5c5bb4925538ba54a2d54b2791..c0b57136af7a51c1d184eb5789d95efc0148118c 100644 --- a/tests/pytest/import_merge/importDataTO.py +++ b/tests/pytest/import_merge/importDataTO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importDataTPO.py b/tests/pytest/import_merge/importDataTPO.py index 06d5cf3c1a2ff2d9326065f45b2451807effbe22..8a1c9264b433484e768cdfffbccdb0966e3d15cd 100644 --- a/tests/pytest/import_merge/importDataTPO.py +++ b/tests/pytest/import_merge/importDataTPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importHORestart.py b/tests/pytest/import_merge/importHORestart.py index cfbfa61c90ec1521d3db507f7a485b0f609e858d..f74c4c76d616753f8cadc87ba715e473eae0fb46 100644 --- a/tests/pytest/import_merge/importHORestart.py +++ b/tests/pytest/import_merge/importHORestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importHPORestart.py b/tests/pytest/import_merge/importHPORestart.py index 7e96d44a1a3390a351a45620ae29f02fdff06d51..e5f79fbe6c2eb686d63f5b7de81651a98072a986 100644 --- a/tests/pytest/import_merge/importHPORestart.py +++ b/tests/pytest/import_merge/importHPORestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importHRestart.py b/tests/pytest/import_merge/importHRestart.py index aa1783977ee833418c35803fa4069af9e448a6aa..be67039789dd660ddb0be8d56753737010e47e79 100644 --- a/tests/pytest/import_merge/importHRestart.py +++ b/tests/pytest/import_merge/importHRestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importHead.py b/tests/pytest/import_merge/importHead.py index 6971986ebc9bedd41326985ef0848dabc39aa260..80e6d92c69f2328bd35a43af820ca16658daf63b 100644 --- a/tests/pytest/import_merge/importHead.py +++ b/tests/pytest/import_merge/importHead.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importHeadOverlap.py b/tests/pytest/import_merge/importHeadOverlap.py index df5f07b5a250116b37e9d67f1e5b1dae28c7242c..535c0c285960c4657dc1cefeb0dd2cf128a2434f 100644 --- a/tests/pytest/import_merge/importHeadOverlap.py +++ b/tests/pytest/import_merge/importHeadOverlap.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importHeadPartOverlap.py b/tests/pytest/import_merge/importHeadPartOverlap.py index 8c9885e22ff9b83ca98207d9dc862b9a7e994cbb..85ddd64f0a66c5b962d1f33d517c1d28f9521d0a 100644 --- a/tests/pytest/import_merge/importHeadPartOverlap.py +++ b/tests/pytest/import_merge/importHeadPartOverlap.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastH.py b/tests/pytest/import_merge/importLastH.py index a6f9fa087c7db215a03745054ac6f8367d218e2f..17fa233e3723e1d9e6cc4ec97c8eac2716751f00 100644 --- a/tests/pytest/import_merge/importLastH.py +++ b/tests/pytest/import_merge/importLastH.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastHO.py b/tests/pytest/import_merge/importLastHO.py index e6468b243e05941cc82310de2c3dc197ab4da7d9..adb44fc0eab9a4923b0896a1357b24603f1ff3fd 100644 --- a/tests/pytest/import_merge/importLastHO.py +++ b/tests/pytest/import_merge/importLastHO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastHPO.py b/tests/pytest/import_merge/importLastHPO.py index 4a299ed82369a1b81b2a419f3d0f45d0b64404f9..d8ed2d9ef10dbaa52e92ba50625be25c495091ea 100644 --- a/tests/pytest/import_merge/importLastHPO.py +++ b/tests/pytest/import_merge/importLastHPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastS.py b/tests/pytest/import_merge/importLastS.py index 2a5de46eb2d0a55039caddf352af9dba7f258fca..bf222a0d5f3c27c5c7774b384799a6a0aa5e4114 100644 --- a/tests/pytest/import_merge/importLastS.py +++ b/tests/pytest/import_merge/importLastS.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastSub.py b/tests/pytest/import_merge/importLastSub.py index fa1b2387f317560784bb2b0e28cfe6309a408c89..5a6b9f41502970149257b1aef5c7a37824401768 100644 --- a/tests/pytest/import_merge/importLastSub.py +++ b/tests/pytest/import_merge/importLastSub.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastT.py b/tests/pytest/import_merge/importLastT.py index b7a1e58bc5d19356c1228abe2bfb552aa0277f74..2b1be1fe2b37aa5e4d59bb6ecef7d0bb2180cf9d 100644 --- a/tests/pytest/import_merge/importLastT.py +++ b/tests/pytest/import_merge/importLastT.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastTO.py b/tests/pytest/import_merge/importLastTO.py index 541cbd29ca08b61f1a94b0180673552f66452c09..ce189f63718956991982bd33296eb71bd5a82d45 100644 --- a/tests/pytest/import_merge/importLastTO.py +++ b/tests/pytest/import_merge/importLastTO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importLastTPO.py b/tests/pytest/import_merge/importLastTPO.py index 6ec21d0c79e935b7581d7414d3dc098217f76204..627d090855ac320f56a90fb647101e8ccc315acd 100644 --- a/tests/pytest/import_merge/importLastTPO.py +++ b/tests/pytest/import_merge/importLastTPO.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importSRestart.py b/tests/pytest/import_merge/importSRestart.py index 0771b8bf9c3b9d758363f3089dcdee0c8830f4f3..29f5a19b54fb0cbf1eb81a66c66813f3fcdd9982 100644 --- a/tests/pytest/import_merge/importSRestart.py +++ b/tests/pytest/import_merge/importSRestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importSpan.py b/tests/pytest/import_merge/importSpan.py index 736c4bad64038ff92704cbf5a55e922cd99cfe29..4e20e9754f86b287328aacb3e96f9ac0e7c4eee6 100644 --- a/tests/pytest/import_merge/importSpan.py +++ b/tests/pytest/import_merge/importSpan.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importSubRestart.py b/tests/pytest/import_merge/importSubRestart.py index f7f33d32c1a9f149bbcef7174bca0f087caadc40..b1a6f30c436c5aa52d5ee4affa03d18c5475ced7 100644 --- a/tests/pytest/import_merge/importSubRestart.py +++ b/tests/pytest/import_merge/importSubRestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importTORestart.py b/tests/pytest/import_merge/importTORestart.py index 194756cd1291f3a9ef2f6c13e896be4e053fc479..07eb6c28cb79c16504f2acab036a3b66c3bccabf 100644 --- a/tests/pytest/import_merge/importTORestart.py +++ b/tests/pytest/import_merge/importTORestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importTPORestart.py b/tests/pytest/import_merge/importTPORestart.py index 36d4b64390807c11a51beb36368d2aafa841d3af..10bbf3efced90b6c255326c0e8b8e0c106a3a038 100644 --- a/tests/pytest/import_merge/importTPORestart.py +++ b/tests/pytest/import_merge/importTPORestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importTRestart.py b/tests/pytest/import_merge/importTRestart.py index 9308518d8c442c1e18ca39133a352e1659bfed72..63a9368eca2b6a3377b32dc6a3948cf5a0ba1186 100644 --- a/tests/pytest/import_merge/importTRestart.py +++ b/tests/pytest/import_merge/importTRestart.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importTail.py b/tests/pytest/import_merge/importTail.py index a80db730a0d0c02bb30d402986a7e0e355f9d046..a552edb2449d8c8360403561398070279b7143c9 100644 --- a/tests/pytest/import_merge/importTail.py +++ b/tests/pytest/import_merge/importTail.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importTailOverlap.py b/tests/pytest/import_merge/importTailOverlap.py index 98596d2f77ce679b782a288bc2be1ce0103a070d..78e51f93f92ab510d56b55201c801cc53fbded12 100644 --- a/tests/pytest/import_merge/importTailOverlap.py +++ b/tests/pytest/import_merge/importTailOverlap.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importTailPartOverlap.py b/tests/pytest/import_merge/importTailPartOverlap.py index 0263114a25c3e9e5d56329ad6d52502bf8fcbb9b..e433cb66f37102a085c0faebbd85122b163c9c47 100644 --- a/tests/pytest/import_merge/importTailPartOverlap.py +++ b/tests/pytest/import_merge/importTailPartOverlap.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/import_merge/importToCommit.py b/tests/pytest/import_merge/importToCommit.py index b1a0065d476b06e1192c0600b02e77c3324435b7..6cac2ed6bfcb4bb0c3b81f87aa3c4d875d32dfb1 100644 --- a/tests/pytest/import_merge/importToCommit.py +++ b/tests/pytest/import_merge/importToCommit.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 1 diff --git a/tests/pytest/insert/basic.py b/tests/pytest/insert/basic.py index 35f830d951d4e6d7ec14eb2a1f5d4b34d0b98b71..dcb5834d559968a964c4057c61d9b6a40cf8ab15 100644 --- a/tests/pytest/insert/basic.py +++ b/tests/pytest/insert/basic.py @@ -18,9 +18,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/bigint.py b/tests/pytest/insert/bigint.py index 214200900a569c9336d5ee05bd088cbd405bb965..7c7d2d0f9507e8688dd73bcefe88632361c80c70 100644 --- a/tests/pytest/insert/bigint.py +++ b/tests/pytest/insert/bigint.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/binary-boundary.py b/tests/pytest/insert/binary-boundary.py index 583217a73261379bcb0101c360a51a7e29cf785d..bb86ddf61c3abcd56d2bb27f7f7da5f1d22069ee 100644 --- a/tests/pytest/insert/binary-boundary.py +++ b/tests/pytest/insert/binary-boundary.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/binary.py b/tests/pytest/insert/binary.py index 677ae4bf298cd22cefce8f18ee255ea2c982e155..0d583aa2cce26fb400e4a943f49cacee96c933d6 100644 --- a/tests/pytest/insert/binary.py +++ b/tests/pytest/insert/binary.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/bool.py b/tests/pytest/insert/bool.py index c175afd8b556f0a9e82c23c4a6d62eacf45a0f70..1412567cd75721d99308ddadfe7b35032207faaa 100644 --- a/tests/pytest/insert/bool.py +++ b/tests/pytest/insert/bool.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/date.py b/tests/pytest/insert/date.py index fb7f1816c4755f4c5365a2ea01d8893a91623b0c..6e22e5b72ee465bfd32b9fd839c8ab0deba9267c 100644 --- a/tests/pytest/insert/date.py +++ b/tests/pytest/insert/date.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/double.py b/tests/pytest/insert/double.py index 19be9653c0852b541de8d2430640b23c85ee7e86..1b66ed1c44c7cec645be1f0f23866c7f06501ebc 100644 --- a/tests/pytest/insert/double.py +++ b/tests/pytest/insert/double.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/float.py b/tests/pytest/insert/float.py index 414833877ea63fd405b71ced4124438b04c2d699..8b6277d43657c1da3fa5e65ddbaa073fd7a7189e 100644 --- a/tests/pytest/insert/float.py +++ b/tests/pytest/insert/float.py @@ -19,9 +19,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/int.py b/tests/pytest/insert/int.py index 350426a5bde54dcd535577265c6f405cca364f04..4a94a331d63eaf04fd7d8ec37f4814b385017d22 100644 --- a/tests/pytest/insert/int.py +++ b/tests/pytest/insert/int.py @@ -20,9 +20,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/multi.py b/tests/pytest/insert/multi.py index c14d7dc2e0ac5d1317990cd2519671fdfb426b50..5f81f12fdbf471e4680d48c743d64878777788cd 100644 --- a/tests/pytest/insert/multi.py +++ b/tests/pytest/insert/multi.py @@ -20,9 +20,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/nchar-boundary.py b/tests/pytest/insert/nchar-boundary.py index 255cc5b79a57152c9efe1664ff1afbeb7c03abe4..05a66f60661c18de5a4fbf55f9850932d3d36e7a 100644 --- a/tests/pytest/insert/nchar-boundary.py +++ b/tests/pytest/insert/nchar-boundary.py @@ -18,9 +18,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/nchar-unicode.py b/tests/pytest/insert/nchar-unicode.py index 12eef379d39c535c4357e7ce0d27ccdbdb1a0602..152a09723ed262cfa6ceaad15ba89829996182b2 100644 --- a/tests/pytest/insert/nchar-unicode.py +++ b/tests/pytest/insert/nchar-unicode.py @@ -18,9 +18,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/nchar.py b/tests/pytest/insert/nchar.py index d61a44844dae7997721f5cae9e4e38d1f217e05a..b8e365f143abfca2eb39f258078fb59120c168e1 100644 --- a/tests/pytest/insert/nchar.py +++ b/tests/pytest/insert/nchar.py @@ -18,9 +18,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/smallint.py b/tests/pytest/insert/smallint.py index 0d85e45cfa82866542d2bf465624983155992f7c..16322e9aeb801ae92b75b920922991206a4b2e35 100644 --- a/tests/pytest/insert/smallint.py +++ b/tests/pytest/insert/smallint.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/insert/tinyint.py b/tests/pytest/insert/tinyint.py index 6d7178054e749f99a1ee6f40097f67ecc74a4c63..a10c999e8c2f0fe070347651f9246e3734104eca 100644 --- a/tests/pytest/insert/tinyint.py +++ b/tests/pytest/insert/tinyint.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/query/query.py b/tests/pytest/query/query.py index 68b8baab64afce7c48eb51a2173e6d1187a1b7b8..da0ef96d0efde77b716ded06cc7efaa96ea3bb7b 100644 --- a/tests/pytest/query/query.py +++ b/tests/pytest/query/query.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/query/tbname.py b/tests/pytest/query/tbname.py index 5ea89fff82a1ef4af0b6f8d9a14671fb97180cd5..08416ba3eda378cce96fcaa8051e1d06a75d6b28 100644 --- a/tests/pytest/query/tbname.py +++ b/tests/pytest/query/tbname.py @@ -19,9 +19,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/random-test/random-test.py b/tests/pytest/random-test/random-test.py index a3f4c00ea5cc68eb187b24bf311074df88c671b6..7caa07e5d2f6facee088cf2b5a3500d8ca3d4b4c 100644 --- a/tests/pytest/random-test/random-test.py +++ b/tests/pytest/random-test/random-test.py @@ -110,9 +110,9 @@ class Test: class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/stable/insert.py b/tests/pytest/stable/insert.py index 9f9e7c6e066db628f66cd2d9e897f471ee5cff56..3d37e6726c965a8963f728fdd1d8dc89e1cee339 100644 --- a/tests/pytest/stable/insert.py +++ b/tests/pytest/stable/insert.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/table/alter_column.py b/tests/pytest/table/alter_column.py index 15bc9f7aa7ec3264f266f7f1ab0c57eb29f6aa44..73fdbe1ae91c71e0ce9a1574239dbee9ec3fd988 100644 --- a/tests/pytest/table/alter_column.py +++ b/tests/pytest/table/alter_column.py @@ -20,9 +20,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/table/boundary.py b/tests/pytest/table/boundary.py index faa222231bda5234dd624ffde5bf805b13524928..b68671c61a8c3e8f36372a3692732cbaec0635a7 100644 --- a/tests/pytest/table/boundary.py +++ b/tests/pytest/table/boundary.py @@ -10,140 +10,133 @@ from util.sql import * class TDTestCase: - def init( self, conn ): + def init(self, conn): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) - - def getLimitFromSourceCode( self, name ): + def getLimitFromSourceCode(self, name): cmd = "grep -w '#define %s' ../../src/inc/taosdef.h|awk '{print $3}'" % name return int(subprocess.check_output(cmd, shell=True)) - - def generateString( self, length ): + def generateString(self, length): chars = string.ascii_uppercase + string.ascii_lowercase v = "" - for i in range( length ): - v += random.choice( chars ) + for i in range(length): + v += random.choice(chars) return v - - def checkTagBoundaries( self ): - tdLog.debug( "checking tag boundaries" ) + def checkTagBoundaries(self): + tdLog.debug("checking tag boundaries") tdSql.prepare() - maxTags = self.getLimitFromSourceCode( 'TSDB_MAX_TAGS' ) - totalTagsLen = self.getLimitFromSourceCode( 'TSDB_MAX_TAGS_LEN' ) - tdLog.notice( "max tags is %d" % maxTags ) - tdLog.notice( "max total tag length is %d" % totalTagsLen ) + maxTags = self.getLimitFromSourceCode('TSDB_MAX_TAGS') + totalTagsLen = self.getLimitFromSourceCode('TSDB_MAX_TAGS_LEN') + tdLog.notice("max tags is %d" % maxTags) + tdLog.notice("max total tag length is %d" % totalTagsLen) # for binary tags, 2 bytes are used for length tagLen = (totalTagsLen - maxTags * 2) // maxTags firstTagLen = totalTagsLen - 2 * maxTags - tagLen * (maxTags - 1) sql = "create table cars(ts timestamp, f int) tags(t0 binary(%d)" % firstTagLen - for i in range( 1, maxTags ): + for i in range(1, maxTags): sql += ", t%d binary(%d)" % (i, tagLen) sql += ");" - tdLog.debug( "creating super table: " + sql ) - tdSql.execute( sql ) - tdSql.query( 'show stables' ) - tdSql.checkRows( 1 ) + tdLog.debug("creating super table: " + sql) + tdSql.execute(sql) + tdSql.query('show stables') + tdSql.checkRows(1) - for i in range( 10 ): + for i in range(10): sql = "create table car%d using cars tags('%d'" % (i, i) sql += ", '0'" * (maxTags - 1) + ");" - tdLog.debug( "creating table: " + sql ) - tdSql.execute( sql ) + tdLog.debug("creating table: " + sql) + tdSql.execute(sql) sql = "insert into car%d values(now, 0);" % i - tdLog.debug( "inserting data: " + sql ) - tdSql.execute( sql ) - - tdSql.query( 'show tables' ) - tdLog.info( 'tdSql.checkRow(10)' ) - tdSql.checkRows( 10 ) + tdLog.debug("inserting data: " + sql) + tdSql.execute(sql) - tdSql.query( 'select * from cars;' ) - tdSql.checkRows( 10 ) + tdSql.query('show tables') + tdLog.info('tdSql.checkRow(10)') + tdSql.checkRows(10) + tdSql.query('select * from cars;') + tdSql.checkRows(10) - def checkColumnBoundaries( self ): - tdLog.debug( "checking column boundaries" ) + def checkColumnBoundaries(self): + tdLog.debug("checking column boundaries") tdSql.prepare() # one column is for timestamp - maxCols = self.getLimitFromSourceCode( 'TSDB_MAX_COLUMNS' ) - 1 + maxCols = self.getLimitFromSourceCode('TSDB_MAX_COLUMNS') - 1 sql = "create table cars (ts timestamp" - for i in range( maxCols ): + for i in range(maxCols): sql += ", c%d int" % i sql += ");" - tdSql.execute( sql ) - tdSql.query( 'show tables' ) - tdSql.checkRows( 1 ) + tdSql.execute(sql) + tdSql.query('show tables') + tdSql.checkRows(1) sql = "insert into cars values (now" - for i in range( maxCols ): + for i in range(maxCols): sql += ", %d" % i sql += ");" - tdSql.execute( sql ) - tdSql.query( 'select * from cars' ) - tdSql.checkRows( 1 ) + tdSql.execute(sql) + tdSql.query('select * from cars') + tdSql.checkRows(1) - - def checkTableNameBoundaries( self ): - tdLog.debug( "checking table name boundaries" ) + def checkTableNameBoundaries(self): + tdLog.debug("checking table name boundaries") tdSql.prepare() - maxTableNameLen = self.getLimitFromSourceCode( 'TSDB_TABLE_NAME_LEN' ) - tdLog.notice( "table name max length is %d" % maxTableNameLen ) - - name = self.generateString( maxTableNameLen - 1) - tdLog.info( "table name is '%s'" % name ) + maxTableNameLen = self.getLimitFromSourceCode('TSDB_TABLE_NAME_LEN') + tdLog.notice("table name max length is %d" % maxTableNameLen) - tdSql.execute( "create table %s (ts timestamp, value int)" % name ) - tdSql.execute( "insert into %s values(now, 0)" % name ) + name = self.generateString(maxTableNameLen - 1) + tdLog.info("table name is '%s'" % name) - tdSql.query( 'show tables' ) - tdSql.checkRows( 1 ) + tdSql.execute("create table %s (ts timestamp, value int)" % name) + tdSql.execute("insert into %s values(now, 0)" % name) - tdSql.query( 'select * from %s' % name ) - tdSql.checkRows( 1 ) + tdSql.query('show tables') + tdSql.checkRows(1) + tdSql.query('select * from %s' % name) + tdSql.checkRows(1) - def checkRowBoundaries( self ): - tdLog.debug( "checking row boundaries" ) + def checkRowBoundaries(self): + tdLog.debug("checking row boundaries") tdSql.prepare() # 8 bytes for timestamp maxRowSize = 65536 - 8 - maxCols = self.getLimitFromSourceCode( 'TSDB_MAX_COLUMNS' ) - 1 + maxCols = self.getLimitFromSourceCode('TSDB_MAX_COLUMNS') - 1 # for binary cols, 2 bytes are used for length colLen = (maxRowSize - maxCols * 2) // maxCols firstColLen = maxRowSize - 2 * maxCols - colLen * (maxCols - 1) sql = "create table cars (ts timestamp, c0 binary(%d)" % firstColLen - for i in range( 1, maxCols ): + for i in range(1, maxCols): sql += ", c%d binary(%d)" % (i, colLen) sql += ");" - tdSql.execute( sql ) - tdSql.query( 'show tables' ) - tdSql.checkRows( 1 ) + tdSql.execute(sql) + tdSql.query('show tables') + tdSql.checkRows(1) - col = self.generateString( firstColLen ) + col = self.generateString(firstColLen) sql = "insert into cars values (now, '%s'" % col - col = self.generateString( colLen ) - for i in range( 1, maxCols ): - sql += ", '%s'" % col + col = self.generateString(colLen) + for i in range(1, maxCols): + sql += ", '%s'" % col sql += ");" - tdLog.info( sql ); - tdSql.execute( sql ) - tdSql.query( "select * from cars" ) - tdSql.checkRows( 1 ) - + tdLog.info(sql) + tdSql.execute(sql) + tdSql.query("select * from cars") + tdSql.checkRows(1) def run(self): self.checkTagBoundaries() @@ -151,7 +144,6 @@ class TDTestCase: self.checkTableNameBoundaries() self.checkRowBoundaries() - def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/pytest/table/column_name.py b/tests/pytest/table/column_name.py index aa958fd60c98dc86f031f6980ca476802e5ff805..a180d3f752f36626c1c55adade24584a208dbe8d 100644 --- a/tests/pytest/table/column_name.py +++ b/tests/pytest/table/column_name.py @@ -10,9 +10,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/table/column_num.py b/tests/pytest/table/column_num.py index 877f0409dc4fa3d723606b62fc939c76809ef054..3abedb083c8b68c3f3f06b094e06a3d9c686b82e 100644 --- a/tests/pytest/table/column_num.py +++ b/tests/pytest/table/column_num.py @@ -8,9 +8,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/table/create-a-lot.py b/tests/pytest/table/create-a-lot.py new file mode 100644 index 0000000000000000000000000000000000000000..7db4a8eacac9ede3d47e14bee1a4fc901c0ab270 --- /dev/null +++ b/tests/pytest/table/create-a-lot.py @@ -0,0 +1,45 @@ +################################################################### +# 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 +import taos +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.prepare() + + print("==============step1") + print("prepare data") + + for x in range(0, 1000000): + tb_name = "tb%d" % x + tdLog.info("create table %s (ts timestamp, i int)" % tb_name) + tdSql.execute("create table %s (ts timestamp, i int)" % tb_name) + tdLog.info("insert into %s values(now, 1)" % tb_name) + tdSql.execute("insert into %s values(now, 1)" % tb_name) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/pytest/table/create.py b/tests/pytest/table/create.py index b456b444f4b361784b2bb157e453bf5ae1e57c85..8fedd4e92046f58a94db66a1e696edfe5d253982 100644 --- a/tests/pytest/table/create.py +++ b/tests/pytest/table/create.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/table/db_table.py b/tests/pytest/table/db_table.py index d4a8568375c0d467c195af924058c70c8bbc2ab7..5ead829e26e8e6a64fdb28af6ad34499663df7b2 100644 --- a/tests/pytest/table/db_table.py +++ b/tests/pytest/table/db_table.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/table/del_stable.py b/tests/pytest/table/del_stable.py index 3932f325362457dbd98838863eafddd94716f2f3..e7fd0f1fb124f60a9bb63d67423ecec5ec358f87 100644 --- a/tests/pytest/table/del_stable.py +++ b/tests/pytest/table/del_stable.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/table/tablename-boundary.py b/tests/pytest/table/tablename-boundary.py index 335073065c5a5b6af82469c967bac1df623d5e5a..ce843c3fe70d0ecd3438c746c5f5b5af273e4e77 100644 --- a/tests/pytest/table/tablename-boundary.py +++ b/tests/pytest/table/tablename-boundary.py @@ -10,9 +10,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/3.py b/tests/pytest/tag_lite/3.py index e5b5ba05e08dc55bb9f9469d618432f1e17e7f68..68d2e6c5baf3a26539e4b97552ef8bcda06cd977 100644 --- a/tests/pytest/tag_lite/3.py +++ b/tests/pytest/tag_lite/3.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/4.py b/tests/pytest/tag_lite/4.py index 2b5b69a96572b6f71954c1838824b39c1f671da4..66641f9dfea430ea7a48715e70939bd57fa932d2 100644 --- a/tests/pytest/tag_lite/4.py +++ b/tests/pytest/tag_lite/4.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/5.py b/tests/pytest/tag_lite/5.py index 66fc4b721cd3ed34d5c54027c33d94b9b54c3d21..6e94e692cd6db96e271deb4902908a001235d8cd 100644 --- a/tests/pytest/tag_lite/5.py +++ b/tests/pytest/tag_lite/5.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/6.py b/tests/pytest/tag_lite/6.py index ca1058d51bf75e5450b16c577d6ade1024868f3c..52f6fe1b3764f1bee4da38c8616445cfc8d0f465 100644 --- a/tests/pytest/tag_lite/6.py +++ b/tests/pytest/tag_lite/6.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/add.py b/tests/pytest/tag_lite/add.py index e9bc01afd29607fe621a7a6d07e0b0389d4a264c..e9e3675485d6b25e302e13beb6579ee0c24e64f1 100644 --- a/tests/pytest/tag_lite/add.py +++ b/tests/pytest/tag_lite/add.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/bigint.py b/tests/pytest/tag_lite/bigint.py index 875633901cfcc1374c765bcb355e24966ef5a069..77a161c5bc7bf77e14a2f28197dca8729ee79c15 100644 --- a/tests/pytest/tag_lite/bigint.py +++ b/tests/pytest/tag_lite/bigint.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/binary.py b/tests/pytest/tag_lite/binary.py index 476d9e4062687011c8d6332a928b6407550c9de5..543b00b34e9d760502a1095e102d8afa96b14e63 100644 --- a/tests/pytest/tag_lite/binary.py +++ b/tests/pytest/tag_lite/binary.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/binary_binary.py b/tests/pytest/tag_lite/binary_binary.py index e05f7e3d0eb89b6c800d9d5fc86160df0c077260..c0d1c0bfe7ad6d460d33fb7f6b8cbd30c05af2dc 100644 --- a/tests/pytest/tag_lite/binary_binary.py +++ b/tests/pytest/tag_lite/binary_binary.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/bool.py b/tests/pytest/tag_lite/bool.py index e8b00ce4d97fd5b2e4adf6ddc2dd1653a178991d..c43d5b2ee5da8b576e079073cbaeabf2d91440e5 100644 --- a/tests/pytest/tag_lite/bool.py +++ b/tests/pytest/tag_lite/bool.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/bool_binary.py b/tests/pytest/tag_lite/bool_binary.py index 7df7ba8c03e352bea77d18ef685817f17bef7cee..7105cc4e7874802e108c2a1cf6416773048cf9bb 100644 --- a/tests/pytest/tag_lite/bool_binary.py +++ b/tests/pytest/tag_lite/bool_binary.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/bool_int.py b/tests/pytest/tag_lite/bool_int.py index 9706cca9450bbad424aeae8c4c813af44c571667..b7504b1127edd27c36394aa92d329393dd003065 100644 --- a/tests/pytest/tag_lite/bool_int.py +++ b/tests/pytest/tag_lite/bool_int.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/change.py b/tests/pytest/tag_lite/change.py index ab2c80485b357b2df6e95d0795cf068e9cb155c0..e1df901d5b98b0619ceb55b04888845b89d41a3a 100644 --- a/tests/pytest/tag_lite/change.py +++ b/tests/pytest/tag_lite/change.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/column.py b/tests/pytest/tag_lite/column.py index 6b2285794ddd2a66ba7a74b5c19a384ac221ac4a..4669f7449815b30ecc71b2367e259dc1b052547a 100644 --- a/tests/pytest/tag_lite/column.py +++ b/tests/pytest/tag_lite/column.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/commit.py b/tests/pytest/tag_lite/commit.py index 4070ebd368667ebe28fd0e917c2e103cdec90d93..4ad2ecf8f9ec8db219c4275e29326768d0de79c1 100644 --- a/tests/pytest/tag_lite/commit.py +++ b/tests/pytest/tag_lite/commit.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/create-tags-boundary.py b/tests/pytest/tag_lite/create-tags-boundary.py index e80f458f0ccdd7d564143058bfd9b059a93877e9..b98ae627c2999e96d233dd63ba8c1ce795531265 100644 --- a/tests/pytest/tag_lite/create-tags-boundary.py +++ b/tests/pytest/tag_lite/create-tags-boundary.py @@ -19,9 +19,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/create.py b/tests/pytest/tag_lite/create.py index 446f8fd38e9ac3a505b20f2c74aec2d08c777ca1..39a2d83a31cfab8565f6c36e87623e85204aa077 100644 --- a/tests/pytest/tag_lite/create.py +++ b/tests/pytest/tag_lite/create.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/datatype-without-alter.py b/tests/pytest/tag_lite/datatype-without-alter.py index 1a8d05d648a4c0fe7bb28458f15bd4e996ad946c..42bc42bdbf61cc3f88d83b5da04883742ea7ebc6 100644 --- a/tests/pytest/tag_lite/datatype-without-alter.py +++ b/tests/pytest/tag_lite/datatype-without-alter.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 10 diff --git a/tests/pytest/tag_lite/datatype.py b/tests/pytest/tag_lite/datatype.py index 1fcf7ce19eab0409fc28b0eed0222c8d5e3a7f5b..bc99cf74b0be5fc20538c8a1ad0d060854d9cba2 100644 --- a/tests/pytest/tag_lite/datatype.py +++ b/tests/pytest/tag_lite/datatype.py @@ -20,9 +20,9 @@ from util.dnodes import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): self.ntables = 10 diff --git a/tests/pytest/tag_lite/delete.py b/tests/pytest/tag_lite/delete.py index 34fe6e6f51d627041aaf12d5402920b88200dca9..d4a55a4a75b2da33764d700cfd7197b758ee7350 100644 --- a/tests/pytest/tag_lite/delete.py +++ b/tests/pytest/tag_lite/delete.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/double.py b/tests/pytest/tag_lite/double.py index 92e7d23677f3f76b79b4f300c5777ef51f322985..f70c6871af213e0f78193189af984e7d9b88bbcf 100644 --- a/tests/pytest/tag_lite/double.py +++ b/tests/pytest/tag_lite/double.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/filter.py b/tests/pytest/tag_lite/filter.py index b726e7646eee9539cf6d1e20f645918fa1989164..cdba8964ef28360aecde7742dc8e559b3f4e3228 100644 --- a/tests/pytest/tag_lite/filter.py +++ b/tests/pytest/tag_lite/filter.py @@ -18,9 +18,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/float.py b/tests/pytest/tag_lite/float.py index 19140abe13e37b0f335b73ca9af622f4c77614a3..1bfb1ac94d85afcf2e67dad73b44e0e3947798a4 100644 --- a/tests/pytest/tag_lite/float.py +++ b/tests/pytest/tag_lite/float.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/int.py b/tests/pytest/tag_lite/int.py index 769e6009c8c8383bb3bae520740da7d4f8358bf7..b83124479000f2d98ca02d7696aacf245bb4dc58 100644 --- a/tests/pytest/tag_lite/int.py +++ b/tests/pytest/tag_lite/int.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/int_binary.py b/tests/pytest/tag_lite/int_binary.py index 2f3f818cd2f7181ce07c55ab1d476030e4683392..62d8f2a6041ea67d2853cc45c2d1dbf8ca754414 100644 --- a/tests/pytest/tag_lite/int_binary.py +++ b/tests/pytest/tag_lite/int_binary.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/int_float.py b/tests/pytest/tag_lite/int_float.py index 4171085ad73420a8375c536c6813fdcb22cabcf1..8a544c6110b217422db950ecbac1509cf357f25d 100644 --- a/tests/pytest/tag_lite/int_float.py +++ b/tests/pytest/tag_lite/int_float.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/set.py b/tests/pytest/tag_lite/set.py index 6e1a5aed9dae86a210ca6d39f8c807f0dbeda61c..44f5a0890dfea91bbafe03e15c9dc580bd862401 100644 --- a/tests/pytest/tag_lite/set.py +++ b/tests/pytest/tag_lite/set.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/smallint.py b/tests/pytest/tag_lite/smallint.py index 324deb3632d236bad22f729bda95e913cc070df5..a047b0afeec156b4d685d6b6cab1d03346ae74cc 100644 --- a/tests/pytest/tag_lite/smallint.py +++ b/tests/pytest/tag_lite/smallint.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/tag_lite/tinyint.py b/tests/pytest/tag_lite/tinyint.py index 9406f0b6c75e47225275723eae29e6b35fb9e9e0..6e1820713c3dbdfad6de7cadbed024d91da2c3cb 100644 --- a/tests/pytest/tag_lite/tinyint.py +++ b/tests/pytest/tag_lite/tinyint.py @@ -7,9 +7,9 @@ from util.sql import * class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): tdSql.prepare() diff --git a/tests/pytest/test.py b/tests/pytest/test.py index 86417ea93161c476bcbcb597200a2d8b698dc2da..5b35563e1bcb041fdcb2389c4609d91b3fa71e1a 100644 --- a/tests/pytest/test.py +++ b/tests/pytest/test.py @@ -31,9 +31,10 @@ if __name__ == "__main__": masterIp = "" testCluster = False valgrind = 0 + logSql = True stop = 0 - opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:scgh', [ - 'file=', 'path=', 'master', 'stop', 'cluster', 'valgrind', 'help']) + opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scgh', [ + 'file=', 'path=', 'master', 'logSql', 'stop', 'cluster', 'valgrind', 'help']) for key, value in opts: if key in ['-h', '--help']: tdLog.printNoPrefix( @@ -41,8 +42,10 @@ if __name__ == "__main__": tdLog.printNoPrefix('-f Name of test case file written by Python') tdLog.printNoPrefix('-p Deploy Path for Simulator') tdLog.printNoPrefix('-m Master Ip for Simulator') - tdLog.printNoPrefix('-c Test Cluster Flag') + tdLog.printNoPrefix('-l logSql Flag') tdLog.printNoPrefix('-s stop All dnodes') + tdLog.printNoPrefix('-c Test Cluster Flag') + tdLog.printNoPrefix('-g valgrind Test Flag') sys.exit(0) if key in ['-f', '--file']: @@ -54,6 +57,15 @@ if __name__ == "__main__": if key in ['-m', '--master']: masterIp = value + if key in ['-l', '--logSql']: + if (value.upper() == "TRUE"): + logSql = True + elif (value.upper() == "FALSE"): + logSql = False + else: + tdLog.printNoPrefix("logSql value %s is invalid" % logSql) + sys.exit(0) + if key in ['-c', '--cluster']: testCluster = True @@ -100,6 +112,8 @@ if __name__ == "__main__": tdLog.info("Procedures for tdengine deployed in %s" % (host)) + tdCases.logSql(logSql) + if testCluster: tdLog.info("Procedures for testing cluster") if fileName == "all": diff --git a/tests/pytest/user/pass_len.py b/tests/pytest/user/pass_len.py index 40bd1ca5fc48524080434eb109060fac4e203f5b..346b8424fe325a214b798c58b06c3e3cfb0e4d39 100644 --- a/tests/pytest/user/pass_len.py +++ b/tests/pytest/user/pass_len.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): print("==============step1") diff --git a/tests/pytest/user/user_create.py b/tests/pytest/user/user_create.py index f8ac5c67997373e10deb6e2c3f96473fc59a0693..a00f670a36778e5ea2191ac4e7b43930efe64b01 100644 --- a/tests/pytest/user/user_create.py +++ b/tests/pytest/user/user_create.py @@ -19,9 +19,9 @@ from util.sql import tdSql class TDTestCase: - def init(self, conn): + def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor()) + tdSql.init(conn.cursor(), logSql) def run(self): print("==============step1") diff --git a/tests/pytest/util/cases.py b/tests/pytest/util/cases.py index f65b0dfde3715221b26227f9224656347dc52709..2fc1ac8515e47f9354483ebb590897eea96dcc57 100644 --- a/tests/pytest/util/cases.py +++ b/tests/pytest/util/cases.py @@ -24,6 +24,7 @@ class TDCase: def __init__(self, name, case): self.name = name self.case = case + self._logSql = True class TDCases: @@ -36,6 +37,9 @@ class TDCases: moduleName = fileName.replace(".py", "").replace("/", ".") return importlib.import_module(moduleName, package='..') + def logSql(self, logSql): + self._logSql = logSql + def addWindows(self, name, case): self.windowsCases.append(TDCase(name, case)) @@ -66,7 +70,7 @@ class TDCases: for tmp in self.linuxCases: if tmp.name.find(fileName) != -1: case = testModule.TDTestCase() - case.init(conn) + case.init(conn, self._logSql) try: case.run() except Exception as e: diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py index eb53129722c408d120712a6cb3c90a4a79448603..245e4b0945181762d0dc7994d3bcf0d2d46b1fd4 100644 --- a/tests/pytest/util/sql.py +++ b/tests/pytest/util/sql.py @@ -25,9 +25,15 @@ class TDSql: self.queryCols = 0 self.affectedRows = 0 - def init(self, cursor): + def init(self, cursor, log=True): self.cursor = cursor + if (log): + frame = inspect.stack()[1] + callerModule = inspect.getmodule(frame[0]) + callerFilename = callerModule.__file__ + self.cursor.log(callerFilename + ".sql") + def close(self): self.cursor.close() @@ -101,7 +107,6 @@ class TDSql: return self.cursor.istype(col, dataType) - def checkData(self, row, col, data): frame = inspect.stack()[1] callerModule = inspect.getmodule(frame[0])