mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Fix for bug#2505: MySQL reports "out of memory"
when DROP USER if --skip-grant-tables
This commit is contained in:
parent
557bb526d7
commit
0a3ca2f640
25 changed files with 43 additions and 13 deletions
|
@ -305,4 +305,5 @@
|
|||
#define ER_WARN_DEPRECATED_SYNTAX 1286
|
||||
#define ER_NON_UPDATABLE_TABLE 1287
|
||||
#define ER_FEATURE_DISABLED 1288
|
||||
#define ER_ERROR_MESSAGES 289
|
||||
#define ER_SKIP_GRANT_TABLES 1289
|
||||
#define ER_ERROR_MESSAGES 290
|
||||
|
|
|
@ -301,3 +301,4 @@ character-set=latin2
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -295,3 +295,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -303,3 +303,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -291,4 +291,5 @@ character-set=latin1
|
|||
"Unknown table engine '%s'",
|
||||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working",
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -297,3 +297,4 @@ character-set=latin7
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -292,3 +292,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -304,3 +304,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -292,3 +292,4 @@ character-set=greek
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -294,3 +294,4 @@ character-set=latin2
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -292,3 +292,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -294,3 +294,4 @@ character-set=ujis
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -292,3 +292,4 @@ character-set=euckr
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -294,3 +294,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -294,3 +294,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -296,3 +296,4 @@ character-set=latin2
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -293,3 +293,4 @@ character-set=latin1
|
|||
"'%s' é desatualizado. Use '%s' em seu lugar.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -296,3 +296,4 @@ character-set=latin2
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -294,3 +294,4 @@ character-set=koi8r
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"ôÁÂÌÉÃÁ %-.100s × %s ÎÅ ÍÏÖÅÔ ÉÚÍÅÎÑÔÓÑ.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -287,3 +287,4 @@ character-set=cp1250
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -300,3 +300,4 @@ character-set=latin2
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -294,3 +294,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -292,3 +292,4 @@ character-set=latin1
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"The target table %-.100s of the %s is not updatable.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -297,3 +297,4 @@ character-set=koi8u
|
|||
"'%s' is deprecated. Use '%s' instead.",
|
||||
"ôÁÂÌÉÃÑ %-.100s Õ %s ÎÅ ÍÏÖÅ ÏÎÏ×ÌÀ×ÁÔÉÓØ.",
|
||||
"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
|
||||
"MySQL is started in --skip-grant-tables mode. You can't use this command"
|
||||
|
|
|
@ -1114,8 +1114,8 @@ bool check_change_password(THD *thd, const char *host, const char *user)
|
|||
{
|
||||
if (!initialized)
|
||||
{
|
||||
send_error(thd, ER_PASSWORD_NOT_ALLOWED); /* purecov: inspected */
|
||||
return(1); /* purecov: inspected */
|
||||
send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
|
||||
return(1); /* purecov: inspected */
|
||||
}
|
||||
if (!thd->slave_thread &&
|
||||
(strcmp(thd->user,user) ||
|
||||
|
@ -1590,8 +1590,14 @@ static int replace_db_table(TABLE *table, const char *db,
|
|||
char what= (revoke_grant) ? 'N' : 'Y';
|
||||
DBUG_ENTER("replace_db_table");
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
my_error(ER_SKIP_GRANT_TABLES, MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
/* Check if there is such a user in user table in memory? */
|
||||
if (!initialized || !find_acl_user(combo.host.str,combo.user.str))
|
||||
if (!find_acl_user(combo.host.str,combo.user.str))
|
||||
{
|
||||
my_error(ER_PASSWORD_NO_MATCH,MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
|
@ -2167,7 +2173,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
|||
|
||||
if (!initialized)
|
||||
{
|
||||
send_error(thd, ER_UNKNOWN_COM_ERROR); /* purecov: inspected */
|
||||
send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
}
|
||||
if (rights & ~TABLE_ACLS)
|
||||
|
@ -2377,8 +2383,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
|
|||
DBUG_ENTER("mysql_grant");
|
||||
if (!initialized)
|
||||
{
|
||||
my_error(ER_UNKNOWN_COM_ERROR, MYF(0)); /* purecov: tested */
|
||||
return -1; /* purecov: tested */
|
||||
my_error(ER_SKIP_GRANT_TABLES, MYF(0)); /* purecov: tested */
|
||||
DBUG_RETURN(-1); /* purecov: tested */
|
||||
}
|
||||
|
||||
if (lower_case_table_names && db)
|
||||
|
@ -2982,8 +2988,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
|
|||
LINT_INIT(acl_user);
|
||||
if (!initialized)
|
||||
{
|
||||
send_error(thd, ER_UNKNOWN_COM_ERROR);
|
||||
DBUG_RETURN(-1);
|
||||
send_error(thd, ER_SKIP_GRANT_TABLES);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (lex_user->host.length > HOSTNAME_LENGTH ||
|
||||
lex_user->user.length > USERNAME_LENGTH)
|
||||
|
@ -3335,7 +3341,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
|
|||
|
||||
if (!initialized)
|
||||
{
|
||||
send_error(thd, ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES));
|
||||
send_error(thd, ER_SKIP_GRANT_TABLES);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
|
@ -3416,7 +3422,7 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list)
|
|||
DBUG_ENTER("mysql_drop_user");
|
||||
|
||||
if ((result= open_grant_tables(thd, tables)))
|
||||
DBUG_RETURN(result == 1 ? 0 : -1);
|
||||
DBUG_RETURN(result == 1 ? 0 : 1);
|
||||
|
||||
rw_wrlock(&LOCK_grant);
|
||||
VOID(pthread_mutex_lock(&acl_cache->lock));
|
||||
|
@ -3529,7 +3535,7 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list)
|
|||
DBUG_ENTER("mysql_revoke_all");
|
||||
|
||||
if ((result= open_grant_tables(thd, tables)))
|
||||
DBUG_RETURN(result == 1 ? 0 : -1);
|
||||
DBUG_RETURN(result == 1 ? 0 : 1);
|
||||
|
||||
rw_wrlock(&LOCK_grant);
|
||||
VOID(pthread_mutex_lock(&acl_cache->lock));
|
||||
|
|
Loading…
Reference in a new issue