Bug #48709 | Assertion failed in sql_select.cc:11782: int join_read_key(JOIN_TAB*) | ||
---|---|---|---|
Submitted: | 12 Nov 2009 0:20 | Modified: | 12 Mar 2010 16:53 |
Reporter: | Patrick Crews | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.0, 5.1 | OS: | Any |
Assigned to: | Georgi Kodinov | CPU Architecture: | Any |
Tags: | crashing bug |
[12 Nov 2009 0:20]
Patrick Crews
[12 Nov 2009 0:21]
Patrick Crews
full crash output (from MTR run of the test case)
Attachment: bug48709_crash_output.txt (text/plain), 12.03 KiB.
[12 Nov 2009 11:40]
Konstantin Osipov
This assertion was introduced by my fix for Bug#41756. It should not affect production, however.
[13 Nov 2009 20:18]
Philip Stoev
my gut feeling is that this is also reproducible with 6.0, just not with the default optimizer settings. If EXPLAIN on the crashing query shows that some optimization is triggered in 6.0, turning this optimization off should cause the assertion to happen in 6.0 as well.
[13 Nov 2009 21:03]
Patrick Crews
When testing against 6.0, the following settings were used - my apologies for neglecting to post these in the initial report: SET GLOBAL OPTIMIZER_SWITCH = 'materialization=off,semijoin=off,loosescan=off,firstmatch=off'; SET GLOBAL optimizer_use_mrr = 'disable'; SET GLOBAL debug = '+d,optimizer_no_icp'; SET GLOBAL engine_condition_pushdown = 1; SET GLOBAL join_cache_level = 1;
[3 Dec 2009 15:52]
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/92706 2859 Georgi Kodinov 2009-12-03 Bug #48709: Assertion failed in sql_select.cc:11782: int join_read_key(JOIN_TAB*) The eq_ref access method TABLE_REF (accessed through JOIN_TAB) to save state and to track if this is the first row it finds or not. This state was not reset on subquery re-execution causing an assert. Fixed by resetting the state before the subquery re-execution.
[3 Dec 2009 15:53]
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/92708 2859 Georgi Kodinov 2009-12-03 Bug #48709: Assertion failed in sql_select.cc:11782: int join_read_key(JOIN_TAB*) The eq_ref access method TABLE_REF (accessed through JOIN_TAB) to save state and to track if this is the first row it finds or not. This state was not reset on subquery re-execution causing an assert. Fixed by resetting the state before the subquery re-execution.
[14 Dec 2009 12:01]
Tor Didriksen
This bug is indeed present in next-mr and 6.0-codebase also. Randgen with subquery_semijoin.yy generates queries which expose this bug. A stripped down example: SELECT BIT_OR( OUTR . `col_time_key` ) AS X FROM C AS OUTR2 LEFT JOIN C AS OUTR ON ( OUTR2 . `col_varchar_nokey` <> OUTR . `col_varchar_nokey` ) WHERE ( OUTR . `col_int_key` , OUTR . `col_int_key` ) IN ( SELECT DISTINCT INNR . `pk` AS X , INNR . `col_int_key` AS Y FROM CC AS INNR WHERE INNR . `col_varchar_key` <= 'z' ) AND OUTR . `col_int_nokey` >= 7 XOR OUTR . `col_date_nokey` = '2007-10-18'
[14 Dec 2009 12:03]
Tor Didriksen
The ASSERT affects only debug builds, but we will get wrong use_count and this affects row locking/unlocking??
[15 Dec 2009 15:58]
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/94175 2822 Georgi Kodinov 2009-12-15 Bug #48709: Assertion failed in sql_select.cc:11782: int join_read_key(JOIN_TAB*) The eq_ref access method TABLE_REF (accessed through JOIN_TAB) to save state and to track if this is the first row it finds or not. This state was not reset on subquery re-execution causing an assert. Fixed by resetting the state before the subquery re-execution.
[15 Dec 2009 16:10]
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/94183 3276 Georgi Kodinov 2009-12-15 Bug #48709: Assertion failed in sql_select.cc:11782: int join_read_key(JOIN_TAB*) The eq_ref access method TABLE_REF (accessed through JOIN_TAB) to save state and to track if this is the first row it finds or not. This state was not reset on subquery re-execution causing an assert. Fixed by resetting the state before the subquery re-execution.
[15 Dec 2009 17:10]
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/94217 2859 Georgi Kodinov 2009-12-15 Bug #48709: Assertion failed in sql_select.cc:11782: int join_read_key(JOIN_TAB*) The eq_ref access method TABLE_REF (accessed through JOIN_TAB) to save state and to track if this is the first row it finds or not. This state was not reset on subquery re-execution causing an assert. Fixed by resetting the state before the subquery re-execution.
[15 Dec 2009 17:11]
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/94219 2822 Georgi Kodinov 2009-12-15 Bug #48709: Assertion failed in sql_select.cc:11782: int join_read_key(JOIN_TAB*) The eq_ref access method TABLE_REF (accessed through JOIN_TAB) to save state and to track if this is the first row it finds or not. This state was not reset on subquery re-execution causing an assert. Fixed by resetting the state before the subquery re-execution.
[19 Dec 2009 8:29]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091219082307-f3i4fn0tm8trb3c0) (version source revid:alik@sun.com-20091216180721-eoa754i79j4ssd3m) (merge vers: 6.0.14-alpha) (pib:15)
[19 Dec 2009 8:33]
Bugs System
Pushed into 5.5.1-m2 (revid:alik@sun.com-20091219082021-f34nq4jytwamozz0) (version source revid:alexey.kopytov@sun.com-20091216134707-o96eqw0u2ynvo9gm) (merge vers: 5.5.0-beta) (pib:15)
[19 Dec 2009 8:37]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20091219082213-nhjjgmphote4ntxj) (version source revid:alik@sun.com-20091216180221-a5ps59gajad3pip9) (pib:15)
[14 Jan 2010 8:27]
Bugs System
Pushed into 5.0.90 (revid:joro@sun.com-20100114082402-05fod2h6z9x9wok8) (version source revid:joro@sun.com-20091215171006-60wvk91kktlhviit) (merge vers: 5.0.89) (pib:16)
[15 Jan 2010 9:01]
Bugs System
Pushed into 5.1.43 (revid:joro@sun.com-20100115085139-qkh0i0fpohd9u9p5) (version source revid:joro@sun.com-20091216090324-hh91ouoj4gxk12eq) (merge vers: 5.1.42) (pib:16)
[16 Jan 2010 1:51]
Paul DuBois
Noted in 5.0.90, 5.1.43, 5.5.1, 6.0.14 changelogs. Incomplete reset of internal TABLE structures could cause a crash with eq_ref table access in subqueries. Setting report to NDI pending push to Celosia.
[12 Mar 2010 14:15]
Bugs System
Pushed into 5.1.44-ndb-7.0.14 (revid:jonas@mysql.com-20100312135944-t0z8s1da2orvl66x) (version source revid:jonas@mysql.com-20100312115609-woou0te4a6s4ae9y) (merge vers: 5.1.44-ndb-7.0.14) (pib:16)
[12 Mar 2010 14:31]
Bugs System
Pushed into 5.1.44-ndb-6.2.19 (revid:jonas@mysql.com-20100312134846-tuqhd9w3tv4xgl3d) (version source revid:jonas@mysql.com-20100312060623-mx6407w2vx76h3by) (merge vers: 5.1.44-ndb-6.2.19) (pib:16)
[12 Mar 2010 14:47]
Bugs System
Pushed into 5.1.44-ndb-6.3.33 (revid:jonas@mysql.com-20100312135724-xcw8vw2lu3mijrhn) (version source revid:jonas@mysql.com-20100312103652-snkltsd197l7q2yg) (merge vers: 5.1.44-ndb-6.3.33) (pib:16)
[12 Mar 2010 16:53]
Paul DuBois
Fixed in earlier 5.1.x, 5.5.x.