diff options
author | unknown <Li-Bing.Song@sun.com> | 2010-03-28 16:37:47 +0800 |
---|---|---|
committer | unknown <Li-Bing.Song@sun.com> | 2010-03-28 16:37:47 +0800 |
commit | 4775601012f81655643667d8635e46de120be7ae (patch) | |
tree | a813ba865f4d9d6b86ee3aa123046c8d65544830 /sql/sql_lex.h | |
parent | 604ab4d274ab036acd1725707b436836e98699a0 (diff) | |
download | mariadb-git-4775601012f81655643667d8635e46de120be7ae.tar.gz |
Bug #50095 Multi statement including CREATE EVENT causes rotten binlog entry
The log event of 'CREATE EVENT' was being binlogged with garbage
at the end of the query if 'CREATE EVENT' is followed by another SQL statement
and they were executed as one command.
for example:
DELIMITER |;
CREATE EVENT e1 ON EVERY DAY DO SELECT 1; SELECT 'a';
DELIMITER ;|
When binlogging 'CREATE EVENT', we always create a new statement with definer
and write it into the log event. The new statement is made from cpp_buf(preprocessed buffer).
which is not a c string(end with '\0'), but it is copied as a c string.
In this patch, cpp_buf is copied with its length.
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 459878c03fc..54eefa22a59 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1729,6 +1729,7 @@ 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 EVENT (points to "EVENT") This pointer is required to add possibly omitted DEFINER-clause to the DDL-statement before dumping it to the binlog. |