Commit 01bd6abb authored by unknown's avatar unknown

Bug #28953 Using events in a replication let the slave crash.

Fixed where the slave code would try to update the Lex->sphead which is NULL on an "alter table" commands.


mysql-test/r/rpl_events.result:
  test that "alter event" replicates without crashing the slave
mysql-test/t/rpl_events.test:
  test that "alter event" replicates without crashing the slave
sql/sql_parse.cc:
  Added a check for lex->spd, which isn't set on an "alter event" command
parent d6032e96
...@@ -157,3 +157,9 @@ test slave_terminate SLAVESIDE_DISABLED 2 ...@@ -157,3 +157,9 @@ test slave_terminate SLAVESIDE_DISABLED 2
DROP EVENT test.slave_terminate; DROP EVENT test.slave_terminate;
"in the master" "in the master"
DROP TABLE t1; DROP TABLE t1;
CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
DO BEGIN
select * from t1;
END;|
ALTER EVENT event1 RENAME TO event2;
DROP EVENT event2;
...@@ -22,3 +22,26 @@ set binlog_format=statement; ...@@ -22,3 +22,26 @@ set binlog_format=statement;
# Embedded server doesn't support binlogging # Embedded server doesn't support binlogging
--source include/rpl_events.inc --source include/rpl_events.inc
#
# Bug #28953 Using events in a replication let the slave crash.
#
connection master;
DELIMITER |;
CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
DO BEGIN
select * from t1;
END;|
DELIMITER ;|
ALTER EVENT event1 RENAME TO event2;
sync_slave_with_master;
connection master;
DROP EVENT event2;
sync_slave_with_master;
...@@ -1567,7 +1567,7 @@ bool sp_process_definer(THD *thd) ...@@ -1567,7 +1567,7 @@ bool sp_process_definer(THD *thd)
if (lex->definer == NULL) if (lex->definer == NULL)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
if (thd->slave_thread) if (thd->slave_thread && lex->sphead)
lex->sphead->m_chistics->suid= SP_IS_NOT_SUID; lex->sphead->m_chistics->suid= SP_IS_NOT_SUID;
} }
else else
......
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