FirebirdSQL/python3-driver

Error in _check_integer_range

lelikdub opened this issue · 0 comments

When i execute query whith params equal null, core.py throw this error in check of types:

File "~\firebird\driver\core.py", line 204, in _check_integer_range
if (value < vmin) or (value > vmax):
TypeError: '<' not supported between instances of 'NoneType' and 'int'

in _pack_input we have handle NULL but then we check all types anyway

one of solution in core.py after # handle NULL value (

# handle NULL value
) insert:

                # handle NULL value
                in_buffer[in_meta.get_null_offset(i)] = 1 if value is None else 0
                if value is not None:
                    # store parameter value
                    if _is_str_param(value, datatype):
                        # Implicit conversion to string
                        if not isinstance(value, (str, bytes, bytearray)):
                 ...all other code in for