• Alexander Barkov's avatar
    MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg... · a2a42f4e
    Alexander Barkov authored
    MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
    
    There were two independent problems which lead to the crash
    and to the non-relevant records returned in I_S queries:
    
    - The code in the I_S implementation was not secure
      about values with 0x00 bytes.
      It's fixed by using check_db_name() and check_table_name()
      inside make_table_name_list(), and by adding the test for
      0x00 inside check_table_name().
    
    - The code in Item_string::print() did not convert
      strings without introducers when restoring
      the CREATE VIEW statement from an Item tree.
      This made wrong literals inside the "query" line in the view FRM file
      in cases when the VIEW parse time
      character_set_client!=character_set_connection.
      That's fixed by adding a proper conversion.
    
      This change also fixed a similar problem in SHOW PROCEDURE CODE -
      the literals were displayed in wrong character set in SP instructions
      in cases when the SP parse time
      character_set_client!=character_set_connection.
    a2a42f4e
table.cc 262 KB