diff options
author | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2021-12-02 17:34:42 -0700 |
---|---|---|
committer | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2021-12-02 17:34:42 -0700 |
commit | 31113b94555358ff91420ed237042894fecddcf8 (patch) | |
tree | 9b8d7521060ed6f611d5207277ce2bba9d3a047f | |
parent | d547b2864f0b8ca02a56f80a951d1c7890907664 (diff) | |
download | mariadb-git-bb-10.7-MDEV-4989_review.tar.gz |
MDEV-4989 Extended window test verbosity tobb-10.7-MDEV-4989_review
ensure specific error is returned
-rw-r--r-- | mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc | 46 | ||||
-rw-r--r-- | mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result | 18 | ||||
-rw-r--r-- | sql/rpl_gtid.cc | 2 |
3 files changed, 53 insertions, 13 deletions
diff --git a/mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc b/mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc index 496e7384a64..536f5f408f0 100644 --- a/mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc +++ b/mysql-test/suite/binlog/include/mysqlbinlog_gtid_window_test_cases.inc @@ -447,29 +447,63 @@ if ($is_remote == 1) --echo # At the following error cases analysis --echo # note incompatible --start-position with the value of --echo # Gtid list event of the 2nd binlog file printed above. + +--let err_out_= $MYSQLTEST_VARDIR/tmp/err.out +--let SEARCH_FILE=$err_out_ + --echo # --echo # Error Case 1: --echo # A GTID --start-position that does not mention all domains that make --echo # up the binary log state should error ---echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ +--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ 2> err_out_ --error 1 ---exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-3 > $tmp_out_ +--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-3 > $tmp_out_ 2> $err_out_ +if ($is_remote == 1) +{ + --let SEARCH_PATTERN=ERROR: Got error reading packet from server +} +if ($is_remote == 0) +{ + --let SEARCH_PATTERN=ERROR: Found unrecognized GTID +} +--source include/search_pattern_in_file.inc +--remove_file $err_out_ --echo # --echo # Error Case 2: --echo # A GTID --start-position with any sequence numbers which occur before --echo # the binary log state should result in error ---echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ +--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ 2> err_out_ --error 1 ---exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > $tmp_out_ +--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > $tmp_out_ 2> $err_out_ +if ($is_remote == 1) +{ + --let SEARCH_PATTERN=ERROR: Got error reading packet from server +} +if ($is_remote == 0) +{ + --let SEARCH_PATTERN=ERROR: Binary logs are missing data for domain 0 +} +--source include/search_pattern_in_file.inc +--remove_file $err_out_ --echo # --echo # Error Case 3: --echo # A GTID --start-position with any sequence numbers that are not --echo # eventually processed results in error ---echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ +--echo # MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ 2> err_out_ --error 1 ---exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > $tmp_out_ +--exec $MYSQL_BINLOG $BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > $tmp_out_ 2> $err_out_ +if ($is_remote == 1) +{ + --let SEARCH_PATTERN=ERROR: Got error reading packet from server +} +if ($is_remote == 0) +{ + --let SEARCH_PATTERN=ERROR: Binary logs never reached expected GTID state +} +--source include/search_pattern_in_file.inc +--remove_file $err_out_ if ($is_remote == 1) { diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result index ccdb7e170b2..06f22c5ae99 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_gtid_window.result @@ -175,17 +175,20 @@ DROP TABLE t3; # Error Case 1: # A GTID --start-position that does not mention all domains that make # up the binary log state should error -# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ +# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ 2> err_out_ +FOUND 2 /ERROR: Found unrecognized GTID/ in err.out # # Error Case 2: # A GTID --start-position with any sequence numbers which occur before # the binary log state should result in error -# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ +# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ 2> err_out_ +FOUND 1 /ERROR: Binary logs are missing data for domain 0/ in err.out # # Error Case 3: # A GTID --start-position with any sequence numbers that are not # eventually processed results in error -# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ +# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ 2> err_out_ +FOUND 2 /ERROR: Binary logs never reached expected GTID state/ in err.out ###################################### # Test Group 2 # Run test cases on remote host @@ -374,17 +377,20 @@ PURGE BINARY LOGS TO "master-bin.000002"; # Error Case 1: # A GTID --start-position that does not mention all domains that make # up the binary log state should error -# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ +# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-3 > tmp_out_ 2> err_out_ +FOUND 1 /ERROR: Got error reading packet from server/ in err.out # # Error Case 2: # A GTID --start-position with any sequence numbers which occur before # the binary log state should result in error -# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ +# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-2,1-2-5 > tmp_out_ 2> err_out_ +FOUND 1 /ERROR: Got error reading packet from server/ in err.out # # Error Case 3: # A GTID --start-position with any sequence numbers that are not # eventually processed results in error -# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ +# MYSQL_BINLOG BINLOG_FILE_PARAM2 --start-position=0-1-8,1-2-6 > tmp_out_ 2> err_out_ +FOUND 1 /ERROR: Got error reading packet from server/ in err.out # # Remote-only cleanup from error cases DROP TABLE t1; diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index a744c467ab8..7fe09d4bfe5 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -3091,7 +3091,7 @@ my_bool Gtid_stream_auditor::initialize_gtid_state(FILE *out, rpl_gtid *gtids, { Gtid_stream_auditor::error( out, "Found unrecognized GTID state %u-%u-%llu in binary logs.", - domain_state_gtid->domain_id, PARAM_GTID((*domain_state_gtid))); + PARAM_GTID((*domain_state_gtid))); err= TRUE; continue; } |