mariadb/mysql-test/suite/binlog/r
Alfranio Correia 4009bf1a15 BUG#46364 MyISAM transbuffer problems (NTM problem)
It is well-known that due to concurrency issues, a slave can become
inconsistent when a transaction contains updates to both transaction and
non-transactional tables.
                    
In a nutshell, the current code-base tries to preserve causality among the
statements by writing non-transactional statements to the txn-cache which
is flushed upon commit. However, modifications done to non-transactional
tables on behalf of a transaction become immediately visible to other
connections but may not immediately get into the binary log and therefore
consistency may be broken.
            
In general, it is impossible to automatically detect causality/dependency
among statements by just analyzing the statements sent to the server. This
happen because dependency may be hidden in the application code and it is
necessary to know a priori all the statements processed in the context of
a transaction such as in a procedure. Moreover, even for the few cases that
we could automatically address in the server, the computation effort
required could make the approach infeasible.
            
So, in this patch we introduce the option
      - "--binlog-direct-non-transactional-updates" that can be used to bypass
      the current behavior in order to write directly to binary log statements
      that change non-transactional tables.

Besides, it is used to enable the WL#2687 which is disabled by default.

mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test:
  Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error.
mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test:
  Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache. It also fixes comments.
mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
  The STMT mode is unsafe when mixed-statements are executed thus making slaves to go out of sync. For that reason, it checks consistency if not in STMT mode.
mysql-test/include/default_mysqld.cnf:
  Makes binlog-direct-non-transactional-updates "TRUE" by default in the test
  cases.
mysql-test/r/mysqld--help-notwin.result:
  Updates the result file with the new option.
mysql-test/r/mysqld--help-win.result:
  Updates the result file with the new option.
mysql-test/suite/binlog/r/binlog_multi_engine.result:
  Updates the result file because non-trx-changes are written ahead of the
  transaction.
mysql-test/suite/binlog/r/binlog_switch_inside_trans.result:
  Verifies if the user cannot change the opion binlog_direct_non_transactional_updates
  within a transaction or a procedure/function/trigger.
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt:
  Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing
  the test case and its result file.
mysql-test/suite/binlog/t/binlog_switch_inside_trans.test:
  Verifies if the user cannot change the opion binlog_direct_non_transactional_updates
  within a transaction or a procedure/function/trigger.
mysql-test/suite/ndb/r/ndb_binlog_format.result:
  Updates the result file because non-trx-changes are written ahead of the
  transaction.
mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result:
  Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
mysql-test/suite/rpl/r/rpl_concurrency_error.result:
  Updates the result file because non-trx-changes are written ahead of the
  transaction
mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result:
  Updates the result file because non-trx-changes are written ahead of the
  transaction.
mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result:
  Updates the result file because non-trx-changes are written ahead of the
  transaction.
mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result:
  Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error.
mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result:
  Updates the result file because non-trx-changes are written ahead of the
  transaction.
mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result:
  Updates the result file because non-trx-changes are written ahead of the
  transaction.
mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result:
  Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result:
  Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test:
  Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test:
  Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test:
  Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
sql/log.cc:
  Verifies if changes should be written to either the trx-cache or non-trx-cache through the use of the function use_trans_cache(). It also organizes the code.
sql/log.h:
  Changes the signature of some functions by adding the modifier "const" to the thd parameter. Specifically, the following functions are changed: 
          bool trans_has_updated_trans_table(const THD* thd);
          bool stmt_has_updated_trans_table(const THD *thd);
          bool use_trans_cache(const THD*, bool is_transactional);
sql/share/errmsg-utf8.txt:
  Creates error messages to report when an user tries to change the new option
  binlog_direct_non_transactional_updates within a transaction or a procedure/
  function/trigger.
sql/share/errmsg.txt:
  Creates error messages to report when an user tries to change the new option
  binlog_direct_non_transactional_updates within a transaction or a procedure/
  function/trigger.
sql/sql_class.h:
  Adds the new option binlog_direct_non_transactional_updates.
sql/sys_vars.cc:
  Adds the new option binlog_direct_non_transactional_updates.
support-files/my-small.cnf.sh:
  Adds binlog-direct-non-transactional-updates to the example file. By default
  the option is disabled.
2010-01-21 13:10:34 +00:00
..
binlog_auto_increment_bug33029.result Bug #40559 assertion failed in check_binlog_magic 2009-03-06 20:19:29 +02:00
binlog_base64_flag.result merged 5.1 main to 5.1-rpl 2008-08-04 07:04:47 +02:00
binlog_database.result merge mysql-next-mr --> mysql-5.1-rpl-merge 2010-01-14 16:02:55 +00:00
binlog_delete_and_flush_index.result BUG#34582: FLUSH LOGS does not close and reopen the binlog index 2009-10-20 09:39:40 +01:00
binlog_grant.result WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
binlog_implicit_commit.result Bug #37221: SET AUTOCOMMIT=1 does not commit binary log 2009-09-23 13:20:48 +02:00
binlog_incident.result Bug#46010 main.ctype_gbk_binlog fails sporadically : Table 't2' already exists 2009-09-07 13:42:54 +08:00
binlog_index.result Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2009-12-11 19:40:58 +03:00
binlog_innodb.result BUG#50038 Deadlock on flush logs with concurrent DML and RBR 2010-01-05 16:55:23 +00:00
binlog_innodb_row.result Merge BUG#43263 from 5.0-bugteam to 5.1-bugteam 2009-05-31 13:44:41 +08:00
binlog_killed.result merge mysql-5.1-rep+3 --> mysql-5.1-rep+2-delivery1 2009-12-17 21:43:35 +00:00
binlog_killed_simulate.result merging 5.1 main -> 5.1-rep+2 -> 5.1-rep+3; binlog_unsafe , rpl_mysql_upgrade fail and are under treatment 2009-11-10 20:45:15 +02:00
binlog_max_extension.result BUG#40611: MySQL cannot make a binary log after sequential number 2009-11-22 03:59:48 +00:00
binlog_mix_innodb_stat.result BUG#50038 Deadlock on flush logs with concurrent DML and RBR 2010-01-05 16:55:23 +00:00
binlog_multi_engine.result BUG#46364 MyISAM transbuffer problems (NTM problem) 2010-01-21 13:10:34 +00:00
binlog_old_versions.result BUG#34141: mysqlbinlog cannot read 4.1 binlogs containing load data infile 2008-01-30 14:12:40 +01:00
binlog_row_binlog.result merging 5.1 main -> rpl+2. Some manual work required mostly due to bug46640 2009-11-06 18:35:04 +02:00
binlog_row_ctype_cp932.result Merge stella.local:/home2/mydev/mysql-5.1-amain 2008-03-26 10:27:00 +01:00
binlog_row_ctype_ucs.result Bug#41371 Select returns 1 row with condition "col is not null and col is null" 2009-11-03 17:54:41 +04:00
binlog_row_drop_tmp_tbl.result Manual Merge 2009-11-03 18:20:08 +08:00
binlog_row_innodb_stat.result BUG#50038 Deadlock on flush logs with concurrent DML and RBR 2010-01-05 16:55:23 +00:00
binlog_row_insert_select.result WL#2687 WL#5072 BUG#40278 BUG#47175 2009-11-03 19:02:56 +00:00
binlog_row_mix_innodb_myisam.result WL#2687 WL#5072 BUG#40278 BUG#47175 2009-11-03 19:02:56 +00:00
binlog_row_mysqlbinlog_db_filter.result BUG#42941: --database paramater to mysqlbinlog fails with RBR 2009-06-07 23:28:08 +01:00
binlog_row_mysqlbinlog_verbose.result Attempt to fix Windows testcase output issue 2009-10-14 21:25:11 +08:00
binlog_sql_mode.result BUG#39526 sql_mode not retained in binary log for CREATE PROCEDURE 2009-02-28 09:35:18 +08:00
binlog_start_comment.result Fix after merge 2008-02-28 18:55:46 +01:00
binlog_statement_insert_delayed.result WL#2687 WL#5072 BUG#40278 BUG#47175 2009-11-03 19:02:56 +00:00
binlog_stm_binlog.result merging 5.1 main -> 5.1-rep+2 -> 5.1-rep+3; binlog_unsafe , rpl_mysql_upgrade fail and are under treatment 2009-11-10 20:45:15 +02:00
binlog_stm_blackhole.result merge mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge 2010-01-07 15:39:11 +00:00
binlog_stm_ctype_cp932.result Merge stella.local:/home2/mydev/mysql-5.1-amain 2008-03-26 10:27:00 +01:00
binlog_stm_ctype_ucs.result merge mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge 2010-01-07 15:39:11 +00:00
binlog_stm_do_db.result merging 5.1->rep+2->rep+3 2009-12-02 14:17:07 +02:00
binlog_stm_drop_tmp_tbl.result Manual Merge 2009-11-03 18:20:08 +08:00
binlog_stm_innodb_stat.result BUG#50038 Deadlock on flush logs with concurrent DML and RBR 2010-01-05 16:55:23 +00:00
binlog_stm_insert_select.result WL#2687 WL#5072 BUG#40278 BUG#47175 2009-11-03 19:02:56 +00:00
binlog_stm_mix_innodb_myisam.result merge mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge 2010-01-07 15:39:11 +00:00
binlog_stm_ps.result WL#2687 WL#5072 BUG#40278 BUG#47175 2009-11-03 19:02:56 +00:00
binlog_stm_row.result merge mysql-5.1-rep+3 --> mysql-5.1-rep+2-delivery1 2009-12-17 21:43:35 +00:00
binlog_stm_unsafe_warning.result Manual merge from next-mr. 2010-01-12 20:07:09 +08:00
binlog_switch_inside_trans.result BUG#46364 MyISAM transbuffer problems (NTM problem) 2010-01-21 13:10:34 +00:00
binlog_tbl_metadata.result BUG#42749: infinite loop writing to row based binlog - processlist shows 2009-05-12 12:53:46 +01:00
binlog_tmp_table.result Manual resolving for the following files 2009-12-01 21:07:18 +02:00
binlog_truncate_innodb.result Bug #36763 2009-02-06 17:06:41 +01:00
binlog_truncate_myisam.result Bug #36763 2009-02-10 22:26:37 +01:00
binlog_unsafe.result Fix for perfschema.binlog_stmt failure: 2010-01-15 13:06:33 +08:00
binlog_write_error.result BUG#37148 Most callers of mysql_bin_log.write ignore the return result 2009-11-21 12:28:01 +08:00