Bug #105438 The sql in the event cannot be output to the slow log
Submitted: 3 Nov 2021 9:40 Modified: 4 Nov 2021 12:55
Reporter: d f Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:8.0.25 OS:Any
Assigned to: CPU Architecture:Any

[3 Nov 2021 9:40] d f
Description:
The sql in the event cannot be output to the slow log

How to repeat:
delimiter $$

create or replace EVENT event_flush_slow_log ON SCHEDULE EVERY 30 SECOND on completion preserve ENABLE do begin  replace into t1 values (111,111,111,111); update
t1 set id2 = id2 +1 where id1 = 1;  end;$$

delimiter ;

 alter event event_flush_slow_log enable;

set global slow_query_log = ON;

set global long_query_time = 0;

 "replace into t1 values (111,111,111,111);" &&  "update
t1 set id2 = id2 +1 where id1 = 1;"  cannot be output to the slow log

Suggested fix:
The slow sql in the event should be output to the slow log
[3 Nov 2021 13:29] MySQL Verification Team
Hi Mr. f,

Thank you for your bug report.

Right now, statements executed by event manager are not logged in the slow query log. However, if you would agree that we make a feature request out of this report, we would be happy to verify it as a feature request.

We are waiting on your feedback.
[4 Nov 2021 0:47] d f
If you need it, I agree with you .
If  change update to select,it can logged in the slow query log.
delimiter $$

create or replace EVENT event_flush_slow_log ON SCHEDULE EVERY 30 SECOND on completion preserve ENABLE do begin  
select sleep(1);
 end;$$

delimiter ;

 alter event event_flush_slow_log enable;

set global slow_query_log = ON;

set global long_query_time = 0;

"select sleep(1)" can logged in the slow query log;
[4 Nov 2021 12:55] MySQL Verification Team
Thank you for your contribution.

Verified as a feature request.