MDEV-30698 Cover missing test cases for mariadb-binlog options --raw [and] --flashback

- Adding test case for --raw without -R
- Adding unsuported combination of --raw and --flashback parameters and
covered with test case
This commit is contained in:
Anel Husakovic 2023-02-20 14:11:13 +01:00 committed by Andrew Hutchings
parent 7300ab32cc
commit 2f6bb9cda5
5 changed files with 31 additions and 0 deletions

View File

@ -3063,6 +3063,12 @@ int main(int argc, char** argv)
my_set_max_open_files(open_files_limit);
if (opt_flashback && opt_raw_mode)
{
error("The --raw mode is not allowed with --flashback mode");
die(1);
}
if (opt_flashback)
{
my_init_dynamic_array(&binlog_events, sizeof(LEX_STRING), 1024, 1024,

View File

@ -1,3 +1,7 @@
#
# MDEV-30698 Cover missing test cases for mariadb-binlog options
# --raw [and] --flashback
#
CREATE TABLE t1 (a int);
FLUSH LOGS;
INSERT INTO t1 VALUES (1);

View File

@ -702,6 +702,10 @@ include/assert.inc [Table t1 should have 0 rows.]
# 6- Rows must be present upon restoring from flashback
include/assert.inc [Table t1 should have six rows.]
DROP TABLE t1;
#
# MDEV-30698 Cover missing test cases for mariadb-binlog options
# --raw [and] --flashback
#
SET binlog_format=statement;
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT

View File

@ -5,6 +5,7 @@
# respective log file specified by --result-file, and shown on-disk. This test
# ensures that the log files on disk, created by mariadb-binlog, have the most
# up-to-date events from the master.
# Option --raw works only with --read-from-remote-server, otherwise returns error.
#
# Methodology:
# On the master, rotate to a newly active binlog file and write an event to
@ -20,6 +21,14 @@
--source include/linux.inc
--source include/have_log_bin.inc
--echo #
--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options
--echo # --raw [and] --flashback
--echo #
# Test --raw format without -R (--read-from-remote-server)
--error 1 # Error 1 operation not permitted
--exec $MYSQL_BINLOG --raw --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --stop-never --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001
# Create newly active log
CREATE TABLE t1 (a int);
FLUSH LOGS;

View File

@ -364,6 +364,14 @@ FLUSH LOGS;
DROP TABLE t1;
--echo #
--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options
--echo # --raw [and] --flashback
--echo #
--error 1 # --raw mode and --flashback mode are not allowed
--exec $MYSQL_BINLOG -vv -B --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000003> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_8.sql
## Clear
SET binlog_format=statement;
--error ER_FLASHBACK_NOT_SUPPORTED