Merge branch 'develop' of https://github.com/taosdata/TDengine into develop
This commit is contained in:
commit
870f4a4e33
|
@ -146,6 +146,7 @@ class CTaosInterface(object):
|
|||
libtaos.taos_errstr.restype = ctypes.c_char_p
|
||||
libtaos.taos_subscribe.restype = ctypes.c_void_p
|
||||
libtaos.taos_consume.restype = ctypes.c_void_p
|
||||
libtaos.taos_fetch_lengths.restype = ctypes.c_void_p
|
||||
|
||||
def __init__(self, config=None):
|
||||
'''
|
||||
|
@ -314,6 +315,8 @@ class CTaosInterface(object):
|
|||
|
||||
isMicro = (CTaosInterface.libtaos.taos_result_precision(result) == FieldType.C_TIMESTAMP_MICRO)
|
||||
blocks = [None] * len(fields)
|
||||
fieldL = CTaosInterface.libtaos.taos_fetch_lengths(result)
|
||||
fieldLen = [ele for ele in ctypes.cast(fieldL, ctypes.POINTER(ctypes.c_int))[:len(fields)]]
|
||||
for i in range(len(fields)):
|
||||
data = ctypes.cast(pblock, ctypes.POINTER(ctypes.c_void_p))[i]
|
||||
if data == None:
|
||||
|
@ -323,7 +326,7 @@ class CTaosInterface(object):
|
|||
if fields[i]['type'] not in _CONVERT_FUNC:
|
||||
raise DatabaseError("Invalid data type returned from database")
|
||||
|
||||
blocks[i] = _CONVERT_FUNC[fields[i]['type']](data, num_of_rows, fields[i]['bytes'], isMicro)
|
||||
blocks[i] = _CONVERT_FUNC[fields[i]['type']](data, num_of_rows, fieldLen[i], isMicro)
|
||||
|
||||
return blocks, abs(num_of_rows)
|
||||
|
||||
|
|
Loading…
Reference in New Issue