Menu

#2731 (ok 2.11.9) Export: DROP PROCEDURE needs IF EXISTS

2.11.8
fixed
1
2013-06-11
2008-08-04
No

Hello.

If database exported with "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION" switch checked, then code generated in 'Procedures' section is:
DROP PROCEDURE `myproc`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `myproc`(...)
BEGIN
...
END$$
This causing a problem with importing this sql in databases where procedure 'myproc' is not defined.

I think you should change 'DROP PROCEDURE `myproc`$$' to 'DROP PROCEDURE IF EXISTS `myproc`$$'. As with tables and views.

Best regards,
Anton.

Discussion

  • Marc Delisle

    Marc Delisle - 2008-08-09
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2008-08-09
    • priority: 5 --> 1
    • summary: export stored procedure with 'DROP PROCEDURE' --> (ok 2.11.9) Export: DROP PROCEDURE needs IF EXISTS
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2008-08-09

    Logged In: YES
    user_id=210714
    Originator: NO

    Fixed. Tables and views were already OK, unless you can provide me with a test case.

     
  • Anton S. Ustyuzhanin

    Logged In: YES
    user_id=1649776
    Originator: YES

    Tables and views were OK. I just wanted stored procs to be OK like tables and views. That's what I mean.

     
  • Marc Delisle

    Marc Delisle - 2008-08-28
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
MongoDB Logo MongoDB