From 106bbe24408ac073e120d5f3b1866b5c9b18e17c Mon Sep 17 00:00:00 2001 From: asardesai2 Date: Wed, 15 Nov 2023 23:47:48 +0530 Subject: [PATCH] Review Changes Signed-off-by: asardesai2 --- comdb2/_ccdb2.pyx | 2 +- tests/test_dbapi2.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/comdb2/_ccdb2.pyx b/comdb2/_ccdb2.pyx index b548287..57e6bfb 100644 --- a/comdb2/_ccdb2.pyx +++ b/comdb2/_ccdb2.pyx @@ -183,7 +183,7 @@ cdef class _ParameterValue(object): elif all(isinstance(ele, bytes) for ele in obj): self.type = lib.CDB2_BLOB self.size = sizeof(blob_descriptor) - self.owner = None + self.owner = obj self.data = PyMem_Malloc(self.list_size * self.size) for l_index in range(self.list_size): (self.data)[l_index].size = len(obj[l_index]) diff --git a/tests/test_dbapi2.py b/tests/test_dbapi2.py index 437d074..25409c4 100644 --- a/tests/test_dbapi2.py +++ b/tests/test_dbapi2.py @@ -900,6 +900,11 @@ def test_parameter_binding_arrays(values): "Can't bind tuple value (1j,) for parameter 'values': " + "ValueError: Cannot bind a tuple of complex", ), + ( + ((1, 2, 3),), + "Can't bind tuple value ((1, 2, 3),) for parameter 'values': " + + "ValueError: Cannot bind a tuple of tuple", + ), ], ) def test_parameter_binding_invalid_arrays(values, exc_msg):