1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Bug #48321 CURRENT_USER() incorrectly replicated for DROP/RENAME USER;

REVOKE/GRANT; ALTER EVENT.

The following statements support the CURRENT_USER() where a user is needed.
  DROP USER 
  RENAME USER CURRENT_USER() ...
  GRANT ... TO CURRENT_USER()
  REVOKE ... FROM CURRENT_USER()
  ALTER DEFINER = CURRENT_USER() EVENT
but, When these statements are binlogged, CURRENT_USER() just is binlogged
as 'CURRENT_USER()', it is not expanded to the real user name. When slave 
executes the log event, 'CURRENT_USER()' is expand to the user of slave 
SQL thread, but SQL thread's user name always NULL. This breaks the replication.

After this patch, All above statements are rewritten when they are binlogged.
The CURRENT_USER() is expanded to the real user's name and host.
This commit is contained in:
2010-01-30 20:49:25 +08:00
parent fe7ad16bb4
commit 788c28aceb
13 changed files with 2319 additions and 104 deletions

View File

@@ -25,9 +25,7 @@ grant select on t to x@y;
#
rollback;
show grants for x@y;
--replace_result $VERSION VERSION
--replace_regex /\/\* xid=.* \*\//\/* XID *\//
show binlog events;
--source include/show_binlog_events.inc
start transaction;
insert into t values (2);
revoke select on t from x@y;
@@ -37,9 +35,7 @@ revoke select on t from x@y;
commit;
select * from t;
show grants for x@y;
--replace_result $VERSION VERSION
--replace_regex /\/\* xid=.* \*\//\/* XID *\//
show binlog events;
--source include/show_binlog_events.inc
drop user x@y;
drop database d1;
--sync_slave_with_master