File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Thin Mode Changes
1919Common Changes
2020++++++++++++++
2121
22+ #) Fixed regression which prevented a null value from being set on DbObject
23+ attributes or used as elements of collections
24+ (`issue 273 <https://github.com/oracle/python-oracledb/issues/273 >`__).
2225#) Corrected typing declarations.
2326
2427
Original file line number Diff line number Diff line change 11# ------------------------------------------------------------------------------
2- # Copyright (c) 2020, 2022 , Oracle and/or its affiliates.
2+ # Copyright (c) 2020, 2024 , Oracle and/or its affiliates.
33#
44# This software is dual-licensed to you under the Universal Permissive License
55# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -37,7 +37,7 @@ cdef class BaseDbObjectImpl:
3737 Checks to see if the maximum size has been violated.
3838 """
3939 violated[0 ] = False
40- if max_size > 0 :
40+ if max_size > 0 and value is not None :
4141 if isinstance (value, str ):
4242 actual_size[0 ] = len ((< str > value).encode())
4343 else :
Original file line number Diff line number Diff line change 11# -----------------------------------------------------------------------------
2- # Copyright (c) 2020, 2023 , Oracle and/or its affiliates.
2+ # Copyright (c) 2020, 2024 , Oracle and/or its affiliates.
33#
44# This software is dual-licensed to you under the Universal Permissive License
55# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -771,6 +771,12 @@ def test_2334_validate_string_element_value(self):
771771 "C" * 101 ,
772772 )
773773
774+ def test_2335_validate_string_attr_null (self ):
775+ "2335 - test validating a string attribute with null value"
776+ typ = self .conn .gettype ("UDT_OBJECT" )
777+ obj = typ .newobject ()
778+ obj .STRINGVALUE = None
779+
774780
775781if __name__ == "__main__" :
776782 test_env .run_test_cases ()
You can’t perform that action at this time.
0 commit comments