Bug #1848 | using subselect in IN(..) to query indirect one-to-many relationship goes wrong | ||
---|---|---|---|
Submitted: | 15 Nov 2003 23:31 | Modified: | 17 Nov 2003 2:34 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.0-alpha | OS: | Windows (Windows 2000) |
Assigned to: | Oleksandr Byelkin | CPU Architecture: | Any |
[15 Nov 2003 23:31]
[ name withheld ]
[16 Nov 2003 13:10]
Oleksandr Byelkin
I can't repeat this bug: + CREATE TABLE `a` (`id` int(11) NOT NULL default '0',`b_id` int(11) default NULL,PRIMARY KEY (`id`)); + CREATE TABLE `b` (`id` int(11) NOT NULL default '0',PRIMARY KEY (`id`)); + CREATE TABLE `b_c` (`b_id` int(11) NOT NULL default '0',`c` int(11) NOT NULL default '0'); + insert into a values (1, 101),(2, 102); + insert into b values (101),(102); + insert into b_c values (101, 11),(101, 13),(102, 12); + select a.id from a, b where a.b_id=b.id and 11 in (select c from b_c where b_id=b.id); + id + 1 + select a.id from a, b where a.b_id=b.id and 12 in (select c from b_c where b_id=b.id); + id + 2 + select a.id from a, b where a.b_id=b.id and 13 in (select c from b_c where b_id=b.id); + id + 1 Which version of serever you used for testing?
[16 Nov 2003 17:47]
[ name withheld ]
I installed and run tests on the 4.0.1-alpha for Win32.
[16 Nov 2003 17:48]
[ name withheld ]
Sorry, it's 4.1.0-alpha, not 4.0.1-alpha.
[17 Nov 2003 2:34]
Oleksandr Byelkin
thus it looks like bug is fixed in current repository of 4.1