Bug #5603 JOIN and LEFT OUTER JOIN button doesn't work when building a query visually
Submitted: 16 Sep 2004 1:45 Modified: 1 Dec 2004 13:48
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.0.7-beta OS:Windows (Win XP / SP2)
Assigned to: Michael G. Zinner CPU Architecture:Any

[16 Sep 2004 1:45] Shuichi Tamagawa
Description:
'JOIN table(s)' and 'LEFT OUTER JOIN' button in the table tool doesn't work when building a query visually. According to the manual it says "if a SELECT query is already in the query box, with a table in it, the new dragged table will be added and the appropriate WHERE clauses to perform a JOIN will be added". However, the result of drag & drop on 'JOIN table(s)' button (also 'LEFT OUTER JOIN') is the same as 'Add table(s)'.

#Holding the Shift key while dragging (JOIN) and holding the Ctrl key while dragging (LEFT OUTER JOIN) doesn't work, either.

How to repeat:
#prepare test data
create table testa(a int);
create table testb(a int);
insert into testa values(1),(2),(3);
insert into testb values(1),(2);

#from Query Browser
double click on the table 'testa'
drag the table 'testb' and drop it on 'Join table(s)' button in the table tool
-> produces 'SELECT * FROM testa t, testb b'
double click on the table 'testa'
drag the table 'testb' and drop it on 'LEFT OUTER JOIN' button in the table tool
-> produces 'SELECT * FROM testa t, testb b'
[16 Sep 2004 16:58] Michael G. Zinner
Are you using InnoDB tables with a correct FK definition?

Are you using MyISAM tables where the FK column(s) is (/are) named exactly like the PK columns of the master table?

Otherwise a join / left outer join is not possible.
[17 Sep 2004 2:41] Shuichi Tamagawa
I'm using MyISAM table. And the columns used to JOIN the two table have exactly the same name 'a'.

I thought identical column names are the requirement to JOIN the table, but It seems that either one of the two table must have primary key. After adding primary key to the one table, it works fine. It would be nice if this is on the manual.

#I confirmed that it works fine when using InnoDB with foreign Key.