1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Revert a patch for Bug#48231, which introduced valgrind warnings.

Original revision:
------------------------------------------------------------
revision-id: li-bing.song@sun.com-20100130124925-o6sfex42b6noyc6x
parent: joro@sun.com-20100129145427-0n79l9hnk0q43ajk
committer: <Li-Bing.Song@sun.com>
branch nick: mysql-5.1-bugteam
timestamp: Sat 2010-01-30 20:49:25 +0800
message:
  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:
Alexander Nozdrin
2010-02-02 16:38:44 +03:00
parent 1a6ab2267f
commit f392eddabc
13 changed files with 104 additions and 2319 deletions

View File

@ -1727,8 +1727,6 @@ typedef struct st_lex : public Query_tables_list
- CREATE TRIGGER (points to "TRIGGER");
- CREATE PROCEDURE (points to "PROCEDURE");
- CREATE FUNCTION (points to "FUNCTION" or "AGGREGATE");
- CREATE VIEW(points to "VIEW");
- CREATE EVENT(points to "EVENT");
This pointer is required to add possibly omitted DEFINER-clause to the
DDL-statement before dumping it to the binlog.
@ -1737,29 +1735,6 @@ typedef struct st_lex : public Query_tables_list
const char *stmt_definition_end;
/*
stmt_begin is intended to point to the begin of every statement.
It is now used in the following statements:
- GRANT ALL PRIVELEGES ON *.* (points to "GRANT");
- REVOKE ALL PRIVELEGES ON *.* (points to "REVOKE");
*/
const char *stmt_begin;
const char *stmt_end;
/*
stmt_user_begin is intended to point to the begin of the user list in
the following statements:
- GRANT ALL PRIVELEGES ON *.* TO 'username'@'hostname'
(points to "'username'");
- REVOKE ALL PRIVELEGES ON *.* FROM 'username'@'hostname'
(points to "'username'");
these pointers are required to replace the CURRENT_USER()
function by the real user before dumping it to the binlog.
*/
const char *stmt_user_begin;
const char *stmt_user_end;
/**
During name resolution search only in the table list given by
Name_resolution_context::first_name_resolution_table and