Bug #65497 | sql_no_cache processed as field name in dependent subquery on mysql 5.5 | ||
---|---|---|---|
Submitted: | 2 Jun 2012 21:51 | Modified: | 3 Jun 2012 7:45 |
Reporter: | morrison morrison | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Parser | Severity: | S3 (Non-critical) |
Version: | 5.5 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | dependent subquery, SQL_NO_CACHE |
[2 Jun 2012 21:51]
morrison morrison
[2 Jun 2012 21:53]
morrison morrison
mysql> SELECT a from T WHERE a IN (SELECT sql_no_cache a FROM T); ERROR 1054 (42S22): Unknown column 'sql_no_cache' in 'field list'
[3 Jun 2012 7:45]
Valeriy Kravchuk
I think this is properly explained in the manual, http://dev.mysql.com/doc/refman/5.5/en/select.html: "As of MySQL 5.5.3, these two options are mutually exclusive and an error occurs if they are both specified. Also, these options are not permitted in subqueries (including subqueries in the FROM clause), and SELECT statements in unions other than the first SELECT." So, it is not expected to see/process SQL_NO_CACHE in subquery in any special way, and it is processed as a column alias. I'd prefer to see more specific/clear error message, but otherwise this is a documented behavior in 5.5.