• unknown's avatar
    Fixes to the replication mixed mode (patch approved by Monty): · b9f6f9bc
    unknown authored
    - detect the need for row-based binlogging not at execution stage but earlier at parsing stage; needed for example for CREATE TABLE SELECT UUID().
    - more tests of this mixed mode.
    
    
    mysql-test/r/rpl_switch_stm_row_mixed.result:
      result update
    mysql-test/t/rpl_switch_stm_row_mixed.test:
      testing more scenarios for the mixed replication mode.
      Added support for manual testing of UDFs vs the mixed mode (behind a variable in the test).
      Changing old file names to better ones.
    sql/item_create.cc:
      at parse time, when we see a UUID(), put up a flag in LEX to say this binlogs properly only with row-based binlogging.
    sql/item_func.cc:
      it's not perfect to put up the flag at this execution stage, better do it at parse stage.
    sql/item_strfunc.cc:
      it's not perfect to put up the flag at this execution stage, better do it at parse stage
    sql/set_var.cc:
      this assertion is wrong, this piece of code can happen in RBR mode too.
    sql/sql_lex.cc:
      when we reinitialize the LEX members before every query, we have to reinitialize the new flag
    sql/sql_lex.h:
      A new flag, set at parsing stage, which tells if some items seen during parsing stage require row-based replication to binlog/replicate correctly
      when this statement is later executed.
      It has to be in LEX and not directly in THD, for this to work in prepared statements.
    sql/sql_parse.cc:
      Parsing stage happened at some time in the past and set up the flag in LEX, now that we execute the statement we actually turn on row-based binlogging
      if the thread's binlog format is "mixed". We then turn it off when leaving mysql_execute_command().
      Some cleanup code was not executed if leaving mysql_execute_command() at the "error" label, fixing this. A better fix than the "goto end" would be
      to modify each "goto error" to "res=1; goto end" but it required changing many lines which I don't want to do now ("make smallest possible patch").
    sql/sql_yacc.yy:
      When at parsing stage we see a UDF we put up a flag to say that row-based binlogging is preferred.
    b9f6f9bc
sql_parse.cc 221 KB