From: Mattias Jonsson Date: November 16 2011 3:27pm Subject: bzr push into mysql-trunk branch (mattias.jonsson:3615 to 3616) Bug#11766440 List-Archive: http://lists.mysql.com/commits/141995 X-Bug: 11766440 Message-Id: <201111161527.pAGFRdVN030295@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3616 Mattias Jonsson 2011-11-16 BUG#11766440 - 59546: ASSERTION M_SP == __NULL FAILS IN ITEM_FUNC_SP::INIT_RESULT_FIELD WITH FU Post push patch for fixing the failing partitioning debug tests. Reopen of tables under LOCK TABLES would fail, since an error was already set. Fixed by using a temporary Diagnostics_area during reopen of locked tables. modified: sql/sql_partition.cc 3615 Luis Soares 2011-11-16 [merge] BUG#11760927 Manual merge from mysql-5.5. modified: sql/rpl_rli.cc === modified file 'sql/sql_partition.cc' --- a/sql/sql_partition.cc 2011-08-29 12:08:58 +0000 +++ b/sql/sql_partition.cc 2011-11-16 15:24:04 +0000 @@ -6456,8 +6456,24 @@ static void alter_partition_lock_handlin lpt->table= 0; lpt->old_table= 0; lpt->table_list->table= 0; - if (thd->locked_tables_list.reopen_tables(thd)) - sql_print_warning("We failed to reacquire LOCKs in ALTER TABLE"); + if (thd->locked_tables_mode) + { + Diagnostics_area *stmt_da= NULL; + Diagnostics_area tmp_stmt_da; + + if (thd->is_error()) + { + /* reopen might fail if we have a previous error, use a temporary da. */ + stmt_da= thd->get_stmt_da(); + thd->set_stmt_da(&tmp_stmt_da); + } + + if (thd->locked_tables_list.reopen_tables(thd)) + sql_print_warning("We failed to reacquire LOCKs in ALTER TABLE"); + + if (stmt_da) + thd->set_stmt_da(stmt_da); + } } No bundle (reason: useless for push emails).