From 44d855e7a8c22b56c943e549d97407e8449ced84 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 07:50:26 -0500 Subject: 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 --- sql/sql_acl.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sql/sql_acl.cc') 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 &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 &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 &list) ~0, 0, 1)) { result= -1; + ++counter; continue; } if (grant_table->cols) @@ -3670,9 +3677,15 @@ int mysql_revoke_all(THD *thd, List &list) grant_table->db, grant_table->tname, ~0, 1)) + { result= -1; + ++counter; + continue; + } } } + else + ++counter; } } -- cgit v1.2.1