mariadb/mysql-test/suite/binlog_encryption
Andrei Elkin 6112a0f93d MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog --verbose
(This commit is exclusively for 10.2 branch. Do not merge it to 10.3)

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:37:44 +03:00
..
binlog_incident.combinations MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_incident.result fix binlog_encryption.binlog_incident test 2016-12-06 09:45:51 +01:00
binlog_incident.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_index.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
binlog_index.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_ioerr.result MDEV-21360 global debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
binlog_ioerr.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_mysqlbinlog-cp932.result MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_mysqlbinlog-cp932.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_row_annotate-master.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_row_annotate.combinations Follow-up for MDEV-11065 - add tests for compressed+encrypted binlog 2017-01-23 01:06:15 +02:00
binlog_row_annotate.result MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog --verbose 2020-08-31 18:37:44 +03:00
binlog_row_annotate.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_xa_recover-master.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
binlog_xa_recover.result MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
binlog_xa_recover.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
disabled.def fix binlog_encryption.binlog_incident test 2016-12-06 09:45:51 +01:00
encrypted_master.result search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
encrypted_master_lost_key.test search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
encrypted_master_switch_to_unencrypted.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
encrypted_master_switch_to_unencrypted.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
encrypted_master_switch_to_unencrypted.test search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
encrypted_slave.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
encrypted_slave.result search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
encrypted_slave.test Allow tests to work with cmake -DPLUGIN_PARTITION=NO 2018-05-29 17:14:34 +03:00
encryption_algorithms.combinations MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
encryption_algorithms.inc MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
encryption_combo.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
encryption_combo.result search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
encryption_combo.test search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
multisource.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
multisource.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
multisource.test Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
my.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
mysqlbinlog.combinations Follow-up for MDEV-11065 - add tests for compressed+encrypted binlog 2017-01-23 01:06:15 +02:00
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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
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 20:49:04 +05:30
rpl_binlog_errors.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_cant_read_event_incident.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_cant_read_event_incident.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_checksum.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_checksum.result MDEV-21360 global debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
rpl_checksum.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_checksum_cache.result MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_checksum_cache.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_corruption.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_gtid_basic.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_gtid_basic.combinations Follow-up for MDEV-11065 - add tests for compressed+encrypted binlog 2017-01-23 01:06:15 +02:00
rpl_gtid_basic.result MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
rpl_gtid_basic.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_incident.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_incident.result MDEV-21360 debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
rpl_incident.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02: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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_loaddata_local.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_loaddata_local.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_loadfile.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_loadfile.test search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
rpl_mixed_binlog_max_cache_size.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_mixed_binlog_max_cache_size.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_packet.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_packet.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_packet.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02: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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02: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 MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_parallel_show_binlog_events_purge_logs.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_parallel_show_binlog_events_purge_logs.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_relayrotate-slave.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_relayrotate.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_relayrotate.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_semi_sync.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_semi_sync.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_skip_replication.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_skip_replication.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_skip_replication.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_special_charset.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_special_charset.result Merge branch '10.1' into 10.2 2017-02-10 17:01:45 +01:00
rpl_special_charset.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_sporadic_master-master.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_sporadic_master.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_sporadic_master.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_ssl.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_ssl.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_stm_relay_ign_space-slave.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_stm_relay_ign_space.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_stm_relay_ign_space.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_switch_stm_row_mixed.result MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
rpl_switch_stm_row_mixed.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_sync-master.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_sync-slave.opt MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_sync.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_sync.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_temporal_format_default_to_default.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_temporal_format_default_to_default.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_temporal_format_default_to_default.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_temporal_format_mariadb53_to_mysql56.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_temporal_format_mariadb53_to_mysql56.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_temporal_format_mariadb53_to_mysql56.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_temporal_format_mysql56_to_mariadb53.cnf MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_temporal_format_mysql56_to_mariadb53.result Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
rpl_temporal_format_mysql56_to_mariadb53.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
rpl_typeconv.result MDEV-17098 DATE -> DATETIME replication conversion not working, even in ALL_NON_LOSSY mode 2018-10-16 12:56:33 +03:00
rpl_typeconv.test MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
suite.pm MDEV-9038 Binlog encryption tests 2016-12-05 20:19:01 +02:00
testdata.inc Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00