summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2004-01-26 20:31:38 +0400
committerunknown <gluh@gluh.mysql.r18.ru>2004-01-26 20:31:38 +0400
commit0a3ca2f6408429f1943a13b692461b7dd53288ff (patch)
tree68a04b7709f25adf8679c621d8cd3d5ffa9703e3 /sql
parent557bb526d7ca677839400d58e19d6acf1e326168 (diff)
downloadmariadb-git-0a3ca2f6408429f1943a13b692461b7dd53288ff.tar.gz
Fix for bug#2505: MySQL reports "out of memory"
when DROP USER if --skip-grant-tables
Diffstat (limited to 'sql')
-rw-r--r--sql/share/czech/errmsg.txt1
-rw-r--r--sql/share/danish/errmsg.txt1
-rw-r--r--sql/share/dutch/errmsg.txt1
-rw-r--r--sql/share/english/errmsg.txt3
-rw-r--r--sql/share/estonian/errmsg.txt1
-rw-r--r--sql/share/french/errmsg.txt1
-rw-r--r--sql/share/german/errmsg.txt1
-rw-r--r--sql/share/greek/errmsg.txt1
-rw-r--r--sql/share/hungarian/errmsg.txt1
-rw-r--r--sql/share/italian/errmsg.txt1
-rw-r--r--sql/share/japanese/errmsg.txt1
-rw-r--r--sql/share/korean/errmsg.txt1
-rw-r--r--sql/share/norwegian-ny/errmsg.txt1
-rw-r--r--sql/share/norwegian/errmsg.txt1
-rw-r--r--sql/share/polish/errmsg.txt1
-rw-r--r--sql/share/portuguese/errmsg.txt1
-rw-r--r--sql/share/romanian/errmsg.txt1
-rw-r--r--sql/share/russian/errmsg.txt1
-rw-r--r--sql/share/serbian/errmsg.txt1
-rw-r--r--sql/share/slovak/errmsg.txt1
-rw-r--r--sql/share/spanish/errmsg.txt1
-rw-r--r--sql/share/swedish/errmsg.txt1
-rw-r--r--sql/share/ukrainian/errmsg.txt1
-rw-r--r--sql/sql_acl.cc28
24 files changed, 41 insertions, 12 deletions
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index 16c04fc7656..917b2259e24 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -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"
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index 99470e1a32c..591e007f5a6 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -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"
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index 0b4a8139e57..3a0d77187bf 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -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"
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 0f9d9fc1144..38ca4966dfe 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -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"
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index a54bc435fc1..f0882d5602b 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -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"
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index accf5913ce2..d3c7c3ebde1 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -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"
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index 79b8ad5fe64..48eff8831d5 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -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"
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index 09928aed242..1e3c436e3d0 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -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"
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index b7491154815..402933d7ef7 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -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"
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index 829428f2fd4..d9be6ebb32d 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -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"
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index 2acd11a399e..cc36dd60e85 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -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"
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index 0533f52fc12..0bbea735a09 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -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"
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index bb6b5b8cb11..2372e7a9690 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -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"
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index b8a678d9b64..f946e988fb0 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -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"
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index 04cf28915b5..c6bb914d38c 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -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"
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index 16620380603..537162fc1d0 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -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"
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index 6ccccd95417..8da92d48883 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -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"
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index c5d06722cd8..d5d91deb280 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -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"
diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt
index c47c7b66e5a..8fa7933b871 100644
--- a/sql/share/serbian/errmsg.txt
+++ b/sql/share/serbian/errmsg.txt
@@ -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"
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index 8820b36b746..90fbe450bb1 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -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"
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index a17d58c2d35..644a5c7a515 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -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"
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index f9f05c7e122..22a6cecd773 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -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"
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index 255083529c3..2d4ce67e2e5 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -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"
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 282a9afa038..77131a37869 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -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));