Bug #42337 DROP EVENT:this command is not supported in the prepared statement protocol yet.
Submitted: 26 Jan 2009 8:05 Modified: 27 Jan 2009 14:23
Reporter: igor panshin Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Prepared statements Severity:S1 (Critical)
Version:5.1.25rc OS:Windows
Assigned to: CPU Architecture:Any
Tags: sp_delete_job

[26 Jan 2009 8:05] igor panshin
Description:
Pls, see how to repeat or http://sqlinfo.ru/forum/viewtopic.php?id=1115
I want to drop event with dynamical name and can not to do it. 
Can You correct this bug?

How to repeat:

DROP EVENT IF EXISTS `e_second`;

DELIMITER @@@

CREATE EVENT IF NOT EXISTS `e_second`
    ON SCHEDULE
      EVERY 1 SECOND
    COMMENT 'Saves total number of sessions then clears the table each day.'
    DO
      BEGIN
        INSERT INTO test(txt)
          SELECT now();
      END;

@@@
DELIMITER ;

DROP PROCEDURE IF EXISTS `sp_delete_job`;

DELIMITER @@@

CREATE PROCEDURE `sp_delete_job`
(
Job_Name varchar(128)
)
Proc_Label:
BEGIN
    SET @cmd= CONCAT('DROP EVENT IF EXISTS `',Job_Name,'` ');
    PREPARE stmt FROM @cmd ;
    EXECUTE stmt;

END;
@@@
DELIMITER ;

SET @CurDBName = database();
SET @JobName = CONCAT('dvftjob_', @CurDBName, '_system');
SET @JobName = 'e_second';
CALL `sp_delete_job` ( @JobName );
-- This command is not supported in the prepared statement protocol yet.
[26 Jan 2009 8:28] Valeriy Kravchuk
Statements that are currently supported as prepared are descibed at http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-prepared-statements.html. So, this is not a bug but a reasonable request for a new feature.
[27 Jan 2009 14:23] igor panshin
Sorry, I made a wrong when i called the my problem as bug but not a reasonable feature. And what's the next? Lets it is a reasonable feature. I want to know can i get a reasonable feature realization up to my death or not?
[2 Dec 2018 19:28] MySQL Verification Team
https://dev.mysql.com/worklog/task/?id=2871
(WL#2871: Prepare any SQL)