Bug #2089 | subquery's in where clause returning incorrect results | ||
---|---|---|---|
Submitted: | 11 Dec 2003 1:41 | Modified: | 17 Jan 2004 5:52 |
Reporter: | Murray Steele | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1.1 | OS: | Windows (Windows, Solaris) |
Assigned to: | Oleksandr Byelkin | CPU Architecture: | Any |
[11 Dec 2003 1:41]
Murray Steele
[15 Dec 2003 1:30]
Igor Blagodetelev
Is my example simpler belong to this problem too? Version: 4.1.1-alpha-max-log OS: Slackware 9.1 mysql> create table test1 (id int not null auto_increment, value char(255), primary key(id)) type=InnoDB; Query OK, 0 rows affected (0.03 sec) mysql> create table test2 (id int not null auto_increment, value char(255), primary key(id)) type=InnoDB; Query OK, 0 rows affected (0.01 sec) mysql> insert into test1 values (1,'a'); Query OK, 1 row affected (0.04 sec) mysql> insert into test1 values (2,'b'); Query OK, 1 row affected (0.00 sec) mysql> insert into test1 values (3,'c'); Query OK, 1 row affected (0.00 sec) mysql> insert into test2 values (1,'z'); Query OK, 1 row affected (0.00 sec) mysql> insert into test2 values (2,'x'); Query OK, 1 row affected (0.00 sec) mysql> insert into test2 values (3,'y'); Query OK, 1 row affected (0.00 sec) mysql> select * from test1; +----+-------+ | id | value | +----+-------+ | 1 | a | | 2 | b | | 3 | c | +----+-------+ 3 rows in set (0.00 sec) mysql> select * from test2; +----+-------+ | id | value | +----+-------+ | 1 | z | | 2 | x | | 3 | y | +----+-------+ 3 rows in set (0.00 sec) mysql> select test2.id,test2.value,(select test1.value from test1 where test1.id=test2.id) from test2; I think that this result is WRONG (because I run this test on Oracle and get other result). +----+-------+---------------------------------------------------------+ | id | value | (select test1.value from test1 where test1.id=test2.id) | +----+-------+---------------------------------------------------------+ | 1 | z | a | | 2 | x | NULL | | 3 | y | NULL | +----+-------+---------------------------------------------------------+ 3 rows in set (0.00 sec) Should be: 1 z a 2 x b 3 y c
[2 Jan 2004 14:19]
Oleksandr Byelkin
ChangeSet 1.1674 04/01/03 00:12:07 bell@sanja.is.com.ua +12 -0 removed droping field->query_id for reinitialization tables for subquery. (BUG#2089)
[17 Jan 2004 5:52]
Oleksandr Byelkin
Thank you for bugreport. Bug is fixed now in pour source repository