Bug #59380 Local variables must be quoted sometimes
Submitted: 9 Jan 2011 14:10 Modified: 1 Jul 2011 15:23
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:any OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: qc

[9 Jan 2011 14:10] Peter Laursen

"Local variable names are not case sensitive." is incomplete. There are more rules to obey.

(This report http://bugs.mysql.com/bug.php?id=59374 really triggered a lot!)

How to repeat:
DECLARE var! INT; -- does not work
DECLARE `var!` INT; -- works

Suggested fix:
Clarify in docs that local variable names must be quoted as rules for identifiers specify: http://dev.mysql.com/doc/refman/5.1/en/identifiers.html 

(but not sure about ANSI-modes - and also not sure if other kind of quotes will work for local variables).
[9 Jan 2011 14:22] Valeriy Kravchuk
Thank you for the documentation request.
[1 Jul 2011 15:23] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Updated text:

Local variable names are not case sensitive. Permissible characters
and quoting rules are the same as for other identifiers, as described
in http://dev.mysql.com/doc/refman/5.1/en/identifiers.html.