Details
Description
This query gives Unknown column 't12.a' in 'field list' error after upgrade to 10.2.26 from 10.2.25.
SELECT
|
t12.a
|
FROM
|
`t1` AS t11,
|
`t2` AS t12,
|
`t3` AS t8
|
JOIN `t4` AS t10
|
LEFT JOIN `t5` AS t9
|
ON
|
t9.`a` = t10.`a`
|
WHERE
|
t10.`a` = t11.`a` AND t10.`a` = t12.`a` AND t8.`a` = t11.`a`;
|
Sample data:
create table t1 (a int);
|
insert into t1 values (7), (2), (9);
|
create table t2 (a int);
|
insert into t2 values (5), (1), (7);
|
create table t3 (a int);
|
insert into t3 values (2), (7), (3);
|
create table t4 (a int);
|
insert into t4 values (2), (7), (3);
|
create table t5 (a int);
|
insert into t5 values (2), (7), (3);
|
Attachments
Issue Links
- is duplicated by
-
MDEV-20330 Combination of "," (comma), cross join and left join fails to parse (regression since 10.1.40)
-
- Closed
-
-
MDEV-20539 With more than one CROSS JOIN columns of tables mentioned earlier in the FROM clause cannot be referenced in SELECT or WHERE clause (Error message: "Unknown column 'table.column' in 'where clause'")
-
- Closed
-
I confirm that behavior changed in 10.1-10.4, query returns result in 5.5,10.0
I am not sure if Standart allows such a query (MySQL 8.0.16 returned results, postgres 9.6 returned error)
Error message "Unknown column .. in 'field list'" is misleading.
mysqltest: At line 25: query 'SELECT t2.a FROM t2,t3 JOIN t4 left JOIN t5 ON t5.a = t4.a' failed: 1054: Unknown column 't2.a' in 'field list'