• unknown's avatar
    Fix for BUG#20522 "RBR: CREATE TEMPORARY TABLE SELECT writes to binlog · 339deb0c
    unknown authored
    though unneeded". It's indeed unneeded, as slave is only interested in
    permanent tables, and permanent tables don't depend on temporary tables
    when in row-based binlogging mode. And other CREATE TEMPORARY TABLE
    (referring no table or with LIKE) already don't write the CREATE to
    binlog in row-based mode. 
    
    
    mysql-test/r/rpl_row_create_table.result:
      result update (note that no lines appear in SHOW BINLOG EVENTS further below, which is how we
      see the bug is fixed)
    mysql-test/t/rpl_row_create_table.test:
      testing if a CREATE TEMPORARY TABLE SELECT goes to binlog (it should not)
      when in row-based binlogging mode. A few lines after, there is a SHOW
      BINLOG EVENTS; before the bugfix it showed the CREATE TEMPORARY TABLE.
    sql/sql_class.h:
      a method to access select_create::create_info from outside of select_create
      ("read-only" access). Making get_thd() "read-only" too.
    sql/sql_insert.cc:
      The function (hook) which writes CREATE TABLE to binlog when in row-based
      binlogging mode, for CREATE TABLE SELECT, now does nothing if the table
      is temporary (as in row-based mode, temp tables are not replicated).
      This is consistent with CREATE TEMPORARY TABLE LIKE and
      CREATE TEMPORARY TABLE, which don't write any CREATE to binlog in row-based
      mode.
    339deb0c
sql_class.h 59.9 KB