mariadb/mysql-test/suite/binlog_encryption
Andrei Elkin caa35f8e25 MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog --verbose
(This commit is for 10.3 and upper branches)

In case of a pattern of non-STMT_END-marked Rows-log-event (A) followed by
a STMT_END marked one (B) mysqlbinlog mixes up the base64 encoded rows events
with their pseudo sql representation produced by the verbose option:
      BINLOG '
        base64 encoded data for A
        ### verbose section for A
        base64 encoded data for B
        ### verbose section for B
      '/*!*/;
In effect the produced BINLOG '...' query is not valid and is rejected with the error.
Examples of this way malformed BINLOG could have been found in binlog_row_annotate.result
that gets corrected with the patch.

The issue is fixed with introduction an auxiliary IO_CACHE to hold on the verbose
comments until the terminal STMT_END event is found. The new cache is emptied
out after two pre-existing ones are done at that time.
The correctly produced output now for the above case is as the following:
      BINLOG '
        base64 encoded data for A
        base64 encoded data for B
      '/*!*/;
        ### verbose section for A
        ### verbose section for B

Thanks to Alexey Midenkov for the problem recognition and attempt to tackle,
and to Venkatesh Duggirala who produced a patch for the upstream whose
idea is exploited here, as well as to MDEV-23077 reporter LukeXwang who
also contributed a piece of a patch aiming at this issue.
2020-08-31 18:38:57 +03:00
..
binlog_incident.combinations
binlog_incident.result
binlog_incident.test
binlog_index.result Merge branch '10.2' into 10.3 2020-01-24 14:16:20 +01:00
binlog_index.test
binlog_ioerr.result MDEV-21360 global debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
binlog_ioerr.test
binlog_mdev_20574_old_binlog.result MDEV-20574 Position of events reported by mysqlbinlog is wrong with encrypted binlogs, SHOW BINLOG EVENTS reports the correct one. 2019-10-08 14:35:34 +05:30
binlog_mdev_20574_old_binlog.test MDEV-20574 Position of events reported by mysqlbinlog is wrong with encrypted binlogs, SHOW BINLOG EVENTS reports the correct one. 2019-10-08 14:35:34 +05:30
binlog_mysqlbinlog-cp932-master.opt
binlog_mysqlbinlog-cp932.result
binlog_mysqlbinlog-cp932.test
binlog_row_annotate-master.opt
binlog_row_annotate.combinations
binlog_row_annotate.result MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog --verbose 2020-08-31 18:38:57 +03:00
binlog_row_annotate.test
binlog_write_error.result MDEV-21360 debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
binlog_write_error.test
binlog_xa_recover-master.opt
binlog_xa_recover.result
binlog_xa_recover.test
disabled.def
encrypted_master.result
encrypted_master.test Allow tests to work with cmake -DPLUGIN_PARTITION=NO 2018-05-29 17:14:34 +03:00
encrypted_master_lost_key.result
encrypted_master_lost_key.test
encrypted_master_switch_to_unencrypted.cnf
encrypted_master_switch_to_unencrypted.result
encrypted_master_switch_to_unencrypted.test
encrypted_slave.cnf
encrypted_slave.result
encrypted_slave.test Allow tests to work with cmake -DPLUGIN_PARTITION=NO 2018-05-29 17:14:34 +03:00
encryption_algorithms.combinations
encryption_algorithms.inc
encryption_combo.cnf
encryption_combo.result
encryption_combo.test
multisource.cnf
multisource.result MDEV-17544 No warning when trying to name a primary key constraint. 2019-07-30 21:57:48 +04:00
multisource.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
my.cnf
mysqlbinlog.combinations
mysqlbinlog.result MDEV-20574 Position of events reported by mysqlbinlog is wrong with encrypted binlogs, SHOW BINLOG EVENTS reports the correct one. 2019-10-08 14:35:34 +05:30
mysqlbinlog.test MDEV-20574 Position of events reported by mysqlbinlog is wrong with encrypted binlogs, SHOW BINLOG EVENTS reports the correct one. 2019-10-08 14:35:34 +05:30
restart_server.inc MDEV-23511 shutdown_server 10 times out, causing server kill at shutdown 2020-08-21 14:48:53 +03:00
rpl_binlog_errors.cnf
rpl_binlog_errors.result MDEV-22451: SIGSEGV in __memmove_avx_unaligned_erms/memcpy from _my_b_write on CREATE after RESET MASTER 2020-05-20 21:02:39 +05:30
rpl_binlog_errors.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_cant_read_event_incident.result
rpl_cant_read_event_incident.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_checksum.cnf
rpl_checksum.result MDEV-21360 global debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
rpl_checksum.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_checksum_cache.result
rpl_checksum_cache.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_corruption.cnf
rpl_corruption.result MDEV-21360 restore debud_dbug through a session variable instead of '-d,..' 2020-03-23 10:57:21 +01:00
rpl_corruption.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_gtid_basic.cnf
rpl_gtid_basic.combinations
rpl_gtid_basic.result
rpl_gtid_basic.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_incident.cnf
rpl_incident.result MDEV-21360 debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
rpl_incident.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_init_slave_errors.result MDEV-21360 debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
rpl_init_slave_errors.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_loaddata_local.result
rpl_loaddata_local.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_loadfile.result
rpl_loadfile.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_mixed_binlog_max_cache_size.result
rpl_mixed_binlog_max_cache_size.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_packet.cnf
rpl_packet.result
rpl_packet.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_parallel.result MDEV-21360 save/restore debud_dbug instead of total reset at the end of the test 2020-01-21 11:22:47 +01:00
rpl_parallel.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_parallel_ignored_errors.result MDEV-21360 save/restore debud_dbug instead of total reset at the end of the test 2020-01-21 11:22:47 +01:00
rpl_parallel_ignored_errors.test MDEV-20645: Replication consistency is broken as workers miss the error notification from an earlier failed group. 2019-09-30 13:22:37 +05:30
rpl_parallel_show_binlog_events_purge_logs.cnf
rpl_parallel_show_binlog_events_purge_logs.result
rpl_parallel_show_binlog_events_purge_logs.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_relayrotate-slave.opt
rpl_relayrotate.result
rpl_relayrotate.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_semi_sync.result
rpl_semi_sync.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_skip_replication.cnf
rpl_skip_replication.result
rpl_skip_replication.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_special_charset.opt
rpl_special_charset.result
rpl_special_charset.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_sporadic_master-master.opt
rpl_sporadic_master.result
rpl_sporadic_master.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_ssl.result
rpl_ssl.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_stm_relay_ign_space-slave.opt
rpl_stm_relay_ign_space.result
rpl_stm_relay_ign_space.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_switch_stm_row_mixed.result
rpl_switch_stm_row_mixed.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_sync-master.opt
rpl_sync-slave.opt
rpl_sync.result
rpl_sync.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_temporal_format_default_to_default.cnf
rpl_temporal_format_default_to_default.result
rpl_temporal_format_default_to_default.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_temporal_format_mariadb53_to_mysql56.cnf
rpl_temporal_format_mariadb53_to_mysql56.result
rpl_temporal_format_mariadb53_to_mysql56.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_temporal_format_mysql56_to_mariadb53.cnf
rpl_temporal_format_mysql56_to_mariadb53.result
rpl_temporal_format_mysql56_to_mariadb53.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
rpl_typeconv.result Merge 10.2 into 10.3 2018-10-17 19:37:05 +03:00
rpl_typeconv.test Move mysql-test-run/extra/rpl_tests to suite/rpl/include 2018-03-29 13:59:44 +03:00
suite.pm
testdata.inc