Bug #6550 Self join produces ambiguous alias
Submitted: 10 Nov 2004 13:48 Modified: 29 Nov 2004 6:44
Reporter: Morgan Mörtsell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.1-gamma OS:Windows (XP)
Assigned to: Victor Vagin CPU Architecture:Any

[10 Nov 2004 13:48] Morgan Mörtsell
Description:
Using the drag-n-drop query builder feature to join a table with itself produces the same alias for both tables.

How to repeat:
Drag a table from any schema in the schemata list to the query field.
Now drag the same table and drop it on the JOIN button to join the tables.

This should produce an SQL similar to the one below.

SELECT * FROM tblTable t, tblTable t
WHERE t.TableId=t.TableId

Suggested fix:
Query Browser may remember used aliases by putting them in a list. 
And it should generate another alias in case the proposed one exists in the list.
[29 Nov 2004 6:44] Victor Vagin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html