Bug #68649 | Query with subqueries returns wrong result instead of a syntax error | ||
---|---|---|---|
Submitted: | 12 Mar 2013 9:43 | Modified: | 12 Mar 2013 12:34 |
Reporter: | Olag Ulga | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.6.10, 5.1.40 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Subquery syntax error aggregate |
[12 Mar 2013 9:43]
Olag Ulga
[12 Mar 2013 12:34]
Olag Ulga
Not a Bug. Q4: SELECT concat(f1,f2) FROM syntaxtest WHERE CONCAT(f1,f2) IN (SELECT concat(f1 /* refers to tmp.f1 if exists otherwise to syntaxtest.f1 */ ,f2) FROM (SELECT f1 /* as x */, COUNT(1) AS cnt FROM syntaxtest GROUP BY f1 HAVING COUNT(1) > 1 ) AS tmp ) f1 in the first subquery refers to tmp.f1 if it exists otherwise ( if you uncomment /* as x */) it refers to syntaxtest.f1. means f1 from the ne