mariadb/mysql-test/suite/binlog/t
Luis Soares 647c619393 BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
when generating new name.
      
If find_uniq_filename returns an error, then this error is not
being propagated upwards, and execution does not report error to
the user (although a entry in the error log is generated).
                  
Additionally, some more errors were ignored in new_file_impl:
- when writing the rotate event
- when reopening the index and binary log file
                  
This patch addresses this by propagating the error up in the
execution stack. Furthermore, when rotation of the binary log
fails, an incident event is written, because there may be a
chance that some changes for a given statement, were not properly
logged. For example, in SBR, LOAD DATA INFILE statement requires
more than one event to be logged, should rotation fail while
logging part of the LOAD DATA events, then the logged data would
become inconsistent with the data in the storage engine.

mysql-test/include/restart_mysqld.inc:
  Refactored restart_mysqld so that it is not hardcoded for
  mysqld.1, but rather for the current server.
mysql-test/suite/binlog/t/binlog_index.test:
  The error on open of index and binary log on new_file_impl 
  is now caught. Thence the user will get an error message. 
  We need to accomodate this change in the test case for the
  failing FLUSH LOGS.
mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt:
  Sets max_binlog_size to 4096.
mysql-test/suite/rpl/t/rpl_binlog_errors.test:
  Added some test cases for asserting that the error is found 
  and reported.
sql/handler.cc:
  Catching error now returned by unlog (in ha_commit_trans) and 
  returning it.
sql/log.cc:
  Propagating errors from new_file_impl upwards. The errors that
  new_file_impl catches now are:
  - error on generate_new_name
  - error on writing the rotate event
  - error when opening the index or the binary log file.
sql/log.h:
  Changing declaration of:
  - rotate_and_purge
  - new_file
  - new_file_without_locking
  - new_file_impl
  - unlog
  They now return int instead of void.
sql/mysql_priv.h:
  Change signature of reload_acl_and_cache so that write_to_binlog
  is an int instead of bool.
sql/mysqld.cc:
  Redeclaring not_used var as int instead of bool.
sql/rpl_injector.cc:
  Changes to catch the return from rotate_and_purge.
sql/slave.cc:
  Changes to catch the return values for new_file and rotate_relay_log.
sql/slave.h:
  Changes to rotate_relay_log declaration (now returns int 
  instead of void).
sql/sql_load.cc:
  In SBR, some logging of LOAD DATA events goes through
  IO_CACHE_CALLBACK invocation at mf_iocache.c:_my_b_get. The
  IO_CACHE implementation is ignoring the return value for from
  these callbacks (pre_read and post_read), so we need to find out
  at the end of the execution if the error is set or not in THD.
sql/sql_parse.cc:
  Catching the rotate_relay_log and rotate_and_purge return values.
  Semantic change in reload_acl_and_cache so that we report errors
  in binlog interactions through the write_to_binlog output parameter.
  If there was any failure while rotating the binary log, we should
  then report the error to the client when handling SQLCOMM_FLUSH.
2010-11-30 23:32:51 +00:00
..
binlog_auto_increment_bug33029-master.opt
binlog_auto_increment_bug33029.test Bug #40559 assertion failed in check_binlog_magic 2009-03-06 20:19:29 +02:00
binlog_base64_flag.test Fix for bug #54393: crash and/or valgrind errors in 2010-06-18 21:32:23 +04:00
binlog_database.test
binlog_delete_and_flush_index.test BUG#34582: FLUSH LOGS does not close and reopen the binlog index 2009-10-20 09:39:40 +01:00
binlog_grant.test
binlog_incident-master.opt Bug #44442: Incident events are silent in mysqlbinlog output 2009-05-11 13:32:38 +02:00
binlog_incident.test Bug#46010 main.ctype_gbk_binlog fails sporadically : Table 't2' already exists 2009-09-07 13:42:54 +08:00
binlog_index-master.opt Bug #57840 MTR: parallel execution breaks with smart ordering of test cases 2010-11-05 15:26:38 +01:00
binlog_index.test BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error 2010-11-30 23:32:51 +00:00
binlog_innodb.test Bug #49741 test files contain explicit references to bin/relay-log positions 2010-05-24 21:54:08 +08:00
binlog_innodb_row.test Post-push fix for BUG#51251. 2010-03-09 23:41:21 +00:00
binlog_killed.test Merge from mysql-trunk-innodb into mysql-5.1-innodb/storage/innobase: 2010-05-20 10:39:02 +03:00
binlog_killed_simulate-master.opt
binlog_killed_simulate.test Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains load data infile 2010-08-03 10:22:19 +08:00
binlog_mix_innodb_stat.test
binlog_mixed_failure_mixing_engines.test BUG#47287 RBR: replication diff on basic case with txn- and non-txn tables in a statement 2009-10-06 01:38:58 +01:00
binlog_mixed_load_data.test Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains load data infile 2010-08-03 10:22:19 +08:00
binlog_multi_engine.test
binlog_old_versions.test
binlog_row_binlog-master.opt
binlog_row_binlog.test
binlog_row_ctype_cp932.test
binlog_row_ctype_ucs.test
binlog_row_drop_tmp_tbl.test
binlog_row_failure_mixing_engines.test BUG#47287 RBR: replication diff on basic case with txn- and non-txn tables in a statement 2009-10-06 01:38:58 +01:00
binlog_row_innodb_stat-master.opt
binlog_row_innodb_stat.test
binlog_row_insert_select.test
binlog_row_mix_innodb_myisam-master.opt
binlog_row_mix_innodb_myisam.test
binlog_row_mysqlbinlog_db_filter.test Bug #46998 mysqlbinlog can't output BEGIN even if the database is included in a transaction 2009-09-30 10:31:25 +08:00
binlog_row_mysqlbinlog_verbose.test Attempt to fix Windows testcase output issue 2009-10-14 21:25:11 +08:00
binlog_sql_mode.test BUG#39526 sql_mode not retained in binary log for CREATE PROCEDURE 2009-02-28 09:35:18 +08:00
binlog_start_comment.test
binlog_statement_insert_delayed.test
binlog_stm_binlog-master.opt Bug #57840 MTR: parallel execution breaks with smart ordering of test cases 2010-11-05 15:26:38 +01:00
binlog_stm_binlog.test Bug #49741 test files contain explicit references to bin/relay-log positions 2010-05-24 21:54:08 +08:00
binlog_stm_blackhole.test Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains load data infile 2010-08-03 10:22:19 +08:00
binlog_stm_ctype_cp932.test
binlog_stm_ctype_ucs.test
binlog_stm_do_db-master.opt Bug #57840 MTR: parallel execution breaks with smart ordering of test cases 2010-11-05 15:26:38 +01:00
binlog_stm_do_db.test BUG#42829: binlogging enabled for all schemas regardless of 2009-09-24 15:52:52 +01:00
binlog_stm_drop_tmp_tbl.test
binlog_stm_innodb_stat-master.opt
binlog_stm_innodb_stat.test
binlog_stm_insert_select.test
binlog_stm_mix_innodb_myisam-master.opt
binlog_stm_mix_innodb_myisam.test BUG#47995: Mark system functions as unsafe 2009-11-18 15:50:31 +01:00
binlog_stm_ps.test
binlog_stm_row.test BUG#47995: Mark system functions as unsafe 2009-11-18 15:50:31 +01:00
binlog_stm_unsafe_warning-master.opt Bug#46265: Can not disable warning about unsafe statements for binary logging 2009-07-31 10:00:35 -03:00
binlog_stm_unsafe_warning.test BUG#47129 fix small bug in test 2009-10-08 14:00:43 +02:00
binlog_tmp_table.test BUG#51226: mysqlbinlog replay: ERROR 1146 when using temp tables 2010-03-03 12:16:18 +00:00
binlog_truncate_innodb-master.opt Bug #36763 2009-02-06 17:06:41 +01:00
binlog_truncate_innodb.test Bug #36763 2009-02-10 22:26:37 +01:00
binlog_truncate_myisam.test Bug #36763 2009-02-10 22:26:37 +01:00
binlog_unsafe.test BUG#49222: Mark RAND() as unsafe 2010-01-13 10:00:03 +01:00
binlog_write_error.test Backport Bug#37148 to 5.1 2010-01-24 15:03:23 +08:00
disabled.def Fixed bug numbers in disabled.def files 2010-10-27 09:54:04 +05:30