From: Roy Lyseng Date: January 10 2011 1:59pm Subject: Re: bzr commit into mysql-5.1 branch (jan.wedvik:3477) Bug#58553 List-Archive: http://lists.mysql.com/commits/128306 Message-Id: <4D2B10C5.4050203@oracle.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------090601030903010704050401" --------------090601030903010704050401 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Jan, thank you for fixing this problem. The fix is approved for inclusion in 5.1 and upwards. Approved without test case as this occurs with NDB only, and the NDB test suite has been removed. For 5.5 and trunk, the change to open_table() (a DBUG_ASSERT is added) may perhaps be removed, as this code has been changed significantly. Thanks, Roy On 29.11.10 13.46, Jan Wedvik wrote: > #At file:///net/atum17/export/home2/tmp/jw159207/mysql/repo/mysql-5.1/ based on revid:georgi.kodinov@stripped > > 3477 Jan Wedvik 2010-11-29 > Fix for bug#58553, "Queries with pushed conditions causes 'explain extended' > to crash mysqld". > > handler::pushed_cond was not always properly reset when table objects where > recycled via the table cache. > > handler::pushed_cond is now set to NULL in handler::ha_reset(). This should > prevent pushed conditions from (incorrectly) re-apperaring in later queries. > > modified: > sql/handler.cc > sql/sql_base.cc > sql/sql_select.cc > === modified file 'sql/handler.cc' > --- a/sql/handler.cc 2010-10-18 11:24:34 +0000 > +++ b/sql/handler.cc 2010-11-29 12:45:55 +0000 > @@ -4639,6 +4639,7 @@ int handler::ha_reset() > free_io_cache(table); > /* reset the bitmaps to point to defaults */ > table->default_column_bitmaps(); > + pushed_cond= NULL; > DBUG_RETURN(reset()); > } > > > === modified file 'sql/sql_base.cc' > --- a/sql/sql_base.cc 2010-10-11 03:08:49 +0000 > +++ b/sql/sql_base.cc 2010-11-29 12:45:55 +0000 > @@ -2993,6 +2993,11 @@ TABLE *open_table(THD *thd, TABLE_LIST * > table->insert_values= 0; > table->fulltext_searched= 0; > table->file->ft_handler= 0; > + /* > + Check that there is no reference to a condtion from an earlier query > + (cf. Bug#58553). > + */ > + DBUG_ASSERT(table->file->pushed_cond == NULL); > table->reginfo.impossible_range= 0; > /* Catch wrong handling of the auto_increment_field_not_null. */ > DBUG_ASSERT(!table->auto_increment_field_not_null); > > === modified file 'sql/sql_select.cc' > --- a/sql/sql_select.cc 2010-10-29 08:23:06 +0000 > +++ b/sql/sql_select.cc 2010-11-29 12:45:55 +0000 > @@ -6375,7 +6375,6 @@ make_join_select(JOIN *join,SQL_SELECT * > tab->select_cond=sel->cond=tmp; > /* Push condition to storage engine if this is enabled > and the condition is not guarded */ > - tab->table->file->pushed_cond= NULL; > if (thd->variables.engine_condition_pushdown) > { > COND *push_cond= > > > > --------------090601030903010704050401--