我希望这个活动开始发挥作用。
表示它正在等待队列,并且没有按预期进行更新。
事件:
SET GLOBAL event_scheduler = ON;
DELIMITER $$
USE `kickfarted` $$
CREATE EVENT ENDCHECK
ON SCHEDULE AT current_timestamp() + INTERVAL 10 SECOND
ON COMPLETION PRESERVE
DO
BEGIN
CREATE TEMPORARY TABLE successful_projectid (select project_id from project where status="looking" and pledge_end_date<NOW() and amt_collected>=min_amt);
CREATE TEMPORARY TABLE failed_projectid (select project_id from project where status="looking" and pledge_end_date<NOW() and amt_collected<min_amt);
update project SET project_status="failed" where project_id in (select * from failed_projectid);
update project SET project_status="pledged" where project_id in (select * from successful_projectid);
CREATE TEMPORARY TABLE sponsor_charge(select spon_id,project_id from sponsor where project_id in (select * from successful_projectid));
Insert into pledge_success(ps_user_id,ps_project_id,`0`) select spon_id,project_id from sponsor_charge where sponsor_charge.project_id=New.project_id;
update pledge_success SET success_date=NOW where pledge_success.ps_project_id=New.project_id;
Drop temporary tables successful_projectid,failed_projectid,sponsor_charge;
END;
$$
delimiter ;