Bug #24359 Subquery joing table alias fail to read
Submitted: 16 Nov 2006 11:30 Modified: 22 Nov 2006 21:18
Reporter: Jeffrey Yuen Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.26 OS:Linux (LINUX)
Assigned to: CPU Architecture:Any
Tags: subquery

[16 Nov 2006 11:30] Jeffrey Yuen
Description:
The subquery statme is fail with join table.
Return with

Duplicate column name 'id'

It won't happen in in 4.1.20 with exactly same query

How to repeat:
SELECT *
FROM(
SELECT *
FROM prj as p
LEFT JOIN cor AS c ON (p.id=c.id )
WHERE p.lid=0
order by p.pio
) as tmp 
GROUP by p.id

it will return Duplicate column name 'id'

but  if we input 

SELECT *
FROM(
SELECT p.id,p.pio
FROM prj as p
LEFT JOIN cor AS c ON (p.id=c.id )
WHERE p.lid=0
order by p.pio
) as tmp 
GROUP by p.id

it will fine

Suggested fix:
support join table alias in subuery
[22 Nov 2006 21:18] 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

Compare output of your subqueries.