Bug #37899 | Assertion in net_end_statement() on a query containing XOR | ||
---|---|---|---|
Submitted: | 6 Jul 2008 7:33 | Modified: | 20 Nov 2010 23:10 |
Reporter: | Philip Stoev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S1 (Critical) |
Version: | 6.0 | OS: | Any |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
[6 Jul 2008 7:33]
Philip Stoev
[7 Jul 2008 18:48]
Philip Stoev
Here is a simple test case. In other words, every subquery with an XOR is probably affected: CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, `varchar_key` varchar(5) DEFAULT NULL, `varchar_nokey` varchar(5) DEFAULT NULL, PRIMARY KEY (`pk`), KEY `varchar_key` (`varchar_key`) ); INSERT INTO t1 VALUES (1,'qk','qk'),(2,'j','j'),(3,'aew','aew'),(4,NULL,NULL),(5,'qu','qu'); SELECT * FROM t1 WHERE varchar_key IN ( SELECT varchar_nokey FROM t1 ) XOR pk = 30;
[9 Jul 2008 14:34]
Sergey Petrunya
Need to check if this is same as BUG#36135. BUG#36135 is "Patch approved" so it's possible to check with little effort.
[9 Jul 2008 16:12]
Philip Stoev
Setting to Open so that the bug verification team can check previous releases.
[10 Jul 2008 14:13]
Susanne Ebrecht
Please check like Sergei suggested and let us know if the patch will fix your issue.
[10 Jul 2008 16:22]
Sveta Smirnova
Applied patch, located at http://lists.mysql.com/commits/46131, to 6.0 tree, mysqld crashed in same place. Bug is not repeatabel with version 5.0 and 5.1.
[2 Oct 2008 21:45]
Konstantin Osipov
This is an optimizier bug. replace_where_subcondition() returns TRUE without setting an error in THD. After that flatten_subqueries() returns TRUE. Neither of the branches of the function work, and we reach this: return TRUE; } Which returns error without setting a message in THD.
[7 Oct 2008 19:45]
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/55623 2853 Evgeny Potemkin 2008-10-07 Bug#37899: Wrongly checked optimization prerequisite caused failed assertion. One of the prerequisites for subquery optimizations is that the subquery predicate should be a top-level item or under a top-level AND item in the WHERE expression. XOR function was wrongly allowed for top-level function for the subquery optimization thus causing an internal error and failed assertion later. The Item_cond::fix_fields function now allow only the AND function as a top-level item for subquery optimization. Added an assertion at the end of the replace_where_subcondition function to catch such errors.
[10 Nov 2008 10:52]
Bugs System
Pushed into 6.0.8-alpha (revid:epotemkin@mysql.com-20081008092802-2mru3ax0t9s1kjgv) (version source revid:epotemkin@mysql.com-20081008092802-2mru3ax0t9s1kjgv) (pib:5)
[11 Nov 2008 16:08]
Paul DuBois
The version is actually 6.0.9.
[11 Nov 2008 23:48]
Paul DuBois
Noted in 6.0.9 changelog. An incorrectly checked XOR subquery optimization resulted in an assertion failure.
[16 Aug 2010 6:40]
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:09]
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)
[20 Nov 2010 23:10]
Paul DuBois
Noted in 5.6.1 changelog.