Bug #18290 | Problems with multiple joins | ||
---|---|---|---|
Submitted: | 16 Mar 2006 21:00 | Modified: | 17 Mar 2006 20:25 |
Reporter: | Eric Johnson | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.19 | OS: | Linux (Linux Centos 4.1) |
Assigned to: | CPU Architecture: | Any |
[16 Mar 2006 21:00]
Eric Johnson
[17 Mar 2006 20:13]
Eric Johnson
here are complete instructions on howto replicate the problem: mysql> create table test1 (id int(1), blah varchar(20)); Query OK, 0 rows affected (0.00 sec) mysql> create table test2 (id int(1),ref int(1), blah varchar(20)); Query OK, 0 rows affected (0.00 sec) mysql> create table test3 (id int(1),ref int(1), blah varchar(20)); Query OK, 0 rows affected (0.00 sec) mysql> select * from test1, test2 left outer join test3 on (test1.id = test3.ref) where test1.id = test2.ref; ERROR 1054 (42S22): Unknown column 'test1.id' in 'on clause' but doing the same thing on mysql 4.x works fine.
[17 Mar 2006 20:25]
MySQL Verification Team
Thank you for the bug report. Pleas read the Manual regarding the Join syntax it was changed since version 5.0.12. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.0.20-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create table test1 (id int(1), blah varchar(20)); Query OK, 0 rows affected (0.08 sec) mysql> create table test2 (id int(1),ref int(1), blah varchar(20)); Query OK, 0 rows affected (0.07 sec) mysql> create table test3 (id int(1),ref int(1), blah varchar(20)); Query OK, 0 rows affected (0.04 sec) mysql> select * from test1, test2 left outer join test3 on (test1.id = -> test3.ref) where test1.id = test2.ref; ERROR 1054 (42S22): Unknown column 'test1.id' in 'on clause' mysql> select * from (test1, test2) left outer join test3 on (test1.id = test3.ref) where test1.id = test2.ref; Empty set (0.00 sec)