4281 Martin Skold 2011-04-01
bug#11938564 NDB DIST PRIV FAILS TO REPLICATE REVOKE UPDATE: Passing correct database to ha_binlog_log_query
modified:
mysql-test/suite/rpl_ndb/r/rpl_ndb_dist_priv.result
mysql-test/suite/rpl_ndb/t/rpl_ndb_dist_priv.test
sql/sql_acl.cc
4280 Magnus Blåudd 2011-03-30
ndb dist priv
- Force restart since other tests depend on the _exact_
order of rows in for example mysql.user
modified:
mysql-test/suite/ndb/t/ndb_dist_priv.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_dist_priv.test
=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_dist_priv.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dist_priv.result 2011-03-30 15:02:52 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dist_priv.result 2011-04-01 07:47:43 +0000
@@ -47,10 +47,10 @@ User Table_priv
newuser Update
user2 Select
FLUSH PRIVILEGES;
+REVOKE UPDATE ON t1 FROM 'newuser'@'localhost';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user2'@'localhost';
select User,Table_priv from mysql.tables_priv ORDER BY User;
User Table_priv
-newuser Update
DROP USER 'newuser'@'localhost';
== Showing binlog server1 ==
show binlog events from <binlog_start>;
@@ -76,24 +76,28 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; GRANT SELECT ON test.t1 TO 'user2'@'localhost'
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # use `mysql`; CREATE USER 'user3'@'localhost' IDENTIFIED by 'mypass'
-master-bin.000001 # Query # # use `mysql`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user2'@'localhost'
-master-bin.000001 # Query # # use `mysql`; DROP USER 'newuser'@'localhost'
+master-bin.000001 # Query # # CREATE USER 'user3'@'localhost' IDENTIFIED by 'mypass'
+master-bin.000001 # Query # # REVOKE UPDATE ON t1 FROM 'newuser'@'localhost'
+master-bin.000001 # Query # # REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user2'@'localhost'
+master-bin.000001 # Query # # DROP USER 'newuser'@'localhost'
== Showing binlog server2 ==
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `mysql`; CREATE USER 'user'@'localhost' IDENTIFIED by 'mypass'
-master-bin.000001 # Query # # use `mysql`; GRANT UPDATE ON t1 TO 'user'@'localhost'
-master-bin.000001 # Query # # use `mysql`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0'
-master-bin.000001 # Query # # use `mysql`; RENAME USER 'user'@'localhost' TO 'newuser'@'localhost'
-master-bin.000001 # Query # # use `mysql`; GRANT SELECT ON test.* TO 'newuser'@'localhost' IDENTIFIED by 'mypass2'
-master-bin.000001 # Query # # use `mysql`; CREATE USER 'user2'@'localhost' IDENTIFIED by 'mypass'
-master-bin.000001 # Query # # use `mysql`; GRANT SELECT ON test.t1 TO 'user2'@'localhost'
+master-bin.000001 # Query # # CREATE USER 'user'@'localhost' IDENTIFIED by 'mypass'
+master-bin.000001 # Query # # GRANT UPDATE ON t1 TO 'user'@'localhost'
+master-bin.000001 # Query # # SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0'
+master-bin.000001 # Query # # RENAME USER 'user'@'localhost' TO 'newuser'@'localhost'
+master-bin.000001 # Query # # GRANT SELECT ON test.* TO 'newuser'@'localhost' IDENTIFIED by 'mypass2'
+master-bin.000001 # Query # # CREATE USER 'user2'@'localhost' IDENTIFIED by 'mypass'
+master-bin.000001 # Query # # GRANT SELECT ON test.t1 TO 'user2'@'localhost'
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; CREATE USER 'user3'@'localhost' IDENTIFIED by 'mypass'
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; FLUSH PRIVILEGES
master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; REVOKE UPDATE ON t1 FROM 'newuser'@'localhost'
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user2'@'localhost'
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_dist_priv.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dist_priv.test 2011-03-30 15:08:53 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dist_priv.test 2011-04-01 07:47:43 +0000
@@ -63,13 +63,7 @@ select User,Table_priv from mysql.tables
connection server2;
FLUSH PRIVILEGES;
-#
-# Temporary workaround for BUG#11938564
-# - Disable REVOKE UPDATE temporarily, the record exists in
-# NDB but is not found in "acl cache" on the slave causing
-# replication to stop.
-#
-#REVOKE UPDATE ON t1 FROM 'newuser'@'localhost';
+REVOKE UPDATE ON t1 FROM 'newuser'@'localhost';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user2'@'localhost';
select User,Table_priv from mysql.tables_priv ORDER BY User;
DROP USER 'newuser'@'localhost';
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2011-03-30 14:31:56 +0000
+++ b/sql/sql_acl.cc 2011-04-01 07:47:43 +0000
@@ -1675,7 +1675,7 @@ end:
new_password);
ha_binlog_log_query(thd, 0, LOGCOM_GRANT,
buff, query_length,
- "mysql", "user");
+ "mysql", "");
}
#endif
DBUG_RETURN(result);
@@ -3326,10 +3326,12 @@ int mysql_table_grant(THD *thd, TABLE_LI
#ifndef MCP_WL5482
if (!save_result) /* Same condition as 'write_bin_log' */
{
+ char *lex_db= thd->lex->select_lex.db;
+ char * db= table_list->get_db_name();
ha_binlog_log_query(thd, 0,
LOGCOM_GRANT,
thd->query(), thd->query_length(),
- "mysql", "user");
+ (lex_db)?lex_db:((db)?db:"mysql"), "");
}
#endif
@@ -3642,9 +3644,10 @@ bool mysql_grant(THD *thd, const char *d
#ifndef MCP_WL5482
if (!save_result) /* Same condition as 'write_bin_log' */
{
+ char *lex_db= thd->lex->select_lex.db;
ha_binlog_log_query(thd, 0, LOGCOM_GRANT,
thd->query(), thd->query_length(),
- "mysql", "user");
+ (lex_db)?lex_db:((db)?db:"mysql"), "");
}
#endif
@@ -5871,7 +5874,7 @@ bool mysql_create_user(THD *thd, List <L
if (some_users_created)
ha_binlog_log_query(thd, 0, LOGCOM_CREATE_USER,
thd->query(), thd->query_length(),
- "mysql", "user");
+ "mysql", "");
#endif
/* Restore the state of binlog format */
@@ -5960,7 +5963,7 @@ bool mysql_drop_user(THD *thd, List <LEX
if (some_users_deleted)
ha_binlog_log_query(thd, 0, LOGCOM_DROP_USER,
thd->query(), thd->query_length(),
- "mysql", "user");
+ "mysql", "");
#endif
thd->variables.sql_mode= old_sql_mode;
@@ -6061,7 +6064,7 @@ bool mysql_rename_user(THD *thd, List <L
if (some_users_renamed)
ha_binlog_log_query(thd, 0, LOGCOM_RENAME_USER,
thd->query(), thd->query_length(),
- "mysql", "user");
+ "mysql", "");
#endif
/* Restore the state of binlog format */
@@ -6260,9 +6263,13 @@ bool mysql_revoke_all(THD *thd, List <L
close_thread_tables(thd);
#ifndef MCP_WL5482
- ha_binlog_log_query(thd, 0, LOGCOM_REVOKE,
- thd->query(), thd->query_length(),
- "mysql", "user");
+ {
+ char *lex_db= thd->lex->select_lex.db;
+ char *db= acl_db->db;
+ ha_binlog_log_query(thd, 0, LOGCOM_REVOKE,
+ thd->query(), thd->query_length(),
+ (lex_db)?lex_db:((db)?db:"mysql"), "");
+ }
#endif
/* Restore the state of binlog format */
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (Martin.Skold:4280 to 4281)Bug#11938564 | Martin Skold | 1 Apr |