We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 104ec03 commit cd70b44Copy full SHA for cd70b44
src/oracledb/impl/thin/buffer.pyx
@@ -368,13 +368,15 @@ cdef class Buffer:
368
369
cdef object read_bool(self):
370
"""
371
- Read a boolean from the buffer and return True, False or None.
+ Read a boolean from the buffer and return True, False or None. A zero
372
+ length or a negative length (indicated by the value 0x81 in the first
373
+ byte) implies a null value.
374
375
cdef:
376
const char_type *ptr
377
ssize_t num_bytes
378
self.read_raw_bytes_and_length(&ptr, &num_bytes)
- if ptr != NULL:
379
+ if ptr != NULL and ptr[0] != 0x81:
380
return ptr[num_bytes - 1] == 1
381
382
cdef object read_bytes(self):
0 commit comments