mariadb/mysql-test/include
Alfranio Correia ac1b464a33 BUG#43929 binlog corruption when max_binlog_cache_size is exceeded
Large transactions and statements may corrupt the binary log if the size of the
cache, which is set by the max_binlog_cache_size, is not enough to store the
the changes.

In a nutshell, to fix the bug, we save the position of the next character in the
cache before starting processing a statement. If there is a problem, we simply
restore the position thus removing any effect of the statement from the cache.
Unfortunately, to avoid corrupting the binary log, we may end up loosing changes
on non-transactional tables if they do not fit in the cache. In such cases, we
store an Incident_log_event in order to stop the slave and alert users that some
changes were not logged.

Precisely, for every non-transactional changes that do not fit into the cache,
we do the following:
  a) the statement is *not* logged
  b) an incident event is logged after committing/rolling back the transaction,
  if any. Note that if a failure happens before writing the incident event to
  the binary log, the slave will not stop and the master will not have reported
  any error.
  c) its respective statement gives an error

For transactional changes that do not fit into the cache, we do the following:
  a) the statement is *not* logged
  b) its respective statement gives an error

To work properly, this patch requires two additional things. Firstly, callers to
MYSQL_BIN_LOG::write and THD::binlog_query must handle any error returned and
take the appropriate actions such as undoing the effects of a statement. We
already changed some calls in the sql_insert.cc, sql_update.cc and sql_insert.cc
modules but the remaining calls spread all over the code should be handled in
BUG#37148. Secondly, statements must be either classified as DDL or DML because
DDLs that do not get into the cache must generate an incident event since they
cannot be rolled back.
2009-06-18 14:52:46 +01:00
..
add_anonymous_users.inc
analyze-sync_with_master.test
analyze-timeout.test
big_test.inc
check-testcase.test
check-warnings.test
check_events_off.inc
check_var_limit.inc
circular_rpl_for_4_hosts_init.inc
circular_rpl_for_4_hosts_sync.inc
cleanup_fake_relay_log.inc
commit.inc BUG#43929 binlog corruption when max_binlog_cache_size is exceeded 2009-06-18 14:52:46 +01:00
common-tests.inc
concurrent.inc Fix for Bug#42308 Several server tests do not pass MTR's --check option 2009-05-15 12:15:56 +02:00
connect2.inc
count_sessions.inc
ctype_common.inc
ctype_filesort.inc
ctype_german.inc
ctype_innodb_like.inc
ctype_like_escape.inc
ctype_like_range_f1f2.inc
ctype_regex.inc
ddl_i18n.check_events.inc
ddl_i18n.check_sp.inc
ddl_i18n.check_triggers.inc
ddl_i18n.check_views.inc
deadlock.inc
default_my.cnf
default_mysqld.cnf
default_ndbd.cnf
delete_anonymous_users.inc
diff_master_slave.inc
diff_tables.inc Bug#40465: mysqldump.test does no checking of dump or restore. 2009-05-21 16:03:53 -04:00
endspace.inc
get_binlog_dump_thread_id.inc
gis_generic.inc
gis_keys.inc
grant_cache.inc Fix for Bug#42308 Several server tests do not pass MTR's --check option 2009-05-15 12:15:56 +02:00
handler.inc Fix for Bug#42308 Several server tests do not pass MTR's --check option 2009-05-15 12:15:56 +02:00
have_32bit.inc
have_64bit.inc
have_archive.inc
have_big5.inc
have_binlog_format_mixed.inc
have_binlog_format_mixed_or_row.inc
have_binlog_format_mixed_or_statement.inc
have_binlog_format_row.inc
have_binlog_format_row_or_statement.inc
have_binlog_format_statement.inc
have_blackhole.inc
have_case_insensitive_file_system.inc
have_case_sensitive_file_system.inc
have_community_features.inc
have_compress.inc
have_cp866.inc
have_cp932.inc
have_cp1250_ch.inc
have_cp1251.inc
have_crypt.inc
have_csv.inc
have_debug.inc
have_eucjpms.inc
have_euckr.inc
have_example_plugin.inc
have_exampledb.inc
have_gb2312.inc
have_gbk.inc
have_geometry.inc
have_innodb.inc
have_koi8r.inc
have_latin2_ch.inc
have_local_infile.inc
have_log_bin.inc
have_lowercase0.inc
have_lowercase1.inc
have_lowercase2.inc
have_multi_ndb.inc
have_ndb.inc
have_ndb_extra.inc
have_ndbapi_examples.inc
have_outfile.inc
have_partition.inc
have_query_cache.inc
have_simple_parser.inc
have_sjis.inc
have_ssl.inc
have_symlink.inc
have_tis620.inc
have_ucs2.inc
have_udf.inc
have_ujis.inc
have_utf8.inc
index_merge1.inc automerge 2009-06-15 17:36:51 +03:00
index_merge2.inc
index_merge_2sweeps.inc
index_merge_ror.inc
index_merge_ror_cpk.inc
innodb_rollback_on_timeout.inc
innodb_trx_weight.inc
is_embedded.inc
kill_query.inc
kill_query_and_diff_master_slave.inc
linux_sys_vars.inc
load_sysvars.inc
loaddata_autocom.inc
master-slave-end.inc
master-slave-reset.inc
master-slave.inc
mix1.inc merged 36995 to 5.1-bugteam 2009-06-04 13:26:18 +03:00
mix2.inc
mix2_ucs2.inc
mtr_check.sql
mtr_warnings.sql
mysqlbinlog_row_engine.inc
mysqldump.inc Bug#40465 - mysqldump.test does no checking of dump or restore 2009-05-22 10:38:17 -04:00
mysqltest-x.inc
ndb_backup.inc
ndb_backup_print.inc
ndb_default_cluster.inc
ndb_master-slave.inc
ndb_master-slave_2ch.inc
ndb_not_readonly.inc
ndb_restore_master.inc
ndb_restore_slave_eoption.inc
ndb_setup_slave.inc
ndb_wait_connected.inc
no_running_event_scheduler.inc
no_running_events.inc
no_valgrind_without_big.inc Don't run funcs_1/myisam_views test case under valgrind, unless 2009-06-09 11:36:14 -03:00
not_as_root.inc
not_embedded.inc
not_ndb.inc
not_ndb_default.inc
not_openssl.inc
not_valgrind.inc
not_windows.inc
one_thread_per_connection.inc
parser_bug21114.inc
ps_conv.inc
ps_create.inc
ps_ddl_1.inc
ps_modify.inc
ps_modify1.inc
ps_query.inc
ps_renew.inc
query_cache.inc Fix for Bug#42308 Several server tests do not pass MTR's --check option 2009-05-15 12:15:56 +02:00
query_cache_sql_prepare.inc
read_many_rows.inc
report-features.test
reset_master_and_slave.inc
restart_mysqld.inc
rowid_order.inc
rpl_events.inc
rpl_multi_engine.inc
rpl_multi_engine2.inc
rpl_multi_engine3.inc
rpl_stmt_seq.inc
rpl_udf.inc
running_event_scheduler.inc
safe_set_to_maybe_ro_var.inc
select_ndb_apply_status.inc
set_binlog_format_mixed.sql
set_binlog_format_row.sql
set_binlog_format_statement.sql
setup_fake_relay_log.inc
show_binary_logs.inc
show_binlog_events.inc
show_binlog_events2.inc
show_binlog_using_logname.inc
show_master_logs.inc
show_master_status.inc
show_msg.inc
show_msg80.inc
show_rpl_debug_info.inc
show_slave_status.inc
show_slave_status2.inc
sp-vars.inc
start_slave.inc
stop_slave.inc
strict_autoinc.inc
sync_slave_io_with_master.inc
system_db_struct.inc
test_fieldsize.inc
test_outfile.inc
testdb_only.inc
tpcb.inc
tpcb_disk_data.inc
unsafe_binlog.inc
uses_vardir.inc
varchar.inc
wait_condition.inc
wait_condition_sp.inc
wait_for_binlog_event.inc
wait_for_query_to_succeed.inc
wait_for_slave_io_to_start.inc
wait_for_slave_io_to_stop.inc
wait_for_slave_param.inc
wait_for_slave_sql_error.inc
wait_for_slave_sql_error_and_skip.inc
wait_for_slave_sql_to_start.inc
wait_for_slave_sql_to_stop.inc
wait_for_slave_to_start.inc
wait_for_slave_to_stop.inc
wait_for_status_var.inc
wait_show_condition.inc
wait_until_connected_again.inc
wait_until_count_sessions.inc
wait_until_disconnected.inc
wait_until_rows_count.inc
windows.inc
windows_sys_vars.inc