Browse Source
MDEV-22758 Assertion `!item->null_value' failed in Type_handler_inet6::make_sort_key_part
MDEV-22758 Assertion `!item->null_value' failed in Type_handler_inet6::make_sort_key_part
When some expression of an INET6 data type involves conversion to INET6 from
other data types, e.g. in:
- CAST:
SELECT CAST(non_inet6_expr AS INET6)
- CASE and hybrid functions:
SELECT CASE WHEN expr THEN inet6_expr ELSE non_inet6_expr END
- UNION:
SELECT inet6_expr UNION SELECT non_inet6_expr
the result column must be fixed as NULL-able even if the non-inet6 expression itself
is not NULL-able, because at the execution time the conversion can fail.
Details:
- Forcing NULL-ability if conversion from some data type to INET6 is involved
(for non-constant or for expensive expressions).
- Non-expensive constant expressions are tested for NULL-ability at fix_fields() time,
so things like `CAST('::' AS INET6)` are still detected as NOT NULL.
- Adding "bool warn" parameter into a few methods, to avoid redundant warnings
at fix_fields() time when calculating NULL-ability of constant values.
pull/1583/head
4 changed files with 123 additions and 13 deletions
-
51plugin/type_inet/mysql-test/type_inet/type_inet6.result
-
30plugin/type_inet/mysql-test/type_inet/type_inet6.test
-
29plugin/type_inet/sql_type_inet.cc
-
26plugin/type_inet/sql_type_inet.h
Write
Preview
Loading…
Cancel
Save
Reference in new issue