Hi,I logged in to Percona MySQL5.7 (version 5.7.24-26-log Percona Server (GPL), Release 26, Revision c8fe767) as user ‘andrew’@‘localhost’.
And I need to create an event with DEFINER = ‘root’@‘localhost’, and I am executing
CREATE DEFINER = 'root'@'localhost'
EVENT ps_helper.event1
ON SCHEDULE EVERY '1' DAY
STARTS '2020-04-22 10:12:42'
DO
BEGIN
-- some code is here
END;
ALTER EVENT ps_helper.event1 ENABLE<br>
but when I execute CREATE EVENT event1 then I get:
CREATE DEFINER = 'andrew'@'localhost'
EVENT ps_helper.event1
ON SCHEDULE EVERY '1' DAY
STARTS '2020-04-22 10:12:42'
DO
BEGIN
-- some code is here
END;
ALTER EVENT ps_helper.event1 ENABLE
As you can see MySql replaced definer from ‘root’@‘localhost’ to my current user ‘andrew’@‘localhost’.The same issue happens in Percona MySql8 (version 8.0.18-9 Percona Server (GPL), Release 9, Revision 53e606f)Why MySql ignores definer when I create the event?
And how to force MySql to use definer I want?Are there any plans to fix this bug in any nearest version?