• Alexander Barkov's avatar
    MDEV-23210 Assertion `(length % 4) == 0' failed in my_lengthsp_utf32 on ALTER... · 03c3dc63
    Alexander Barkov authored
    MDEV-23210 Assertion `(length % 4) == 0' failed in my_lengthsp_utf32 on ALTER TABLE, SELECT and INSERT
    
    Problem:
    Parse-time conversion from binary to tricky character sets like utf32
    produced ill-formed strings. So, later a chash happened in debug builds,
    or a wrong SHOW CREATE TABLE was returned in release builds.
    
    Fix:
    
    1. Backporting a few methods from 10.3:
      - THD::check_string_for_wellformedness()
      - THD::convert_string() overloads
      - THD::make_text_string_connection()
    
    2. Adding a new method THD::reinterpret_string_from_binary(),
       which makes sure to either returns a well-formed string
       (optionally prepending with zero bytes), or returns an error.
    03c3dc63
sql_class.cc 226 KB