提交 c3bcd6fe 编写于 作者: L liu0x54

[TD251]fix python connector to process NCHAR

上级 34b6f894
......@@ -96,7 +96,7 @@ def _crow_nchar_to_python(data, num_of_rows, nbytes=None, micro=False):
for i in range(abs(num_of_rows)):
try:
if num_of_rows >= 0:
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_char * (nbytes//4))))[0].value )
else:
res.append( (ctypes.cast(data+nbytes*i, ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
except ValueError:
......
......@@ -96,7 +96,7 @@ def _crow_nchar_to_python(data, num_of_rows, nbytes=None, micro=False):
for i in range(abs(num_of_rows)):
try:
if num_of_rows >= 0:
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_char * (nbytes//4))))[0].value )
else:
res.append( (ctypes.cast(data+nbytes*i, ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
except ValueError:
......
......@@ -96,7 +96,7 @@ def _crow_nchar_to_python(data, num_of_rows, nbytes=None, micro=False):
for i in range(abs(num_of_rows)):
try:
if num_of_rows >= 0:
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_char * (nbytes//4))))[0].value )
else:
res.append( (ctypes.cast(data+nbytes*i, ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
except ValueError:
......
......@@ -96,7 +96,7 @@ def _crow_nchar_to_python(data, num_of_rows, nbytes=None, micro=False):
for i in range(abs(num_of_rows)):
try:
if num_of_rows >= 0:
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
res.append( (ctypes.cast(data+nbytes*(abs(num_of_rows - i -1)), ctypes.POINTER(ctypes.c_char * (nbytes//4))))[0].value )
else:
res.append( (ctypes.cast(data+nbytes*i, ctypes.POINTER(ctypes.c_wchar * (nbytes//4))))[0].value )
except ValueError:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册