[TD-519] fix execute sql return
This commit is contained in:
parent
6084f5a78f
commit
f9a9a7bc54
|
@ -149,6 +149,7 @@ class CTaosInterface(object):
|
||||||
libtaos.taos_consume.restype = ctypes.c_void_p
|
libtaos.taos_consume.restype = ctypes.c_void_p
|
||||||
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
||||||
libtaos.taos_free_result.restype = None
|
libtaos.taos_free_result.restype = None
|
||||||
|
libtaos.taos_errno.restype = ctypes.c_int
|
||||||
|
|
||||||
def __init__(self, config=None):
|
def __init__(self, config=None):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -126,7 +126,8 @@ class TDengineCursor(object):
|
||||||
with open(self._logfile, "a") as logfile:
|
with open(self._logfile, "a") as logfile:
|
||||||
logfile.write("%s;\n" % operation)
|
logfile.write("%s;\n" % operation)
|
||||||
|
|
||||||
if self._result is not None:
|
errno = CTaosInterface.libtaos.taos_errno(self._result)
|
||||||
|
if errno == 0:
|
||||||
if CTaosInterface.fieldsCount(self._result) == 0:
|
if CTaosInterface.fieldsCount(self._result) == 0:
|
||||||
self._affected_rows += CTaosInterface.affectedRows(
|
self._affected_rows += CTaosInterface.affectedRows(
|
||||||
self._result )
|
self._result )
|
||||||
|
|
|
@ -149,6 +149,7 @@ class CTaosInterface(object):
|
||||||
libtaos.taos_consume.restype = ctypes.c_void_p
|
libtaos.taos_consume.restype = ctypes.c_void_p
|
||||||
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
||||||
libtaos.taos_free_result.restype = None
|
libtaos.taos_free_result.restype = None
|
||||||
|
libtaos.taos_errno.restype = ctypes.c_int
|
||||||
|
|
||||||
def __init__(self, config=None):
|
def __init__(self, config=None):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -124,12 +124,12 @@ class TDengineCursor(object):
|
||||||
# print(" >> Exec Query ({}): {}".format(localSeqNum, str(stmt)))
|
# print(" >> Exec Query ({}): {}".format(localSeqNum, str(stmt)))
|
||||||
self._result = CTaosInterface.query(self._connection._conn, stmt)
|
self._result = CTaosInterface.query(self._connection._conn, stmt)
|
||||||
# print(" << Query ({}) Exec Done".format(localSeqNum))
|
# print(" << Query ({}) Exec Done".format(localSeqNum))
|
||||||
|
|
||||||
if (self._logfile):
|
if (self._logfile):
|
||||||
with open(self._logfile, "a") as logfile:
|
with open(self._logfile, "a") as logfile:
|
||||||
logfile.write("%s;\n" % operation)
|
logfile.write("%s;\n" % operation)
|
||||||
|
|
||||||
if self._result is not None:
|
errno = CTaosInterface.libtaos.taos_errno(self._result)
|
||||||
|
if errno == 0:
|
||||||
if CTaosInterface.fieldsCount(self._result) == 0:
|
if CTaosInterface.fieldsCount(self._result) == 0:
|
||||||
self._affected_rows += CTaosInterface.affectedRows(
|
self._affected_rows += CTaosInterface.affectedRows(
|
||||||
self._result )
|
self._result )
|
||||||
|
|
|
@ -149,6 +149,7 @@ class CTaosInterface(object):
|
||||||
libtaos.taos_consume.restype = ctypes.c_void_p
|
libtaos.taos_consume.restype = ctypes.c_void_p
|
||||||
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
||||||
libtaos.taos_free_result.restype = None
|
libtaos.taos_free_result.restype = None
|
||||||
|
libtaos.taos_errno.restype = ctypes.c_int
|
||||||
|
|
||||||
def __init__(self, config=None):
|
def __init__(self, config=None):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -110,7 +110,8 @@ class TDengineCursor(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self._result = CTaosInterface.query(self._connection._conn, stmt)
|
self._result = CTaosInterface.query(self._connection._conn, stmt)
|
||||||
if self._result is not None:
|
errno = CTaosInterface.libtaos.taos_errno(self._result)
|
||||||
|
if errno == 0:
|
||||||
if CTaosInterface.fieldsCount(self._result) == 0:
|
if CTaosInterface.fieldsCount(self._result) == 0:
|
||||||
self._affected_rows += CTaosInterface.affectedRows(self._result)
|
self._affected_rows += CTaosInterface.affectedRows(self._result)
|
||||||
return CTaosInterface.affectedRows(self._result )
|
return CTaosInterface.affectedRows(self._result )
|
||||||
|
|
|
@ -149,6 +149,7 @@ class CTaosInterface(object):
|
||||||
libtaos.taos_consume.restype = ctypes.c_void_p
|
libtaos.taos_consume.restype = ctypes.c_void_p
|
||||||
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
||||||
libtaos.taos_free_result.restype = None
|
libtaos.taos_free_result.restype = None
|
||||||
|
libtaos.taos_errno.restype = ctypes.c_int
|
||||||
|
|
||||||
def __init__(self, config=None):
|
def __init__(self, config=None):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -110,7 +110,8 @@ class TDengineCursor(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self._result = CTaosInterface.query(self._connection._conn, stmt)
|
self._result = CTaosInterface.query(self._connection._conn, stmt)
|
||||||
if self._result is not None:
|
errno = CTaosInterface.libtaos.taos_errno(self._result)
|
||||||
|
if errno == 0:
|
||||||
if CTaosInterface.fieldsCount(self._result) == 0:
|
if CTaosInterface.fieldsCount(self._result) == 0:
|
||||||
self._affected_rows += CTaosInterface.affectedRows(self._result )
|
self._affected_rows += CTaosInterface.affectedRows(self._result )
|
||||||
return CTaosInterface.affectedRows(self._result )
|
return CTaosInterface.affectedRows(self._result )
|
||||||
|
|
Loading…
Reference in New Issue