diff options
author | unknown <dellis@goetia.(none)> | 2004-10-01 07:50:26 -0500 |
---|---|---|
committer | unknown <dellis@goetia.(none)> | 2004-10-01 07:50:26 -0500 |
commit | 44d855e7a8c22b56c943e549d97407e8449ced84 (patch) | |
tree | 017a3df22ad833e2d65423c206e9c3386a147a97 /sql/sql_acl.cc | |
parent | 92e7d03eaa1d62f68bd9fc40d442287916540240 (diff) | |
download | mariadb-git-44d855e7a8c22b56c943e549d97407e8449ced84.tar.gz |
logging_ok:
Logging to logging@openlogging.org accepted
sql_acl.cc, grant.test, grant.result:
BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass.
mysql-test/r/grant.result:
BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass.
mysql-test/t/grant.test:
BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass.
sql/sql_acl.cc:
BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass.
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index fc68e26c21d..855e56af12b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3622,7 +3622,7 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list) } /* Remove db access privileges */ - for (counter= 0 ; counter < acl_dbs.elements ; counter++) + for (counter= 0 ; counter < acl_dbs.elements ; ) { const char *user,*host; @@ -3636,12 +3636,18 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list) !my_strcasecmp(system_charset_info, lex_user->host.str, host)) { if (replace_db_table(tables[1].table, acl_db->db, *lex_user, ~0, 1)) + { result= -1; + ++counter; + continue; + } } + else + ++counter; } /* Remove column access */ - for (counter= 0 ; counter < column_priv_hash.records ; counter++) + for (counter= 0 ; counter < column_priv_hash.records ; ) { const char *user,*host; GRANT_TABLE *grant_table= (GRANT_TABLE*) hash_element(&column_priv_hash, @@ -3660,6 +3666,7 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list) ~0, 0, 1)) { result= -1; + ++counter; continue; } if (grant_table->cols) @@ -3670,9 +3677,15 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list) grant_table->db, grant_table->tname, ~0, 1)) + { result= -1; + ++counter; + continue; + } } } + else + ++counter; } } |