List:General Discussion« Previous MessageNext Message »
From:Haksun Li Date:November 30 2002 11:52pm
Subject:mysql join problem (bug?)
View as plain text  
Hi all,

 

I found this join problem using mysql 3.23.53-max-nt (on WinXP).

It works fine on MySQL 3.23.52-log (on Linux).

 

Could someone please confirm that it is a bug? Or enlighten me on
writing the correct sql?

 

I have a table and data as shown in the script below.

 

 

CREATE TABLE test (

  f1 int(11) NOT NULL default '0',

  f2 int(11) NOT NULL default '0'

) TYPE=MyISAM;

 

#

# Dumping data for table `test`

#

 

INSERT INTO test VALUES (1, 2);

INSERT INTO test VALUES (1, 4);

 

 

Then I do a join with this query:

 

SELECT t1.*, t2.* from test as t1, test as t2 where t1.f1 = t2.f1

 

Unfortuantley, I got this output.

 

 

f1  f2  f1  f2  

1 2 1 2 

1 2 1 2 

1 4 1 4 

1 4 1 4 

 

 

 

I would expect the output like this (which I get on Linux using MySQL
3.23.52-log). I also get this using other DB (e.g. Access).

 

f1  f2  f1  f2  

1 2 1 2 

1 4 1 2 

1 2 1 4 

1 4 1 4 

 

 

Does anyone else experience the same problem?

 

Thanks.

 

Haksun

 


Thread
mysql join problem (bug?)Haksun Li1 Dec
  • Re: mysql join problem (bug?)DL Neil1 Dec
    • RE: mysql join problem (bug?)Haksun Li2 Dec
      • Re: mysql join problem (bug?)DL Neil2 Dec