Bug #46550 | Azalea returning duplicate results for some IN subqueries w/ semijoin=on | ||
---|---|---|---|
Submitted: | 4 Aug 2009 16:54 | Modified: | 23 Nov 2010 2:54 |
Reporter: | Patrick Crews | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 6.0 | OS: | Any |
Assigned to: | Tor Didriksen | CPU Architecture: | Any |
Tags: | IN, optimizer_switch, semijoin, subquery |
[4 Aug 2009 16:54]
Patrick Crews
[10 Nov 2009 10:18]
Tor Didriksen
The second query has a different symptom, and is not the same bug as the first one. The first query generates duplicates, because we use a wrong execution plan (one which does not remove duplicates). The second query generates an empty result. Splitting this into two separate bugs.
[10 Nov 2009 14:44]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/89969 3703 Tor Didriksen 2009-11-10 Bug#46550 Azalea returning duplicate results for some IN subqueries w/ semijoin=on The optimizer was choosing an illegal plan for FirstMatch. Added an explicit check that the join prefix satisfies this pattern: (ot|nt)* [ it ((it|nt)* it) ] (nt)* @ mysql-test/r/subselect_sj.result Add test case. @ mysql-test/r/subselect_sj_jcl6.result Add test case. @ mysql-test/t/subselect_sj.test Add test case. @ sql/sql_select.cc Added an explicit check that the join prefix satisfies this pattern: (ot|nt)* [ it ((it|nt)* it) ] (nt)* Some cosmetics for readability and coding style compliance. @ sql/sql_select.h Make sj_strategy private, with getter and setter.
[12 Nov 2009 12:41]
Tor Didriksen
Actually, the second query here looks similar to http://bugs.mysql.com/bug.php?id=46556 Azalea returning incorrect, empty results for some IN subqueries w/ semijoin=on
[13 Nov 2009 11:41]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/90338 3711 Tor Didriksen 2009-11-13 Bug#46550 Azalea returning duplicate results for some IN subqueries w/ semijoin=on The optimizer was choosing an illegal plan for FirstMatch. Added an explicit check that the join prefix satisfies this pattern: (ot|nt)* [ it ((it|nt)* it) ] (nt)* @ mysql-test/r/subselect_sj.result Add test case. @ mysql-test/r/subselect_sj_jcl6.result Add test case. @ mysql-test/t/subselect_sj.test Add test case. @ sql/sql_select.cc Added an explicit check that the join prefix satisfies this pattern: (ot|nt)* [ it ((it|nt)* it) ] (nt)* Some cosmetics for readability and coding style compliance.
[13 Nov 2009 14:00]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/90361 3713 Tor Didriksen 2009-11-13 Bug#46550 Azalea returning duplicate results for some IN subqueries w/ semijoin=on The optimizer was choosing an illegal plan for FirstMatch. Added an explicit check that the join prefix satisfies this pattern: (ot|nt)* [ it ((it|nt)* it) ] (nt)* @ mysql-test/r/subselect_sj.result Add test case. @ mysql-test/r/subselect_sj_jcl6.result Add test case. @ mysql-test/t/subselect_sj.test Add test case. @ sql/sql_select.cc Added an explicit check that the join prefix satisfies this pattern: (ot|nt)* [ it ((it|nt)* it) ] (nt)* Some cosmetics for readability and coding style compliance.
[17 Nov 2009 10:12]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/90635 3712 Tor Didriksen 2009-11-17 Bug#46550 Azalea returning duplicate results for some IN subqueries w/ semijoin=on The optimizer was choosing an illegal plan for FirstMatch. Add an explicit check that all inner tables are part of 'remaining_tables' when we initiate the FirstMatch algorithm. @ mysql-test/r/subselect_sj.result Add test case. @ mysql-test/r/subselect_sj_jcl6.result Add test case. @ mysql-test/t/subselect_sj.test Add test case. @ sql/sql_select.cc Add an explicit check that all inner tables are part of 'remaining_tables' when we initiate the FirstMatch algorithm. Some cosmetics for readability and coding style compliance.
[19 Nov 2009 14:38]
Tor Didriksen
Pushed to: bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-codebase-bugfixing/ revision-id: tor.didriksen@sun.com-20091117101207-y3779rzw50cm2emc
[20 Nov 2009 12:56]
Bugs System
Pushed into 6.0.14-alpha (revid:kostja@sun.com-20091120124947-yi6h2jbgw0kbciwm) (version source revid:tor.didriksen@sun.com-20091117101207-y3779rzw50cm2emc) (merge vers: 6.0.14-alpha) (pib:13)
[23 Nov 2009 20:14]
Paul DuBois
Noted in 6.0.14 changelog. With semijoin optimization enabled, the optimizer sometimes chose an illegal execution plan for the FirstMatch strategy, resulting in duplicate values from IN subqueries.
[13 Apr 2010 14:01]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/105520 3072 Tor Didriksen 2010-04-13 Bug#46550 Azalea returning duplicate results for some IN subqueries w/ semijoin=on Backport of tor.didriksen@sun.com-20091117101207-y3779rzw50cm2emc The optimizer was choosing an illegal plan for FirstMatch. Add an explicit check that all inner tables are part of 'remaining_tables' when we initiate the FirstMatch algorithm. @ mysql-test/r/subselect_sj.result Add test case. @ mysql-test/t/subselect_sj.test Add test case. @ sql/sql_select.cc Add an explicit check that all inner tables are part of 'remaining_tables' when we initiate the FirstMatch algorithm. . Some cosmetics for readability and coding style compliance.
[16 Aug 2010 6:34]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100816062819-bluwgdq8q4xysmlg) (version source revid:alik@sun.com-20100816062612-enatdwnv809iw3s9) (pib:20)
[13 Nov 2010 16:23]
Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:vasil.dimov@oracle.com-20100629074804-359l9m9gniauxr94) (merge vers: 5.6.99-m4) (pib:21)
[23 Nov 2010 2:54]
Paul DuBois
Bug does not appear in any released 5.6.x version. No 5.6.1 changelog entry needed.