![]()  | 
  
    MySQL 9.5.0
    
   Source Code Documentation 
   | 
 
Go to the source code of this file.
Classes | |
| class | Acl_table_intact | 
| Class to validate the flawlessness of ACL table before performing ACL operations.  More... | |
Typedefs | |
| typedef enum ACL_TABLES | ACL_TABLES | 
| Enum for ACL tables.  More... | |
Enumerations | |
| enum | ACL_TABLES {  TABLE_USER = 0 , TABLE_DB , TABLE_TABLES_PRIV , TABLE_COLUMNS_PRIV , TABLE_PROCS_PRIV , TABLE_PROXIES_PRIV , TABLE_ROLE_EDGES , TABLE_DEFAULT_ROLES , TABLE_DYNAMIC_PRIV , TABLE_PASSWORD_HISTORY , LAST_ENTRY }  | 
| Enum for ACL tables.  More... | |
Functions | |
| int | handle_grant_table (THD *, Table_ref *tables, ACL_TABLES table_no, bool drop, LEX_USER *user_from, LEX_USER *user_to) | 
| Handle a privilege table.  More... | |
| typedef enum ACL_TABLES ACL_TABLES | 
Enum for ACL tables.
Keep in sync with Acl_table_names
| enum ACL_TABLES | 
| int handle_grant_table | ( | THD * | , | 
| Table_ref * | tables, | ||
| ACL_TABLES | table_no, | ||
| bool | drop, | ||
| LEX_USER * | user_from, | ||
| LEX_USER * | user_to | ||
| ) | 
Handle a privilege table.
| tables | The array with the four open tables. | 
| table_no | The number of the table to handle (0..4). | 
| drop | If user_from is to be dropped. | 
| user_from | The the user to be searched/dropped/renamed. | 
| user_to | The new name for the user if to be renamed, NULL otherwise. | 
This function scans through following tables: mysql.user, mysql.db, mysql.tables_priv, mysql.columns_priv, mysql.procs_priv, mysql.proxies_priv. For all above tables, we do an index scan and then iterate over the found records do following: Delete from grant table if drop is true. Update in grant table if drop is false and user_to is not NULL. Search in grant table if drop is false and user_to is NULL.
| 0 | OK, but no record matched. | 
| < | 0 Error. | 
| > | 0 At least one record matched. |