• unknown's avatar
    WL#3339 (Issue warnings when statement-based replication may fail): · 499a8ecd
    unknown authored
    Replacing binlog_row_based_if_mixed with variable binlog_stmt_flags
    holding several flags and adding member functions to manipulate the
    flags.
    
    Added code to generate a warning when an attempt to log an unsafe
    statement to the binary log was made. The warning is both pushed to the
    SHOW WARNINGS table and written to the error log. The prevent flooding
    the error log, the warning is just written to the error log once per
    open session.
    
    
    sql/item_create.cc:
      Using {is,set,clear}_stmt_unsafe() member functions instead of
      binlog_row_based_if_mixed member variable.
    sql/sp_head.cc:
      Using {is,set,clear}_stmt_unsafe() member functions instead of
      binlog_row_based_if_mixed member variable.
    sql/sp_head.h:
      Using {is,set,clear}_stmt_unsafe() member functions instead of
      binlog_row_based_if_mixed member variable.
    sql/sql_base.cc:
      Using {is,set,clear}_stmt_unsafe() member functions instead of
      binlog_row_based_if_mixed member variable.
    sql/sql_class.cc:
      Adding THD::binlog_flags to store thread-specific binary log state.
      Adding code to push a warning and write an entry into the error log
      when an attempt is made to log an unsafe statement.
    sql/sql_class.h:
      Adding THD::binlog_flags to store thread-specific binary log state.
      Adding BINLOG_FLAG_UNSAFE_STMT_PRINTED to denote that a warning for
      an unsafe statement has already been generated for this thread.
    sql/sql_insert.cc:
      Using {is,set,clear}_stmt_unsafe() member functions instead of
      binlog_row_based_if_mixed member variable.
    sql/sql_lex.cc:
      Replacing binlog_row_based_if_mixed with a variable binlog_stmt_flags
      holding several flags.
    sql/sql_lex.h:
      Replacing binlog_row_based_if_mixed with a variable binlog_stmt_flags
      holding several flags.
    sql/share/errmsg.txt:
      Adding error message to indicate that an attempt to log an unsafe
      statement was made.
    sql/sql_view.cc:
      Using {is,set,clear}_stmt_unsafe() member functions instead of
      binlog_row_based_if_mixed member variable.
    mysql-test/r/binlog_unsafe.result:
      New BitKeeper file ``mysql-test/r/binlog_unsafe.result''
    mysql-test/t/binlog_unsafe.test:
      New BitKeeper file ``mysql-test/t/binlog_unsafe.test''
    499a8ecd
sql_class.h 73.7 KB