Bug #31947 Declare with a reserved word succeeded.
Submitted: 30 Oct 2007 13:32 Modified: 17 Mar 21:12
Reporter: Horst Hunger
Status: Closed
Category:Server: Parser Severity:S3 (Non-critical)
Version:5.1.23-beta, 5.0 BK OS:Linux (Suse 10.2)
Assigned to: Alexander Nozdrin Target Version:5.0+
Triage: D3 (Medium)

[30 Oct 2007 13: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 13:32] Horst Hunger
see also bug#31946
[30 Oct 2007 13:34] Horst Hunger
Same with "declare x509 char;"
[30 Oct 2007 16:51] Sveta Smirnova
Thank you for the report.

Verified as described.
[29 Feb 10: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 10: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 12:18] Alexander Nozdrin
Pushed into 5.1-runtime.
[3 Mar 19:19] Bugs System
Pushed into 5.1.24-rc
[3 Mar 19:20] Bugs System
Pushed into 6.0.5-alpha
[17 Mar 21: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 16:27] Jon Stephens
Also noted in 5.1.23-ndb-6.3.11 changelog.