• Alexander Barkov's avatar
    MDEV-27207 Assertion `!m_null_value' failed in int... · 68403eed
    Alexander Barkov authored
    MDEV-27207 Assertion `!m_null_value' failed in int FixedBinTypeBundle<FbtImpl>::cmp_item_fbt::compare or in cmp_item_inet6::compare
    
    Also fixing:  MDEV-31719 Wrong result of: WHERE inet6_column IN ('','::1')
    
    Problem:
    
    When converting an Item value from string to INET6 it's possible
    that the Item value itself is a not-NULL string value,
    while the following result of the string-to-INET6 conversion returns NULL.
    
    Methods cmp_item_xxx::set(), cmp_item_xxx::store_value_by_template(),
    in_inet6::set() did not take this scenario into account and
    tested source_item->null_value, which does not indicate if the conversion
    failed.
    
    Changing the return data type of the mentioned methods from "void" to "bool".
    
    "true" means that:
    - either the source Item was NULL
    - or the source Item was not NULL, but the data type coversion to
      the destination data type (INET6 in this issue) returned NULL.
    
    "false" means that the Item was not NULL and the data type conversion
    to the destination data type worked without error.
    
    This patches fixes the INET6 data type.
    After merging to 10.9, this patch should also fix same problems in UUID.
    68403eed
item_cmpfunc.cc 211 KB