From 148587461954b544355bc808a89bfed1a70694e1 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 11 Dec 2011 18:39:33 +0200 Subject: Rewrite IGNORE handling: - Instead of supressing all errors, only suppress safe ones like: ER_DUP_KEY, ER_BAD_NULL_ERROR, ER_SUBQUERY_NO_1_ROW, ER_ROW_IS_REFERENCED_2 --- sql/sql_class.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ecd87b554e7..a0ed1cdc83f 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2585,7 +2585,8 @@ int select_singlerow_subselect::send_data(List &items) Item_singlerow_subselect *it= (Item_singlerow_subselect *)item; if (it->assigned()) { - my_message(ER_SUBQUERY_NO_1_ROW, ER(ER_SUBQUERY_NO_1_ROW), MYF(0)); + my_message(ER_SUBQUERY_NO_1_ROW, ER(ER_SUBQUERY_NO_1_ROW), + MYF(current_thd->lex->ignore ? ME_JUST_WARNING : 0)); DBUG_RETURN(1); } if (unit->offset_limit_cnt) @@ -3830,16 +3831,6 @@ void mark_transaction_to_rollback(THD *thd, bool all) { thd->is_fatal_sub_stmt_error= TRUE; thd->transaction_rollback_request= all; - /* - Aborted transactions can not be IGNOREd. - Switch off the IGNORE flag for the current - SELECT_LEX. This should allow my_error() - to report the error and abort the execution - flow, even in presence - of IGNORE clause. - */ - if (thd->lex->current_select) - thd->lex->current_select->no_error= FALSE; } } /*************************************************************************** -- cgit v1.2.1 From ed3e19aca84d40ee191da8e817994df2e6831abc Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Wed, 14 Dec 2011 15:33:43 +0200 Subject: Bug#13437900 - VALGRIND REPORTS A LEAK FOR REPL_IGNORE_SERVER_IDS There was memory leak when running some tests on PB2. The reason of the failure is an early return from change_master() that was supposed to deallocate a dyn-array. Actually the same bug58915 was fixed in trunk with relocating the dyn-array destruction into THD::cleanup_after_query() which can't be bypassed. The current patch backports magne.mahre@oracle.com-20110203101306-q8auashb3d7icxho and adds two optimizations: were done: the static buffer for the dyn-array to base on, and the array initialization is called precisely when it's necessary rather than per each CHANGE-MASTER as before. mysql-test/suite/rpl/t/rpl_empty_master_host.test: the test is binlog-format insensitive so it will be run with MIXED mode only. mysql-test/suite/rpl/t/rpl_server_id_ignore.test: the test is binlog-format insensitive so it will be run with MIXED mode only. sql/sql_class.cc: relocating the dyn-array destruction into THD::cleanup_after_query(). sql/sql_lex.cc: LEX.mi zero initialization is done in LEX(). sql/sql_lex.h: Optimization for repl_ignore_server_ids to base on a static buffer which size is chosen to fit to most common use cases. sql/sql_repl.cc: dyn-array destruction is relocated to THD::cleanup_after_query(). sql/sql_yacc.yy: Refining logics of Lex->mi.repl_ignore_server_ids initialization. The array is initialized once a corresponding option in CHANGE MASTER token sequence is found. --- sql/sql_class.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9b5772d3d07..a644729961c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1673,6 +1673,11 @@ void THD::cleanup_after_query() /* reset table map for multi-table update */ table_map_for_update= 0; m_binlog_invoker= FALSE; + /* reset replication info structure */ + if (lex && lex->mi.repl_ignore_server_ids.buffer) + { + delete_dynamic(&lex->mi.repl_ignore_server_ids); + } } -- cgit v1.2.1