• Alexander Barkov's avatar
    MDEV-22391 Assertion `0' failed in Item_type_holder::val_str on utf16 charset table query · d4f97e20
    Alexander Barkov authored
    Problem:
    When handling a query like this:
      VALUES ('') UNION SELECT _utf16 0x0020 COLLATE utf16_bin;
    Type_handler_string_result::Item_hybrid_func_fix_attributes()
    tried to apply character set conversion Item_type_holder,
    which causes a crash on DBUG_ASSERT(0) inside Item_type_holder::val_str().
    
    Fix:
    Overriding Item_type_holder's methods to avoid this, as follows:
    
      bool const_item() const { return false; }
      bool is_expensive() { return true; }
    d4f97e20
item.h 215 KB