Commit 0da1653f authored by Andrei's avatar Andrei

MDEV-31779 Server crash in Rows_log_event::update_sequence upon replaying binary log

The crash at running mysqlbinlog on a SEQUENCE containing binlog file
was caused MDEV-29621 fixes that did not check which of the slave
or binlog applier executes a block introduced there.

The block is meaningful only for the parallel slave applier, so
it's safe to fix this bug with identified the actual applier and
skipping the block when it's the mysqlbinlog one.
parent b697dce8
...@@ -127,4 +127,14 @@ CREATE SEQUENCE s4; ...@@ -127,4 +127,14 @@ CREATE SEQUENCE s4;
DROP SEQUENCE s2,s3,s4; DROP SEQUENCE s2,s3,s4;
DROP TABLE ti; DROP TABLE ti;
connection slave; connection slave;
connection master;
CREATE SEQUENCE s;
SELECT NEXTVAL(s);
NEXTVAL(s)
1
flush binary logs;
DROP SEQUENCE s;
DROP SEQUENCE s;
connection slave;
connection master;
include/rpl_end.inc include/rpl_end.inc
...@@ -195,4 +195,22 @@ DROP TABLE ti; ...@@ -195,4 +195,22 @@ DROP TABLE ti;
--sync_slave_with_master --sync_slave_with_master
# MDEV-31779 server crash in Rows_log_event::update_sequence at replaying binlog
--connection master
--let $binlog_file = query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_start = query_get_value(SHOW MASTER STATUS, Position, 1)
CREATE SEQUENCE s;
--disable_ps2_protocol
SELECT NEXTVAL(s);
--enable_ps2_protocol
flush binary logs;
DROP SEQUENCE s;
--exec $MYSQL_BINLOG $datadir/$binlog_file | $MYSQL test
DROP SEQUENCE s;
--sync_slave_with_master
--connection master
--source include/rpl_end.inc --source include/rpl_end.inc
...@@ -7544,6 +7544,7 @@ int Rows_log_event::update_sequence() ...@@ -7544,6 +7544,7 @@ int Rows_log_event::update_sequence()
#if defined(WITH_WSREP) #if defined(WITH_WSREP)
! WSREP(thd) && ! WSREP(thd) &&
#endif #endif
table->in_use->rgi_slave &&
!(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) && !(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) &&
!(old_master= !(old_master=
rpl_master_has_bug(thd->rgi_slave->rli, rpl_master_has_bug(thd->rgi_slave->rli,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment