Bug #47367 | Crash in Name_resolution_context::process_error | ||
---|---|---|---|
Submitted: | 16 Sep 2009 12:00 | Modified: | 23 Nov 2010 3:01 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 6.0 | OS: | Any |
Assigned to: | Roy Lyseng | CPU Architecture: | Any |
Tags: | crash, optimizer_switch, semijoin, subquery |
[16 Sep 2009 12:00]
Matthias Leich
[16 Sep 2009 12:03]
Matthias Leich
The workaround is SET GLOBAL optimizer_switch = 'semijoin=off';
[16 Sep 2009 12:09]
Matthias Leich
Non TEMPORARY tables show the same crash.
[11 Dec 2009 11:47]
Roy Lyseng
Crash occurs because Item_field::fix_after_pullout() replaces the current name resolution context object with a partially initialized one - in particular the error_processor field is not set. The fix seems to be fairly easy: Just copy the old value of error_processor. After this fix, the query delivers an error because of an unknown column, which is correct because the original field has been renamed. However, there are two inherent problems in this treatment: 1. The error message text is reported as "Unknown column f1 in where clause". However, the unknown column is not mentioned in the where clause. This problem occurs because resolving columns during second execution operates on the transformed query, where the select value from the subquery now suddenly has become part of the where clause. 2. With semijoin=off, the query does not fail. This is because the column name f1 will now resolve to a column in the table in the outer query, and the query changes semantical meaning. This behaviour is invalid according to the SQL standard (SELECT clause value expressions should only reference columns in underlying tables, not tables in the outer query context).
[11 Dec 2009 13:49]
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/93691 3768 Roy Lyseng 2009-12-11 BUG#47367 Crash in Name_resolution_context::process_error When subquery is transformed into a semijoin, a new name resolution object is assigned for each of the column items of the subquery. The error_processor field of this object was never set, so any error in resolution during second or later execution would cause a crash when this procedure was invoked. mysql-test/r/subselect3.result New test case for bug#47367 mysql-test/r/subselect3_jcl6.result New test case for bug#47367 mysql-test/t/subselect3.test New test case for bug#47367 sql/item.cc Fully initialize the name resolution object when it is created.
[14 Dec 2009 11: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/93893 3769 Roy Lyseng 2009-12-14 BUG#47367 Crash in Name_resolution_context::process_error When subquery is transformed into a semijoin, a new name resolution object is assigned for each of the column items of the subquery. The error_processor field of this object was never set, so any error in resolution during second or later execution would cause a crash when this procedure was invoked. mysql-test/r/subselect3.result New test case for bug#47367 mysql-test/r/subselect3_jcl6.result New test case for bug#47367 mysql-test/t/subselect3.test New test case for bug#47367 sql/item.cc Fully initialize the name resolution object when it is created.
[21 Dec 2009 15:39]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091221153807-80nxoli1tw1z9bxn) (version source revid:roy.lyseng@sun.com-20091214113852-nb7qpsrwa1ekcmyd) (merge vers: 6.0.14-alpha) (pib:15)
[8 Jan 2010 21:21]
Paul DuBois
Noted in 6.0.14 changelog. With semijoin optimization enabled, transformation of a subquery to a semijoin could crash the server if a name resolution error occurred.
[6 May 2010 14:04]
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/107668 3136 Roy Lyseng 2010-05-06 BUG#47367 Crash in Name_resolution_context::process_error When subquery is transformed into a semijoin, a new name resolution object is assigned for each of the column items of the subquery. The error_processor field of this object was never set, so any error in resolution during second or later execution would cause a crash when this procedure was invoked. mysql-test/r/subselect3.result New test case for bug#47367 mysql-test/r/subselect3_jcl6.result New test case for bug#47367 mysql-test/t/subselect3.test New test case for bug#47367 sql/item.cc Fully initialize the name resolution object when it is created.
[16 Aug 2010 6:33]
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:07]
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 3:01]
Paul DuBois
Bug does not appear in any released 5.6.x version. No 5.6.1 changelog entry needed.