1 year ago
#388901
milad bahari javan
Kill a procedure triggered by an event automatically
There is a procedure called "daily_feed" as follows:
CREATE /* DEFINER=`micro_bi`@`%` */ PROCEDURE `microservices_bi`.`DAILY_FEED`()
BEGIN
DROP TABLE IF EXISTS abc;
CREATE TABLE abc AS
SELECT a,b,c
FROM my_table1;
DROP TABLE IF EXISTS efg;
CREATE TABLE efg AS
SELECT e,f,g
FROM my_table2;
END
There is an event also called "DAILY_FEED" to execute the above procedure on a daily-basis as follows:
CREATE EVENT daily_feed
ON SCHEDULE EVERY 24 HOUR
STARTS '2022-01-27 03:30:00.000'
ON COMPLETION PRESERVE
ENABLE
DO CALL DAILY_FEED()
The procedure gets executed every morning at 03:30 and it takes 6 hours to be completed.
The issue is that if I want to kill the process in the middle, I can't because nothing would pop up in
SHOW processlist;
Therefore, I can't see the relevant id from processlist, and I can't KILL the process.
I need to kill the procedure, how is it possible? The server is located on AWS and I can't restart it myself.
mysql
sql
amazon-web-services
mysql-5.7
0 Answers
Your Answer