The SQL parser is matching the word "delimiter" when it is not being used as a keyword. Examples include variable names in stored procedures and column names such as "my_delimiter".
This patch amends the parser to match the delimiter keyword only when not preceded by a character that could form part of an identifier.
Patch against SVN 13164
Thanks for the patch. First, I try to reproduce the problem with version 3.2.4 by importing a file that contains only this:
DELIMITER //
/*
Process FOO. See http://www.foo.com
*/
DROP PROCEDURE IF EXISTS foo
//
and I cannot reproduce the problem (I had a procedure foo and it was deleted). Can you suggest a better way to test?
This patch is not for the problem described in your comment. It is for scripts that contain the character sequence "delimiter" in a context other than as a keyword.
Create a new/empty database and run the attached delim_error.sql script.
Before the patch, it reports that it has run two SQL statements, and does not execute the third one. After the patch, it runs all three.
Script to reproduce the original bug
Merged in subversion, thanks.