• unknown's avatar
    Bug#36570: Parse error of CREATE PROCEDURE stmt with comments on \ · fb0d8861
    unknown authored
    	slave
    
    The stored-routine code took the contents of the (lowest) parser
    and copied it directly to the binlog, which causes problems if there
    is a special case of interpretation at the parser level -- which 
    there is, in the "/*!VER */" comments.  The trailing "*/" caused
    errors on the slave, naturally.
    
    Now, since by that point we have /properly/ created parse-tree (as 
    the rest of the server should do!) for the stored-routine CREATE, we
    can construct a perfect statement from that information, instead of
    writing uncertain information from an unknown parser state.  
    Fortunately, there's already a function nearby that does exactly 
    that.
    
    
    mysql-test/r/binlog_innodb.result:
      Offsets changed due to quoting.
    mysql-test/r/ctype_cp932_binlog.result:
      Offsets changed due to quoting.
    mysql-test/r/mysqlbinlog.result:
      Case changed in result due to interpretation of data instead of 
      literal recitation.
    mysql-test/r/rpl_sp.result:
      Offsets changed due to quoting.  Added tests.
    mysql-test/t/rpl_sp.test:
      Add version-limiting quotes to exercise bug#36570.  Test that 
      backtick-quoted identifiers and labels work also.
    sql/sp.cc:
      In create_string, we may not have a sp_name parameter yet, so
      instead pass the char* and length of the only member we'd get out
      of it.
      
      Having done that, we can use the same function to write the 
      CREATE (FUNC|TRIG|PROC) statement to the binlog as we always used
      to display the statement to the user.
    fb0d8861
rpl_sp.test 13.3 KB