• unknown's avatar
    Bug #50095 Multi statement including CREATE EVENT causes rotten binlog entry · 47756010
    unknown authored
    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.
    47756010
sql_lex.h 58.6 KB