Bug #44303 | Assertion failures in Field_xxx::store_xxx for materialized InsideOut semijoins | ||
---|---|---|---|
Submitted: | 16 Apr 2009 1:55 | Modified: | 20 Nov 2010 23:21 |
Reporter: | Elena Stepanova | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S1 (Critical) |
Version: | 6.0.10-debug, 6.0.12-debug, 5.4.4-alpha-debug | OS: | Any |
Assigned to: | Øystein Grøvlen | CPU Architecture: | Any |
Tags: | optimizer_switch, semijoin, subquery |
[16 Apr 2009 1:55]
Elena Stepanova
[14 Jul 2009 22:24]
Patrick Crews
The optimizer_switch, optimizer_use_mrr, and engine_condition_pushdown variable settings did not affect this crash (present regardless of their values)
[16 Sep 2009 7:18]
Roy Lyseng
This bug goes away when semijoin is turned off: set @@optimizer_switch='default,semijoin=off';
[25 Sep 2009 6:54]
Øystein Grøvlen
Same core dump for the following query (without aggregation): SELECT * FROM tb1 WHERE (f1,f3) IN (SELECT f1,f3 FROM tmp1); From inspecting the core dump, it seems one tries to update fields of tmp1 while scanning the materialization earlier made of tmp1. Strange ... Query plan: mysql> explain SELECT * FROM tb1 WHERE (f1,f3) IN (SELECT f1,f3 FROM tmp1)\G *************************** 1. row *************************** id: 1 select_type: PRIMARY table: tmp1 type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 2 Extra: Materialize; Scan *************************** 2. row *************************** id: 1 select_type: PRIMARY table: tb1 type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 3 Extra: Using where; Using join buffer 2 rows in set (0.00 sec)
[25 Sep 2009 9:13]
Øystein Grøvlen
I realized, with the help of Evgeny, that fields of tmp1 is not actually updated, it is the record buffer for tmp1 that is updated. As described in a comment in setup_sj_materialization(), this is done since the join condition refers to the current row of tmp1. Hence, the content of the temp table is copied back into the record buffer. The problem is that the write_set of tmp1 is not set up to accept writes to the record buffer. Hence, the failing assert.
[25 Sep 2009 12:15]
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/84643 2840 oystein.grovlen@sun.com 2009-09-25 Bug#44303 Assertion failures in Field_new_decimal::store_decimal when executing materialized InsideOut semijoin When inner tables of semijoin is materialized, field values are copied back from the materialized table to the record buffer of the source tables. The problem was that the write_set of the source tables were not set up to allow such copying. @ mysql-test/r/subselect_mat.result Update result file with new test case for Bug#44303. @ mysql-test/t/subselect_mat.test Test for Bug#44303. A semijoin where InsideOut strategy with materialization of inner table is used. @ sql/sql_select.cc setup_sj_materialization(): If field values are to be copied back from a materialized table to the record buffer of source tables, set write_set for source tables so that this copying is allowed. Fixed some comments to make it clear that the source tables are not actually updated, just the record buffers.
[29 Sep 2009 10: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/84971 3626 oystein.grovlen@sun.com 2009-09-29 Bug#44303 Assertion failures in Field_new_decimal::store_decimal when executing materialized InsideOut semijoin When inner tables of semijoin is materialized, field values are copied back from the materialized table to the record buffer of the source tables. The problem was that the write_set of the source tables were not set up to allow such copying. @ mysql-test/r/subselect_mat.result Update result file with new test case for Bug#44303. @ mysql-test/suite/ndb/t/ndb_read_multi_range.test Re-enable this test for Mac platform. (Bug#42979 is a duplicate of this bug) @ mysql-test/t/subselect_mat.test Test for Bug#44303. A semijoin where InsideOut strategy with materialization of inner table is used. @ sql/sql_select.cc setup_sj_materialization(): If field values are to be copied back from a materialized table to the record buffer of source tables, set write_set for source tables so that this copying is allowed. Fixed some comments to make it clear that the source tables are not actually updated, just the record buffers.
[5 Oct 2009 15:39]
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/85780 3643 oystein.grovlen@sun.com 2009-10-05 Bug#44303 Assertion failures in Field_new_decimal::store_decimal when executing materialized InsideOut semijoin When inner tables of semijoin is materialized, field values are copied back from the materialized table to the record buffer of the source tables. The problem was that the write_set of the source tables were not set up to allow such copying. @ mysql-test/r/subselect_mat.result Update result file with new test case for Bug#44303. @ mysql-test/suite/ndb/t/ndb_read_multi_range.test Re-enable this test for Mac platform. (Bug#42979 is a duplicate of this bug) @ mysql-test/t/subselect_mat.test Test for Bug#44303. A semijoin where InsideOut strategy with materialization of inner table is used. @ sql/sql_select.cc setup_sj_materialization(): If field values are to be copied back from a materialized table to the record buffer of source tables, set write_set for source tables so that this copying is allowed. Fixed some comments to make it clear that the source tables are not actually updated, just the record buffers.
[6 Oct 2009 16:32]
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/85941 3645 oystein.grovlen@sun.com 2009-10-06 Bug#44303 Assertion failures in Field_new_decimal::store_decimal when executing materialized InsideOut semijoin When inner tables of semijoin is materialized, field values are copied back from the materialized table to the record buffer of the source tables. The problem was that the write_set of the source tables were not set up to allow such copying. @ mysql-test/r/subselect_mat.result Update result file with new test case for Bug#44303. @ mysql-test/suite/ndb/t/ndb_read_multi_range.test Re-enable this test for Mac platform. (Bug#42979 is a duplicate of this bug) @ mysql-test/t/subselect_mat.test Test for Bug#44303. A semijoin where InsideOut strategy with materialization of inner table is used. @ sql/sql_select.cc setup_sj_materialization(): If field values are to be copied back from a materialized table to the record buffer of source tables, set write_set for source tables so that this copying is allowed. Fixed some comments to make it clear that the source tables are not actually updated, just the record buffers.
[9 Oct 2009 9:36]
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/86315 3652 oystein.grovlen@sun.com 2009-10-09 Bug#44303 Assertion failures in Field_new_decimal::store_decimal when executing materialized InsideOut semijoin When inner tables of semijoin is materialized, field values are copied back from the materialized table to the record buffer of the source tables. The problem was that the write_set of the source tables were not set up to allow such copying. @ mysql-test/r/subselect_mat.result Update result file with new test case for Bug#44303. @ mysql-test/suite/ndb/t/ndb_read_multi_range.test Re-enable this test for Mac platform. (Bug#42979 is a duplicate of this bug) @ mysql-test/t/subselect_mat.test Test for Bug#44303. A semijoin where InsideOut strategy with materialization of inner table is used. @ sql/sql_select.cc setup_sj_materialization(): If field values are to be copied back from a materialized table to the record buffer of source tables, set write_set for source tables so that this copying is allowed. Fixed some comments to make it clear that the source tables are not actually updated, just the record buffers.
[9 Oct 2009 14:07]
Øystein Grøvlen
Patch pushed to mysql-6.0-codebase-bugfixing. revid:oystein.grovlen@sun.com-20091009093541-7bkrgk2tsnpi6iyf
[31 Oct 2009 8:18]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091031081410-qkxmjsdzjmj840aq) (version source revid:guilhem@mysql.com-20091010123356-qfouds7ucvkvbczt) (merge vers: 6.0.14-alpha) (pib:13)
[2 Nov 2009 21:11]
Paul DuBois
Noted in 6.0.14 changelog. Improper materialization of semijoin inner tables could cause an assertion failure.
[6 Apr 2010 11:26]
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/105064 3060 oystein.grovlen@sun.com 2010-04-06 Bug#44303 Assertion failures in Field_new_decimal::store_decimal when executing materialized InsideOut semijoin (Backporting of revid:oystein.grovlen@sun.com-20091009093541-7bkrgk2tsnpi6iyf) When inner tables of semijoin is materialized, field values are copied back from the materialized table to the record buffer of the source tables. The problem was that the write_set of the source tables were not set up to allow such copying. @ mysql-test/r/subselect_mat.result Update result file with new test case for Bug#44303. @ mysql-test/t/subselect_mat.test Re-enable this test for Mac platform. (Bug#42979 is a duplicate of this bug) @ sql/sql_select.cc setup_sj_materialization(): If field values are to be copied back from a materialized table to the record buffer of source tables, set write_set for source tables so that this copying is allowed. Fixed some comments to make it clear that the source tables are not actually updated, just the record buffers.
[6 Apr 2010 11:55]
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/105068 3060 oystein.grovlen@sun.com 2010-04-06 Bug#44303 Assertion failures in Field_new_decimal::store_decimal when executing materialized InsideOut semijoin (Backporting of revid:oystein.grovlen@sun.com-20091009093541-7bkrgk2tsnpi6iyf) When inner tables of semijoin is materialized, field values are copied back from the materialized table to the record buffer of the source tables. The problem was that the write_set of the source tables were not set up to allow such copying. @ mysql-test/r/subselect_mat.result Update result file with new test case for Bug#44303. @ mysql-test/t/subselect_mat.test Test for Bug#44303. A semijoin where InsideOut strategy with materialization of inner table is used. @ sql/sql_select.cc setup_sj_materialization(): If field values are to be copied back from a materialized table to the record buffer of source tables, set write_set for source tables so that this copying is allowed. Fixed some comments to make it clear that the source tables are not actually updated, just the record buffers.
[16 Aug 2010 6:38]
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:25]
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:21]
Paul DuBois
Noted in 5.6.1 changelog.
[23 Nov 2010 2:12]
Paul DuBois
Correction: No 5.6.1 changelog entry. Bug does not appear in any released 5.6.x version.