Bug #64726 | sub-query not failing when it should be | ||
---|---|---|---|
Submitted: | 21 Mar 2012 19:43 | Modified: | 26 Mar 2012 22:32 |
Reporter: | James Goatcher | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.1.61 and 5.5.21 | OS: | Linux |
Assigned to: | CPU Architecture: | Any |
[21 Mar 2012 19:43]
James Goatcher
[21 Mar 2012 20:06]
Valeriy Kravchuk
Please, read the manual, http://dev.mysql.com/doc/refman/5.5/en/correlated-subqueries.html. Subquery has access to columns from outer query.
[21 Mar 2012 20:21]
James Goatcher
Yes, this is a bug. Try my code. 1) Neither of my sub-querys is a correlated subquery. 2) The web page you refer says that "MySQL evaluates from inside to outside". If this is the case, then the inside query should cause the entire query to fail.
[21 Mar 2012 20:39]
James Goatcher
This is a bug. See my comment above.
[22 Mar 2012 5:01]
Valeriy Kravchuk
Any subquery is correlated unless it does not refer to columns from outer tables. Your subquery refers to column name that is NOT present in table mentioned in its FROM clause, so search goes to outer table to find out that name can be resolved. Do you know any other database that treats your query differently and returns error message?
[26 Mar 2012 22:32]
James Goatcher
Postgres produced the same results as MySQL, so I can only conclude that this is expected behavior. I was not able to find an Oracle resource to run it on. Is there a link you can give me showing the ANSI standard on which this behavior is based?