Bug #31947 Declare with a reserved word succeeded.
Submitted: 30 Oct 2007 12:32 Modified: 17 Mar 2008 20:12
Reporter: Horst Hunger Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.1.23-beta, 5.0 BK OS:Linux (Suse 10.2)
Assigned to: Alexander Nozdrin CPU Architecture:Any

[30 Oct 2007 12:32] Horst Hunger
Description:
CREATE PROCEDURE sp1()
BEGIN
    declare read_only char;
END//

This succeeded, but shall fail with error 1064.

How to repeat:
execute the statement above.
[30 Oct 2007 12:32] Horst Hunger
see also bug#31946
[30 Oct 2007 12:34] Horst Hunger
Same with "declare x509 char;"
[30 Oct 2007 15:51] Sveta Smirnova
Thank you for the report.

Verified as described.
[29 Feb 2008 9:10] 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/43200

ChangeSet@1.2552, 2008-02-29 12:10:51+03:00, anozdrin@quad. +1 -0
  Fix for Bug#31947: Declare with a reserved word succeeded.
  
  READ_ONLY token was accidentally placed into wrong place
  ('ident' rule). The proper place is in the 'keyword' rule.
  
  The manual should be re-generated after this patch, because
  the manual depends on the keyword rule.
[29 Feb 2008 9:22] 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/43201

ChangeSet@1.2552, 2008-02-29 12:21:19+03:00, anozdrin@quad. +1 -0
  Fix for Bug#31947: Declare with a reserved word succeeded.
  
  READ_ONLY token was accidentally placed into wrong place
  ('ident' rule). The proper place is in the 'keyword_sp' rule.
  
  The manual should be re-generated after this patch, because
  the manual depends on the 'keyword_sp' rule.
[3 Mar 2008 11:18] Alexander Nozdrin
Pushed into 5.1-runtime.
[3 Mar 2008 18:19] Bugs System
Pushed into 5.1.24-rc
[3 Mar 2008 18:20] Bugs System
Pushed into 6.0.5-alpha
[17 Mar 2008 20:12] Paul DuBois
Noted in 5.1.24, 6.0.5 changelogs.

A variable named read_only could be declared even though that is a
reserved word.
[31 Mar 2008 14:27] Jon Stephens
Also noted in 5.1.23-ndb-6.3.11 changelog.