﻿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
22665	Creating trigger in custom sql for mySQL failed with 1046 error	hudan@…	nobody	"In file ""clothing.mysql.sql"" is trigger creation:
{{{#!sql
CREATE TRIGGER ins_laundryflow_clothing BEFORE INSERT ON laundryflow_clothing FOR EACH ROW
BEGIN
    SET NEW.SumWash = NEW.StartWash;
END
}}}
If I run ""syncdb"", it ends with error:
{{{
Failed to install custom SQL for laundryflow.Clothing 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 '' at line 1"")
}}}
If I remove ""BEGIN"" and ""END"", everything works:
{{{#!sql
CREATE TRIGGER ins_laundryflow_clothing BEFORE INSERT ON laundryflow_clothing FOR EACH ROW
    SET NEW.SumWash = NEW.StartWash;
}}}

Using ""DELIMITER"" didn't work at all. On Internet I found, that it's relevant only in command line MySQL client and shouldn't by use in Python-MySQL.

BTW> Creating stored procedures has the same problem."	Uncategorized	closed	Database layer (models, ORM)	1.6	Normal	invalid			Unreviewed	0	0	0	0	0	0
