Bug #23223 Regression: Column ... in from clause is ambiguous
Submitted: 12 Oct 2006 18:09 Modified: 13 Oct 2006 10:08
Reporter: Cristian Gafton Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.26 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[12 Oct 2006 18:09] Cristian Gafton
Description:
The SQL parser in 5.0.26 took a step back, regressing to earlier behaviors of not being able to correctly understand JOIN ... USING syntax. See attached example.

How to repeat:
drop table if exists items, instances, nodes;

create temporary table items (
    itemId integer primary key,
    item varchar(100)
);

create temporary table instances (
    instanceid integer primary key,
    itemId integer,
    versionId integer,
    flavorId integer
);

create temporary table nodes (
    nodeId integer primary key,
    itemId integer,
    versionId integer,
    branchId integer
);

-- this works
select *
from items
join instances AS domain using (itemId)
join nodes using (itemId, versionId)
;

-- this does not work
select *
from items
join instances AS domain on items.itemId = domain.itemId
join nodes using (itemId, versionId)
;
[13 Oct 2006 10:08] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please, read about difference between of JOIN ... ON and JOIN ... USING output at http://dev.mysql.com/doc/refman/5.0/en/join.html