mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-33672: 10.11 Fix for Two Phase Alter Flags
Extends 89c907bd4f
to account for
binlog_two_phase_alter flags in a Gtid log event. I.e., if the
FL_COMMIT_ALTER_E1 or FL_ROLLBACK_ALTER_E2 flags are set in the
event flags, yet the length of the event is too short to hold
the value, then set the event as invalid
This commit is contained in:
committed by
Sergei Golubchik
parent
720a0f6c78
commit
8c7992165b
@@ -112,6 +112,30 @@ RESET MASTER;
|
||||
set @@global.gtid_slave_pos="";
|
||||
include/start_slave.inc
|
||||
#
|
||||
# Test FL_COMMIT_ALTER
|
||||
connection master;
|
||||
set @old_dbug= @@SESSION.debug_dbug;
|
||||
set @@SESSION.debug_dbug= "+d,negate_alter_fl_from_gtid";
|
||||
set @old_alter_tp= @@SESSION.binlog_alter_two_phase;
|
||||
set @@SESSION.binlog_alter_two_phase= 1;
|
||||
alter table t1 add column (nc int);
|
||||
include/save_master_gtid.inc
|
||||
set @@SESSION.debug_dbug=@old_dbug;
|
||||
set @@SESSION.binlog_alter_two_phase=@old_alter_tp;
|
||||
connection slave;
|
||||
# Waiting for slave to find invalid event..
|
||||
include/wait_for_slave_sql_error.inc [errno=1594]
|
||||
STOP SLAVE IO_THREAD;
|
||||
# Reset master binlogs (as there is an invalid event) and slave state
|
||||
connection master;
|
||||
RESET MASTER;
|
||||
connection slave;
|
||||
SET STATEMENT sql_log_bin=0 FOR alter table t1 add column (nc int);
|
||||
RESET SLAVE;
|
||||
RESET MASTER;
|
||||
set @@global.gtid_slave_pos="";
|
||||
include/start_slave.inc
|
||||
#
|
||||
# Cleanup
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
@@ -167,6 +167,38 @@ RESET MASTER;
|
||||
set @@global.gtid_slave_pos="";
|
||||
--source include/start_slave.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Test FL_COMMIT_ALTER
|
||||
--connection master
|
||||
set @old_dbug= @@SESSION.debug_dbug;
|
||||
set @@SESSION.debug_dbug= "+d,negate_alter_fl_from_gtid";
|
||||
set @old_alter_tp= @@SESSION.binlog_alter_two_phase;
|
||||
set @@SESSION.binlog_alter_two_phase= 1;
|
||||
alter table t1 add column (nc int);
|
||||
--source include/save_master_gtid.inc
|
||||
set @@SESSION.debug_dbug=@old_dbug;
|
||||
set @@SESSION.binlog_alter_two_phase=@old_alter_tp;
|
||||
|
||||
--connection slave
|
||||
--echo # Waiting for slave to find invalid event..
|
||||
let $slave_sql_errno= 1594; # ER_SLAVE_RELAY_LOG_READ_FAILURE
|
||||
source include/wait_for_slave_sql_error.inc;
|
||||
STOP SLAVE IO_THREAD;
|
||||
|
||||
--echo # Reset master binlogs (as there is an invalid event) and slave state
|
||||
--connection master
|
||||
RESET MASTER;
|
||||
|
||||
--connection slave
|
||||
# Just to keep tables consistent between master/slave
|
||||
SET STATEMENT sql_log_bin=0 FOR alter table t1 add column (nc int);
|
||||
RESET SLAVE;
|
||||
RESET MASTER;
|
||||
set @@global.gtid_slave_pos="";
|
||||
--source include/start_slave.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
|
||||
|
Reference in New Issue
Block a user