Bug #15800 | Join causes Unknown column ... in 'on clause' | ||
---|---|---|---|
Submitted: | 16 Dec 2005 2:22 | Modified: | 16 Dec 2005 2:31 |
Reporter: | Kevin Benton (Candidate Quality Contributor) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.0.16 | OS: | Windows (Windows XP) |
Assigned to: | MySQL Verification Team | CPU Architecture: | Any |
[16 Dec 2005 2:22]
Kevin Benton
[16 Dec 2005 2:31]
MySQL Verification Team
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: Please, read the manual (http://dev.mysql.com/doc/refman/5.0/en/join.html). It is an intended change in 5.0.12 to become closer to the standard: "Beginning with MySQL 5.0.12, natural joins and joins with USING, including outer join variants, are processed according to the SQL:2003 standard. Redundant output columns specified in USING clauses are eliminated, and output columns are ordered correctly. This means that some queries that appeared to work correctly prior to 5.0.12 must be rewritten to comply with the standard. For example, a query of the form SELECT t1.id,t2.id,t3.id FROM t1,t2 LEFT JOIN t3 ON (t3.id=t1.id) WHERE t1.id=t2.id; will be interpreted in MySQL 5.0.12 and later as SELECT t1.id,t2.id,t3.id FROM t1,( t2 LEFT JOIN t3 ON (t3.id=t1.id) ) WHERE t1.id=t2.id; Such a query must now be written like so: SELECT t1.id,t2.id,t3.id FROM (t1,t2) LEFT JOIN t3 ON (t3.id=t1.id) WHERE t1.id=t2.id;"