1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-25222: mysqlbinlog --base64-output wrong option default drops BINLOG from output

Problem:
=======
The ALWAYS option of the mariadb-binlog --base64-output flag
formats its output incorrectly. This option is deprecated, and
MySQL 8.0 has removed it entirely.

Solution:
========
Adhere to MySQL and remove this option from MariaDB.

Behavioral Changes:
==================
Use Case: ./mariadb-binlog --base64-output
 Previous Behavior: Sets base64-output mode to always
 New Behavior: Error message indicating incomplete argument

Use Case: ./mariadb-binlog --base64-output=always
 Previous Behavior: Sets base64-output mode to always
 New Behavior: Error message indicating invalid argument value

Reviewed By:
==========
Andrei Elkin: <andrei.elkin@mariadb.com>
This commit is contained in:
Brandon Nesterenko
2021-05-12 11:46:58 -06:00
parent 740917620a
commit 81402c1318
5 changed files with 57 additions and 124 deletions

View File

@ -521,18 +521,32 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn;
#
# WL#5625: Deprecate mysqlbinlog options --base64-output=always and --base64-output
# MDEV-25222: Remove mysqlbinlog options --base64-output=always and --base64-output
#
--echo # Expect deprecation warning.
--exec $MYSQL_BINLOG --base64-output=always std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
--echo #
--echo # Expect error for invalid --base64-output argument value.
--echo # MYSQL_BINLOG std_data/master-bin.000001 --base64-output=always 2>&1
--error 1
--exec $MYSQL_BINLOG std_data/master-bin.000001 --base64-output=always 2>&1
--echo # Expect deprecation warning again.
--exec $MYSQL_BINLOG --base64-output std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
--echo #
--echo # Expect error for incomplete --base64-output argument.
--echo # MYSQL_BINLOG std_data/master-bin.000001 --base64-output 2>&1
# The error produces the absolute path of the mysqlbinlog executable, remove it.
--replace_regex /.*mysqlbinlog.*:/mysqlbinlog:/i
--error 1
--exec $MYSQL_BINLOG std_data/master-bin.000001 --base64-output 2>&1
--echo #
--echo # Ensure --base64-output=auto outputs the same result as unspecified
--echo # MYSQL_BINLOG -v MYSQLD_DATADIR/master-bin.000001 > MYSQLTEST_VARDIR/tmp/mysqlbinlog_nob64spec.out
--exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_nob64spec.out
--echo # MYSQL_BINLOG --base64-output=auto -v MYSQLD_DATADIR/master-bin.000001 > MYSQLTEST_VARDIR/tmp/mysqlbinlog_b64auto.out
--exec $MYSQL_BINLOG --base64-output=auto -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_b64auto.out
--diff_files $MYSQLTEST_VARDIR/tmp/mysqlbinlog_nob64spec.out $MYSQLTEST_VARDIR/tmp/mysqlbinlog_b64auto.out
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_nob64spec.out
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_b64auto.out
# Clean up this part of the test.
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
# BUG#50914
# This test verifies if the approach of the mysqlbinlog prints