Bug #19070 Error mixing USING and ON
Submitted: 13 Apr 2006 6:56 Modified: 13 Apr 2006 10:21
Reporter: Andrius Steponavicius Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.20 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[13 Apr 2006 6:56] Andrius Steponavicius
Description:
MySQL 5.0.20: Now mixing USING and ON causes an error...

How to repeat:
...
FROM `Tasks`
	INNER JOIN `Users`
		ON (`Users`.`userId` = `Tasks`.`executorId`)
	INNER JOIN `Persons`
		USING (`personId`)
...

ERROR: Column 'personId' in from clause is ambiguous

but that works:

...
FROM `Tasks`
	INNER JOIN `Users`
		ON (`Users`.`userId` = `Tasks`.`executorId`)
	INNER JOIN `Persons`
		ON (`Persons`.`personId` = `Users`.`personId`)
...
[13 Apr 2006 10:21] MySQL Verification Team
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

This is being handled in bug 15229 (Unknown column when mixing ON and USING).  Also see 5.0.20 changelog: Certain combinations of joins with mixed ON  and USING clauses caused unknown column errors. (Bug #15229)