| 1 |
--source include/have_debug.inc |
| 2 |
--source include/master-slave.inc |
| 3 |
|
| 4 |
connection master; |
| 5 |
SET GLOBAL BINLOG_CHECKSUM=NONE; |
| 6 |
connection slave; |
| 7 |
SET GLOBAL BINLOG_CHECKSUM=NONE; |
| 8 |
|
| 9 |
--echo *** Test MDEV-6120, output of current GTID when a replication error is logged to the errorlog *** |
| 10 |
--connection master |
| 11 |
CREATE TABLE t1(a INT PRIMARY KEY); |
| 12 |
--sync_slave_with_master |
| 13 |
|
| 14 |
--connection slave |
| 15 |
--source include/stop_slave.inc |
| 16 |
CHANGE MASTER TO master_use_gtid=slave_pos; |
| 17 |
|
| 18 |
--connection master |
| 19 |
INSERT INTO t1 VALUES (1); |
| 20 |
SET gtid_seq_no=100; |
| 21 |
INSERT INTO t1 VALUES (2); |
| 22 |
INSERT INTO t1 VALUES (3); |
| 23 |
INSERT INTO t1 VALUES (4); |
| 24 |
--save_master_pos |
| 25 |
|
| 26 |
--connection slave |
| 27 |
SET sql_log_bin=0; |
| 28 |
INSERT INTO t1 VALUES (2); |
| 29 |
SET sql_log_bin=1; |
| 30 |
|
| 31 |
START SLAVE; |
| 32 |
--let $slave_sql_errno=1062 |
| 33 |
--source include/wait_for_slave_sql_error.inc |
| 34 |
--source include/wait_for_slave_io_to_start.inc |
| 35 |
--source include/stop_slave_io.inc |
| 36 |
# Skip the problem event from the master. |
| 37 |
SET GLOBAL gtid_slave_pos= "0-1-100"; |
| 38 |
--source include/start_slave.inc |
| 39 |
--sync_with_master |
| 40 |
|
| 41 |
SELECT * FROM t1 ORDER BY a; |
| 42 |
|
| 43 |
--connection master |
| 44 |
|
| 45 |
SET @dbug_save= @@debug_dbug; |
| 46 |
SET debug_dbug= '+d,incident_database_resync_on_replace'; |
| 47 |
REPLACE INTO t1 VALUES (5); |
| 48 |
SET debug_dbug= @dbug_save; |
| 49 |
--save_master_pos |
| 50 |
|
| 51 |
--connection slave |
| 52 |
--let $slave_sql_errno=1590 |
| 53 |
--source include/wait_for_slave_sql_error.inc |
| 54 |
--source include/stop_slave_io.inc |
| 55 |
SET sql_slave_skip_counter=1; |
| 56 |
--source include/start_slave.inc |
| 57 |
--sync_with_master |
| 58 |
|
| 59 |
SELECT * FROM t1 ORDER BY a; |
| 60 |
|
| 61 |
|
| 62 |
# Check error log for correct messages. |
| 63 |
let $log_error_= `SELECT @@GLOBAL.log_error`; |
| 64 |
if(!$log_error_) |
| 65 |
{ |
| 66 |
# MySQL Server on windows is started with --console and thus |
| 67 |
# does not know the location of its .err log, use default location |
| 68 |
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err; |
| 69 |
} |
| 70 |
--let SEARCH_FILE=$log_error_ |
| 71 |
--let SEARCH_PATTERN=Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error |
| 72 |
--source include/search_pattern_in_file.inc |
| 73 |
--let SEARCH_PATTERN=Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590 |
| 74 |
--source include/search_pattern_in_file.inc |
| 75 |
|
| 76 |
|
| 77 |
--connection master |
| 78 |
DROP TABLE t1; |
| 79 |
|
| 80 |
connection master; |
| 81 |
SET GLOBAL BINLOG_CHECKSUM=default; |
| 82 |
connection slave; |
| 83 |
SET GLOBAL BINLOG_CHECKSUM=default; |
| 84 |
connection master; |
| 85 |
--source include/rpl_end.inc |