diff --git a/src/connector/python/linux/python2/taos/cursor.py b/src/connector/python/linux/python2/taos/cursor.py index f7c840442e2e5acbed76c354e9800a27d6b3eeca..8c268d8afba2b971709fba6f157abfebdc8dfd1a 100644 --- a/src/connector/python/linux/python2/taos/cursor.py +++ b/src/connector/python/linux/python2/taos/cursor.py @@ -137,7 +137,7 @@ class TDengineCursor(object): else: raise ProgrammingError( CTaosInterface.errStr( - self._result )) + self._result ), errno) def executemany(self, operation, seq_of_parameters): """Prepare a database operation (query or command) and then execute it against all parameter sequences or mappings found in the sequence seq_of_parameters. diff --git a/src/connector/python/linux/python3/taos/cursor.py b/src/connector/python/linux/python3/taos/cursor.py index 5db5365eb3566d815f6c9984f5f72132b1cae7e0..06d6a1946213cdf4b348d5430433749f05a120d3 100644 --- a/src/connector/python/linux/python3/taos/cursor.py +++ b/src/connector/python/linux/python3/taos/cursor.py @@ -139,7 +139,7 @@ class TDengineCursor(object): else: raise ProgrammingError( CTaosInterface.errStr( - self._result )) + self._result), errno) def executemany(self, operation, seq_of_parameters): """Prepare a database operation (query or command) and then execute it against all parameter sequences or mappings found in the sequence seq_of_parameters. diff --git a/src/connector/python/windows/python2/taos/cursor.py b/src/connector/python/windows/python2/taos/cursor.py index 1da726638a8b42edf0fb18d3b806191cb21b6745..7eee3bfc8f8559454f53aa967f5ad0294a1cb2bf 100644 --- a/src/connector/python/windows/python2/taos/cursor.py +++ b/src/connector/python/windows/python2/taos/cursor.py @@ -117,7 +117,7 @@ class TDengineCursor(object): self._fields = CTaosInterface.useResult(self._result) return self._handle_result() else: - raise ProgrammingError(CTaosInterface.errStr(self._result)) + raise ProgrammingError(CTaosInterface.errStr(self._result), errno) def executemany(self, operation, seq_of_parameters): """Prepare a database operation (query or command) and then execute it against all parameter sequences or mappings found in the sequence seq_of_parameters. diff --git a/src/connector/python/windows/python3/taos/cursor.py b/src/connector/python/windows/python3/taos/cursor.py index 2dcd0aaccb216647e328c89281e00f0bad75ae33..5f5aa4e1d7d9b454132f533a9e84cca2859db735 100644 --- a/src/connector/python/windows/python3/taos/cursor.py +++ b/src/connector/python/windows/python3/taos/cursor.py @@ -117,7 +117,7 @@ class TDengineCursor(object): self._fields = CTaosInterface.useResult(self._result ) return self._handle_result() else: - raise ProgrammingError(CTaosInterface.errStr(self._result )) + raise ProgrammingError(CTaosInterface.errStr(self._result ), errno) def executemany(self, operation, seq_of_parameters): """Prepare a database operation (query or command) and then execute it against all parameter sequences or mappings found in the sequence seq_of_parameters. diff --git a/tests/pytest/crash_gen.py b/tests/pytest/crash_gen.py index dfd2034f7e2ac542848c71083864cb729f38a8d3..c88683aa097c82380503370d342101351b27d38b 100755 --- a/tests/pytest/crash_gen.py +++ b/tests/pytest/crash_gen.py @@ -730,13 +730,15 @@ class DbState(): # when we re-run the test in 3 minutes (180 seconds), basically we should expand time duration # by a factor of 500. # TODO: what if it goes beyond 10 years into the future + # TODO: fix the error as result of above: "tsdb timestamp is out of range" def setupLastTick(self): - t1 = datetime.datetime(2020, 5, 30) + t1 = datetime.datetime(2020, 6, 1) t2 = datetime.datetime.now() - elSec = t2.timestamp() - t1.timestamp() + elSec = int(t2.timestamp() - t1.timestamp()) # maybe a very large number, takes 69 years to exceed Python int range + elSec2 = ( elSec % (8 * 12 * 30 * 24 * 60 * 60 / 500 ) ) * 500 # a number representing seconds within 10 years # print("elSec = {}".format(elSec)) t3 = datetime.datetime(2012, 1, 1) # default "keep" is 10 years - t4 = datetime.datetime.fromtimestamp( t3.timestamp() + elSec * 500) # see explanation above + t4 = datetime.datetime.fromtimestamp( t3.timestamp() + elSec2) # see explanation above logger.info("Setting up TICKS to start from: {}".format(t4)) return t4 @@ -963,7 +965,7 @@ class Task(): try: self._executeInternal(te, wt) # TODO: no return value? except taos.error.ProgrammingError as err: - self.logDebug("[=] Taos library exception: errno={}, msg: {}".format(err.errno, err)) + self.logDebug("[=] Taos library exception: errno={:X}, msg: {}".format(err.errno, err)) self._err = err except: self.logDebug("[=] Unexpected exception")