• Satya B's avatar
    Fix for Bug #41597 - After rename of user, there are additional grants when · 15ddeb08
    Satya B authored
                         grants are reapplied.
    
    
    After renaming a user and trying to re-apply grants results in additional
    grants.
    
    This is because we use username as part of the key for GRANT_TABLE structure.
    When the user is renamed, we only change the username stored and the hash key
    still contains the old user name and this results in the extra privileges
    
    Fixed by rebuilding the hash key and updating the column_priv_hash structure
    when the user is renamed
    
    mysql-test/r/grant3.result:
      Bug #41597 - After rename of user, there are additional grants when 
                   grants are reapplied.
      
      Testcase for BUG#41597
    mysql-test/t/grant3.test:
      Bug #41597 - After rename of user, there are additional grants when 
                   grants are reapplied.
      
      Testcase for BUG#41597
    sql/sql_acl.cc:
      Bug #41597 - After rename of user, there are additional grants when 
                   grants are reapplied.
      
      Fixed handle_grant_struct() to update the hash key when the user is renamed.
      Added to set_user_details() method to GRANT_NAME class
    15ddeb08
grant3.test 6.33 KB