Skip to content
  • Arun Kuruvila's avatar
    d9b1ac0f
    Bug #20857652 : SERVER CRASHES WITH CREATE/DROP USER · d9b1ac0f
    Arun Kuruvila authored
                    STATEMENT WITH A PARTICULAR SEQUENCE
    
    Description :- Server crashes with CREATE/DROP USER
    statements after a failed FLUSH PRIVILEGES statement.
    
    Analysis :- When FLUSH PRIVILEGES fails because of the
    failure of "open_and_lock_tables()" in "acl_reload()", the
    ACL structures are freed. After this server crashes with
    CREATE/DROP USER statements when it is trying to access the
    freed ACL structures.
    
    Fix :- ACL structures are retained even if FLUSH PRIVILEGES
    fails in reloading ACL privileges. Similar behaviour is done
    while reloading column, function and procedure privileges.
    In the case of reloading function and procedure privileges
    we come across with the following scenarios:-
    1) mysql.procs_priv table is not present and proc_priv_hash
       structure has been already initialized=>
       mysql.procs_priv table has been dropped/renamed
       Soln:-  An error, "ERROR 1146 (42S02): Table
               'mysql.procs_priv' doesn't exist", is thrown.
    2) mysql.procs_priv table is not present and proc_priv_hash
       structure is not yet initialized =>
       a) We are using a pre 4.1 system tables.
          or
       b) We dropped/renamed mysql.proc_priv table and shutdown
          the server and restarted the server again
       Soln:- A warning, "[Warning] Table 'mysql.procs_priv'
              does not exist. Please run mysql_upgrade." is
              printed in the server log and a warning is
              thrown to the client side as well.
              Continue with reloading column privileges.
    3) mysql.procs_priv table is present =>
       Normal scenario. Column, function and procedure
       privileges are reloaded as normal.
    d9b1ac0f
    Bug #20857652 : SERVER CRASHES WITH CREATE/DROP USER
    Arun Kuruvila authored
                    STATEMENT WITH A PARTICULAR SEQUENCE
    
    Description :- Server crashes with CREATE/DROP USER
    statements after a failed FLUSH PRIVILEGES statement.
    
    Analysis :- When FLUSH PRIVILEGES fails because of the
    failure of "open_and_lock_tables()" in "acl_reload()", the
    ACL structures are freed. After this server crashes with
    CREATE/DROP USER statements when it is trying to access the
    freed ACL structures.
    
    Fix :- ACL structures are retained even if FLUSH PRIVILEGES
    fails in reloading ACL privileges. Similar behaviour is done
    while reloading column, function and procedure privileges.
    In the case of reloading function and procedure privileges
    we come across with the following scenarios:-
    1) mysql.procs_priv table is not present and proc_priv_hash
       structure has been already initialized=>
       mysql.procs_priv table has been dropped/renamed
       Soln:-  An error, "ERROR 1146 (42S02): Table
               'mysql.procs_priv' doesn't exist", is thrown.
    2) mysql.procs_priv table is not present and proc_priv_hash
       structure is not yet initialized =>
       a) We are using a pre 4.1 system tables.
          or
       b) We dropped/renamed mysql.proc_priv table and shutdown
          the server and restarted the server again
       Soln:- A warning, "[Warning] Table 'mysql.procs_priv'
              does not exist. Please run mysql_upgrade." is
              printed in the server log and a warning is
              thrown to the client side as well.
              Continue with reloading column privileges.
    3) mysql.procs_priv table is present =>
       Normal scenario. Column, function and procedure
       privileges are reloaded as normal.
Loading