summaryrefslogtreecommitdiff
path: root/sql/log_event.h
diff options
context:
space:
mode:
author <Li-Bing.Song@sun.com>2010-06-27 12:42:06 +0800
committer <Li-Bing.Song@sun.com>2010-06-27 12:42:06 +0800
commit899a1d694f1086425037388f40e8be80e08039d5 (patch)
tree81bce2c4d3e4822ad29ea031ab6cf72a5ecc3413 /sql/log_event.h
parent9fa66b6440a8d0642094600b4f23a12eb3500221 (diff)
downloadmariadb-git-899a1d694f1086425037388f40e8be80e08039d5.tar.gz
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() EVENTbut, 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, session's user will be written into query log events if these statements call CURREN_USER() or 'ALTER EVENT' does not assign a definer.
Diffstat (limited to 'sql/log_event.h')
-rw-r--r--sql/log_event.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/log_event.h b/sql/log_event.h
index e3ca4ca3321..816a241e55d 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -264,7 +264,8 @@ struct sql_ex_info
1 + 2 /* type, lc_time_names_number */ + \
1 + 2 /* type, charset_database_number */ + \
1 + 8 /* type, table_map_for_update */ + \
- 1 + 4 /* type, master_data_written */)
+ 1 + 4 /* type, master_data_written */ + \
+ 1 + 16 + 1 + 60/* type, user_len, user, host_len, host */)
#define MAX_LOG_EVENT_HEADER ( /* in order of Query_log_event::write */ \
LOG_EVENT_HEADER_LEN + /* write_header */ \
QUERY_HEADER_LEN + /* write_data */ \
@@ -333,6 +334,8 @@ struct sql_ex_info
#define Q_MASTER_DATA_WRITTEN_CODE 10
+#define Q_INVOKER 11
+
/* Intvar event post-header */
/* Intvar event data */
@@ -1546,6 +1549,8 @@ protected:
*/
class Query_log_event: public Log_event
{
+ LEX_STRING user;
+ LEX_STRING host;
protected:
Log_event::Byte* data_buf;
public: