#23632: Cannot install Stored Procedure on syncdb
--------------------------------------------+------------------------
     Reporter:  Tim-Erwin                   |      Owner:  nobody
         Type:  Uncategorized               |     Status:  new
    Component:  Core (Management commands)  |    Version:  1.7
     Severity:  Normal                      |   Keywords:  sql syncdb
 Triage Stage:  Unreviewed                  |  Has patch:  0
Easy pickings:  0                           |      UI/UX:  0
--------------------------------------------+------------------------
 I have a simple SP which I like Django to install via a file in the sql
 folder:

 {{{
 DELIMITER $$

 CREATE PROCEDURE myProcedure (IN myParam INT)
 BEGIN

   DROP TEMPORARY TABLE IF EXISTS tmp;

   CREATE TEMPORARY TABLE IF NOT EXISTS tmp AS
   (SELECT 1, 2, 3);

 END $$
 }}}

 However, I get the following error (because the statement is split into
 pieces):
 {{{
 Failed to install custom SQL for myApp.myModel model: (1064, "You have an
 error in your SQL syntax; check the manual that corresponds to your MySQL
 server version for the right syntax to use near 'DELIMITER $$ CREATE
 PROCEDURE myProcedure (IN myParam INT) BEGIN DROP TEMPORARY ' at line 1")
 }}}

 If I install sqlparse (which leaves the statement as a whole) and try
 again, I get this error:
 {{{
 Failed to install custom SQL for myApp.myModel model: (1064, "You have an
 error in your SQL syntax; check the manual that corresponds to your MySQL
 server version for the right syntax to use near 'DELIMITER $$\n\nCREATE
 PROCEDURE myProcedure (IN myParam INT)\nBEGIN\n\n  DROP TEMPOR' at line
 1")
 }}}

 I guess, this is related to #3214

--
Ticket URL: <https://code.djangoproject.com/ticket/23632>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.9fcb5a91632ea4c4a37d5de5d65e3f4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to