mirror of
https://github.com/MariaDB/server.git
synced 2025-02-09 23:24:11 +01:00
![Brandon Nesterenko](/assets/img/avatar_default.png)
New Feature: =========== This commit extends the mariadb-binlog capabilities to allow events to be filtered by GTID ranges. More specifically, the --start-position and --stop-position arguments have been extended to accept values formatted as a list of GTID positions, e.g. --start-position=0-1-0,1-2-55. The following specific capabilities are addressed: 1) GTIDs can be used to filter results on local binlog files 2) GTIDs can be used to filter results from remote servers 3) Implemented --gtid-strict-mode that ensures the GTID event stream in each domain is monotonically increasing 4) Added new level of verbosity in mysqlbinlog -vvv to print additional diagnostic information/warnings about invalid GTID states 5) For a given GTID range, its start and stop position parameters aim to mimic the behaviors of CHANGE MASTER TO MASTER_USE_GTID=slave_pos and START SLAVE UNTIL master_gtid_pos=<GTID>, respectively. In particular, the start-position list expresses a gtid state of the server, similarly to how @@global.gtid_slave_pos expresses the gtid state of a slave server when connecting to a master with MASTER_USE_GTID=slave_pos. The GTID start-position list is exclusive and the stop-position list is inclusive. This allows users to receive events strictly after those that they already have, and is useful in cases of point in (logical) time recovery including 1) events were received out of order and should be re-sent, or 2) specifying the gtid state of a slave to get events newer than their current state. If a seq_no is 0 for start-position, it means to include the entirety of the domain. If a seq_no is 0 for stop-position, it means to exclude all events from that domain. The GTIDs provided in a start position argument must match with the GTID state of the first processed log (i.e. those listed in the Gtid_list event). If a stop position is provided, the events that are output are limited to only those with domain ids listed in the argument. When specifying combinations of start and stop positions, the following behaviors are expected: [--start-position without --stop-position]: Events that have domain ids in the start position are output if their seq_no occurs after the respective start position. Events with domain ids that are unspecified in the start position list are also output. Note that if the Gtid_list event of the first binary log is populated (i.e. non-empty), each domain in the Gtid_list must be present in the start-position list with a seq_no at or after the listed value. This behavior mimics how a slave only processes events after the state provided by @@global.gtid_slave_pos when connecting to a master with CHANGE MASTER TO MASTER_USE_GTID=slave_pos. [--stop-position without --start-position]: Output is limited to only events with both 1) domain ids that are present in the given stop position list and 2) seq_nos that are less than or equal to their respective stop GTID. Once all GTIDs in the stop position list have been processed, the program will stop processing log files. This behavior mimics how START SLAVE UNTIL master_gtid_pos=<G> has a slave only process events with domain ids present in G with their seq_nos at or before the respective gtid. [--start-position and --stop-position]: Output consists of the intersection between the events permitted by both the start and stop position rules. More concretely, the output can be defined by a union of the following rules: 1. For domains which exist in both the start and stop position lists, the events which exist in-between these positions (exclusive start, inclusive stop) are output 2. For all other events, the rules of [--stop-position without --start-position] are followed This is due to the implicit filtering within each individual rule. Even though the start position rule always includes events from unspecified domains, the stop position rule takes precedence because it always excludes events from unspecified domains. In other words, events which the start position rule would have included would then always be excluded by the stop position rule. [neither --start-position nor --stop-position]: Events are not omitted based on GTID positioning; however, --gtid-strict-mode and -vvv can still analyze gtid correctness for warning and error reporting. [repeated specification of --start-position or --stop-position]: Subsequent specifications of start and stop positions completely override previous ones. E.g., if invoked as mysqlbinlog --start-position=<G1> --start-position=<G2> ... All GTIDs specified in G1 are ignored and only those specified in G2 are used for the start position. A few additional notes: 1) this commit squashes together the commits: f4319661120e-78a9d49907ba 2) Changed rpl.rpl_blackhole_row_annotate test because it has out of order GTIDs in its binlog, so I added --skip-gtid-strict-mode 3) After all binlog events have been written, the session server id and domain id are reset to their values in the global state Reviewed By: =========== Andrei Elkin: <andrei.elkin@mariadb.com>
421 lines
16 KiB
PHP
421 lines
16 KiB
PHP
#
|
|
# This file runs test cases for using --gtid-strict-mode with mariadb-binlog to
|
|
# ensure warnings are properly displayed
|
|
#
|
|
# param $is_strict_mode boolean (0 for false, 1 for true) to enable or
|
|
# disable strict mode for GTID processing
|
|
#
|
|
|
|
--let MYSQLD_DATADIR=`select @@datadir`
|
|
--let OUT_FILE=$MYSQLTEST_VARDIR/tmp/binlog.out
|
|
|
|
if ($is_strict_mode == 0)
|
|
{
|
|
--let BINLOG_STRICT_MODE_PARAM=--skip-gtid-strict-mode
|
|
}
|
|
if ($is_strict_mode == 1)
|
|
{
|
|
--let BINLOG_STRICT_MODE_PARAM=--gtid-strict-mode
|
|
}
|
|
if ($is_verbose == 1)
|
|
{
|
|
--let BINLOG_STRICT_MODE_PARAM=$BINLOG_STRICT_MODE_PARAM -vvv
|
|
}
|
|
|
|
--let $log_error_ = $MYSQLTEST_VARDIR/tmp/out.err
|
|
--let SEARCH_FILE=$log_error_
|
|
|
|
--echo #
|
|
--echo # Test Case 1:
|
|
--echo # Sequential sequence numbers results in no errors or warnings
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
INSERT INTO t1 values (1);
|
|
INSERT INTO t1 values (2);
|
|
INSERT INTO t1 values (3);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 2:
|
|
--echo # A skipped sequence number results in no errors or warnings if all
|
|
--echo # numbers are monotonic (i.e. gaps in sequence number are allowed
|
|
--echo # provided they never decrease)
|
|
RESET MASTER;
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
INSERT INTO t1 values (1);
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 5;
|
|
INSERT INTO t1 values (3);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 3:
|
|
--echo # A sequence number lower than the last processed value results in a
|
|
--echo # warning or error
|
|
CREATE TABLE t1 (a int);
|
|
RESET MASTER;
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 1;
|
|
INSERT INTO t1 values (1);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 4:
|
|
--echo # Skipping a GTID and later receiving it results in a warning or error
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
SET @@session.gtid_seq_no= 3;
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t1 values (3);
|
|
SET @@session.gtid_seq_no= 4;
|
|
INSERT INTO t1 values (4);
|
|
INSERT INTO t1 values (5);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 5:
|
|
--echo # Repeat sequence numbers produce a warning
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 3;
|
|
INSERT INTO t1 values (3);
|
|
INSERT INTO t1 values (4);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 6:
|
|
--echo # Warnings from different domains are all displayed
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
SET @@session.gtid_seq_no= 3;
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t1 values (3);
|
|
SET @@session.gtid_seq_no= 4;
|
|
INSERT INTO t1 values (4);
|
|
SET @@session.gtid_domain_id= 1;
|
|
SET @@session.server_id= 2;
|
|
CREATE TABLE t2 (a int);
|
|
SET @@session.gtid_seq_no= 3;
|
|
INSERT INTO t2 values (2);
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t2 values (3);
|
|
SET @@session.gtid_seq_no= 4;
|
|
INSERT INTO t2 values (4);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 7:
|
|
--echo # A decreasing seq_no before a start-position is ignored
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
SET @@session.gtid_seq_no= 1;
|
|
CREATE TABLE t1 (a int);
|
|
SET @@session.gtid_seq_no= 3;
|
|
INSERT INTO t1 values (1);
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t1 values (2);
|
|
--let $start_binlog_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
|
|
SET @@session.gtid_seq_no= 4;
|
|
INSERT INTO t1 values (4);
|
|
INSERT INTO t1 values (3);
|
|
INSERT INTO t1 values (5);
|
|
FLUSH LOGS;
|
|
|
|
--echo # GTID-based start-position
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-4 $BINLOG_STRICT_MODE_PARAM > log_error_ > OUT_FILE
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-4 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
|
|
--source include/search_pattern_in_file.inc
|
|
|
|
--echo # Position-based start-position
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=$start_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX
|
|
--source include/search_pattern_in_file.inc
|
|
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 8:
|
|
--echo # A decreasing seq_no inside of a --start/--stop position window is
|
|
--echo # displayed
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
--let $start_binlog_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
|
|
INSERT INTO t1 values (1);
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 5;
|
|
INSERT INTO t1 values (4);
|
|
SET @@session.gtid_seq_no= 4;
|
|
INSERT INTO t1 values (3);
|
|
SET @@session.gtid_seq_no= 6;
|
|
INSERT INTO t1 values (5);
|
|
--let $stop_binlog_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
|
|
FLUSH LOGS;
|
|
|
|
--echo # GTID-based window
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --stop-position=0-1-6 $BINLOG_STRICT_MODE_PARAM > log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --stop-position=0-1-6 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
|
|
--echo # Position-based window
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=start_binlog_pos --stop-position=stop_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=$start_binlog_pos --stop-position=$stop_binlog_pos $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 9:
|
|
--echo # Error if --stop-position is not greater than or equal to
|
|
--echo # --start-position
|
|
--echo #
|
|
--echo # Note: Error is only displayed in strict mode, -vvv has no effect here
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2 --stop-position=0-1-1 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2 --stop-position=0-1-1 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=ERROR: Queried GTID range is invalid in strict mode
|
|
--source include/search_pattern_in_file.inc
|
|
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2,1-2-1 --stop-position=0-1-1,1-2-2 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-2,1-2-1 --stop-position=0-1-1,1-2-2 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=ERROR: Queried GTID range is invalid in strict mode
|
|
--source include/search_pattern_in_file.inc
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 10:
|
|
--echo # Strict mode warnings should be independent of --offset option
|
|
--echo # specification
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
SET @@session.gtid_seq_no= 1;
|
|
CREATE TABLE t1 (a int);
|
|
SET @@session.gtid_seq_no= 3;
|
|
INSERT INTO t1 values (1);
|
|
SET @@session.gtid_seq_no= 2;
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 4;
|
|
INSERT INTO t1 values (3);
|
|
INSERT INTO t1 values (4);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --offset=8 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --offset=8 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 11:
|
|
--echo # Strict mode warnings should be independent of --start-timestamp
|
|
--echo # option specification
|
|
set @a=UNIX_TIMESTAMP("1970-01-21 15:32:22");
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
SET @@session.gtid_seq_no= 1;
|
|
SET timestamp=@a;
|
|
CREATE TABLE t1 (a int);
|
|
SET @@session.gtid_seq_no= 3;
|
|
SET timestamp=@a+1;
|
|
INSERT INTO t1 values (1);
|
|
SET @@session.gtid_seq_no= 2;
|
|
SET timestamp=@a+2;
|
|
INSERT INTO t1 values (2);
|
|
SET @@session.gtid_seq_no= 4;
|
|
SET timestamp=@a+3;
|
|
INSERT INTO t1 values (3);
|
|
INSERT INTO t1 values (4);
|
|
FLUSH LOGS;
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --start-datetime="1970-01-21 15:32:24" $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--error $is_strict_mode
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --start-position=0-1-1 --start-datetime="1970-01-21 15:32:24" $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=$DEFAULT_ERROR_PREFIX: Found out of order GTID
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 12:
|
|
--echo # Specifying multiple binary logs with a log-position start should
|
|
--echo # skip GTID state verification
|
|
RESET MASTER;
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
INSERT INTO t1 values (1);
|
|
--let $b2_start_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
|
|
SET @@session.gtid_domain_id= 1;
|
|
SET @@session.server_id= 2;
|
|
CREATE TABLE t2 (a int);
|
|
INSERT INTO t2 values (1);
|
|
FLUSH LOGS;
|
|
INSERT INTO t2 values (2);
|
|
FLUSH LOGS;
|
|
--let BINLOG_FILE1= query_get_value(SHOW BINARY LOGS, Log_name, 1)
|
|
# Skip file 2 as input
|
|
--let BINLOG_FILE2= query_get_value(SHOW BINARY LOGS, Log_name, 2)
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE2 --start-position=b2_start_pos $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE1 $MYSQLD_DATADIR/$BINLOG_FILE2 --start-position=$b2_start_pos $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
|
|
|
|
--echo #
|
|
--echo # Test Case 13:
|
|
--echo # If multiple binary logs should be specified but a middle log is
|
|
--echo # missing, we should detect that and warn when using -vvv
|
|
|
|
RESET MASTER;
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
FLUSH LOGS;
|
|
INSERT INTO t1 values (1);
|
|
--let $b2_start_pos= query_get_value(SHOW MASTER STATUS,Position, 1)
|
|
SET @@session.gtid_domain_id= 1;
|
|
SET @@session.server_id= 2;
|
|
CREATE TABLE t2 (a int);
|
|
FLUSH LOGS;
|
|
SET @@session.gtid_domain_id= 2;
|
|
SET @@session.server_id= 3;
|
|
CREATE TABLE t3 (a int);
|
|
FLUSH LOGS;
|
|
|
|
--echo #
|
|
--echo # GLLE from each log for state reference
|
|
--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 1)
|
|
--source include/show_gtid_list.inc
|
|
--let $binlog_file=
|
|
--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
|
|
--source include/show_gtid_list.inc
|
|
--let $binlog_file=
|
|
--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 3)
|
|
--source include/show_gtid_list.inc
|
|
--let $binlog_file=
|
|
|
|
--let BINLOG_FILE1= query_get_value(SHOW BINARY LOGS, Log_name, 1)
|
|
# Skip file 2 as input
|
|
--let BINLOG_FILE3= query_get_value(SHOW BINARY LOGS, Log_name, 3)
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE1 MYSQLD_DATADIR/BINLOG_FILE3 $BINLOG_STRICT_MODE_PARAM 2> log_error_ > OUT_FILE
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE1 $MYSQLD_DATADIR/$BINLOG_FILE3 $BINLOG_STRICT_MODE_PARAM 2> $log_error_ > $OUT_FILE
|
|
--echo # We should have two warnings about missing data from domains 0 and 1 if
|
|
--echo # -vvv is specified
|
|
--let SEARCH_FILE=$log_error_
|
|
--let SEARCH_PATTERN=WARNING: Binary logs are missing data for domain 0[^\n]+the last seen event was
|
|
--source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=WARNING: Binary logs are missing data for domain 1[^\n]+neither the starting GTID position list nor any processed events
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
DROP TABLE t3;
|
|
RESET MASTER;
|
|
|
|
--echo #
|
|
--echo # Test Case 14:
|
|
--echo # If a --stop-position GTID occurs before the first specified binlog's
|
|
--echo # GLLE, error
|
|
RESET MASTER;
|
|
SET @@session.gtid_domain_id= 0;
|
|
SET @@session.server_id= 1;
|
|
CREATE TABLE t1 (a int);
|
|
INSERT INTO t1 values (1);
|
|
INSERT INTO t1 values (2);
|
|
FLUSH LOGS;
|
|
INSERT INTO t1 values (3);
|
|
FLUSH LOGS;
|
|
|
|
--echo #
|
|
--echo # GLLE from each log for state reference
|
|
--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 1)
|
|
--source include/show_gtid_list.inc
|
|
--let $binlog_file=
|
|
--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, 2)
|
|
--source include/show_gtid_list.inc
|
|
--let $binlog_file=
|
|
--echo # MYSQL_BINLOG MYSQLD_DATADIR/BINLOG_FILE2 $BINLOG_STRICT_MODE_PARAM --stop-position=0-1-2 2> log_error_ > OUT_FILE
|
|
--error 1
|
|
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$BINLOG_FILE2 $BINLOG_STRICT_MODE_PARAM --stop-position=0-1-2 2> $log_error_ > $OUT_FILE
|
|
--let SEARCH_PATTERN=ERROR: --stop-position GTID
|
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $log_error_
|
|
DROP TABLE t1;
|
|
|
|
--remove_file $OUT_FILE
|