Bug #81579 select conditon of var=@ does not return a syntax error
Submitted: 24 May 2016 20:37 Modified: 28 May 2016 4:33
Reporter: Terry Powell Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.5.40 OS:Windows
Assigned to: CPU Architecture:Any

[24 May 2016 20:37] Terry Powell
Description:
I tried

SELECT * FROM users where username=@;

in MySQL Workbench and got '0 row(s) returned' rather than an error message. 

How to repeat:
Execute a select on any table using 

where columnName = @
[25 May 2016 15:47] Michael Ezzell
Bug #68135 seems to suggest that this is valid.  User-defined variables can have a zero-length name, and it looks as if @ is equivalent to @``.

mysql> SET @`` = 'bar';
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT @;
+------+
| @    |
+------+
| bar  |
+------+
1 row in set (0.00 sec)

mysql>
[28 May 2016 4:33] MySQL Verification Team
Thank you for taking the time to write to us, but this is not a bug. 
See also Bug #68135, User-defined variables can have a zero-length name and this is expected behavior.