﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23632	Cannot install Stored Procedure on syncdb	Tim-Erwin	nobody	"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"	Uncategorized	closed	Core (Management commands)	1.7	Normal	worksforme	sql syncdb		Unreviewed	0	0	0	0	0	0
