Bug #26030 | Parsing fails for stored routine w/multi-statement execution enabled | ||
---|---|---|---|
Submitted: | 1 Feb 2007 20:45 | Modified: | 14 Jul 2008 19:02 |
Reporter: | Paul DuBois | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Parser | Severity: | S3 (Non-critical) |
Version: | 5.0 and up | OS: | Any |
Assigned to: | Marc ALFF | CPU Architecture: | Any |
[1 Feb 2007 20:45]
Paul DuBois
[1 Feb 2007 20:46]
Paul DuBois
spbug.c test program to illustrate the problem
Attachment: spbug.c (application/octet-stream, text), 5.88 KiB.
[1 Feb 2007 22:18]
Marc ALFF
Verified with the test driver provided, and with a mysqltest script : use test; delimiter $$; # works DROP PROCEDURE IF EXISTS p; CREATE PROCEDURE p() BEGIN SELECT 1; END; CALL p() $$ # fails when parsing ';' returned as MY_LEX_CHAR, not END_OF_INPUT -- error ER_PARSE_ERROR DROP PROCEDURE IF EXISTS p; CREATE PROCEDURE p() SELECT 1; CALL p() $$ # works DROP PROCEDURE IF EXISTS p; CREATE PROCEDURE p() BEGIN SELECT 1; END; CALL p() $$
[20 Mar 2008 18:00]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/44305 ChangeSet@1.2563, 2008-03-20 11:57:34-06:00, malff@lambda.hsd1.co.comcast.net. +7 -0 Bug#26030 (Parsing fails for stored routine w/multi-statement execution enabled) Before this fix, the lexer and parser would treat the ';' character as a different token (either ';' or END_OF_INPUT), based on convoluted logic, which failed in simple cases where a stored procedure is implemented as a single statement, and used in a multi query. With this fix: - the character ';' is always parsed as a ';' token in the lexer, - parsing multi queries is implemented in the parser, in the 'query:' rules, - the value of thd->client_capabilities, which is the capabilities negotiated between the client and the server during bootstrap, is immutable and not arbitrarily modified during parsing (which was the root cause of the bug)
[28 May 2008 10:01]
Bugs System
Pushed into 6.0.6-alpha
[7 Jul 2008 16:00]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/49111
[7 Jul 2008 21:54]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/49134
[7 Jul 2008 21:56]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/49135
[8 Jul 2008 18:50]
Marc ALFF
See related bug#37525
[9 Jul 2008 12:51]
Georgi Kodinov
pushed to 5.0.66
[14 Jul 2008 17:09]
Marc ALFF
Correction: Pushed into 5.0.68 (not 5.0.66), on July 14, 2008 (after the version bump from July 9, 2008). Also, pushed into: - 5.1.28, - 6.0.6
[14 Jul 2008 19:02]
Paul DuBois
Noted in 5.0.68, 5.1.28, 6.0.6 changelogs. In some cases, the parser interpreted the ; character as the end of input and misinterpreted stored program definitions.
[28 Jul 2008 13:47]
Bugs System
Pushed into 5.0.68 (revid:kpettersson@mysql.com-20080715152926-s5kgnqhtu93b3c8v) (pib:2) (Retry automatic marking, to ensure nothing is missed. cm01)
[28 Jul 2008 16:46]
Bugs System
Pushed into 5.1.28 (revid:joerg@mysql.com-20080714105031-88hmr2baz5di9xej) (version source revid:joerg@mysql.com-20080714105031-88hmr2baz5di9xej) (pib:3)