diff --git a/mysql-test/r/rpl_events.result b/mysql-test/r/rpl_events.result index debfcce0072..0d7e7bb28a7 100644 --- a/mysql-test/r/rpl_events.result +++ b/mysql-test/r/rpl_events.result @@ -157,3 +157,9 @@ test slave_terminate SLAVESIDE_DISABLED 2 DROP EVENT test.slave_terminate; "in the master" 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; diff --git a/mysql-test/t/rpl_events.test b/mysql-test/t/rpl_events.test index 895e94c438b..62ffead7dcb 100644 --- a/mysql-test/t/rpl_events.test +++ b/mysql-test/t/rpl_events.test @@ -22,3 +22,26 @@ set binlog_format=statement; # Embedded server doesn't support binlogging --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; + diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c644aeab499..4b48917c91a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1569,7 +1569,7 @@ bool sp_process_definer(THD *thd) if (lex->definer == NULL) DBUG_RETURN(TRUE); - if (thd->slave_thread) + if (thd->slave_thread && lex->sphead) lex->sphead->m_chistics->suid= SP_IS_NOT_SUID; } else