• Davi Arnaut's avatar
    Bug#45100: Incomplete DROP USER in case of SQL_MODE = 'PAD_CHAR_TO_FULL_LENGTH' · 66398a87
    Davi Arnaut authored
    The SQL-mode PAD_CHAR_TO_FULL_LENGTH could prevent a DROP USER
    statement from privileges associated with the user being dropped.
    What ocurred was that reading from the User and Host fields of
    the tables tables_priv or columns_priv would yield values padded
    with spaces, causing a failure to match a specified user or host 
    ('user' != 'user     ');
    
    The solution is to disregard the PAD_CHAR_TO_FULL_LENGTH mode
    when iterating over and matching values in the privileges tables
    for a DROP USER statement.
    
    mysql-test/r/sql_mode.result:
      Add test case result for Bug#45100.
    mysql-test/t/sql_mode.test:
      Add test case for Bug#45100.
    sql/sql_acl.cc:
      Clear MODE_PAD_CHAR_TO_FULL_LENGTH before dropping privileges.
    66398a87
sql_mode.result 12.6 KB