From 317e04ce67d97ab4a11582236f1e46ccf25c94fb Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sun, 22 May 2011 15:47:46 -0700 Subject: [PATCH] Fixed 2 valgrind bugs in the tree for mwl #106. One was due the fact that the field SELECT_LEX::insert_tables was not initialized while the second was due to missing initialization of JOIN_TAB::preread_init_done in subselect_hash_sj_engine::make_unique_engine. Removed an invalid assert. --- sql/item_subselect.cc | 1 + sql/sql_lex.cc | 1 + sql/table.cc | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 9855251d404..f1aa2eb48ec 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -4165,6 +4165,7 @@ subselect_hash_sj_engine::make_unique_engine() DBUG_RETURN(NULL); tab->table= tmp_table; + tab->preread_init_done= FALSE; tab->ref.tmp_table_index_lookup_init(thd, tmp_key, it, FALSE); DBUG_RETURN(new subselect_uniquesubquery_engine(thd, tab, item, diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index e66ffe3265e..745a805d992 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1672,6 +1672,7 @@ void st_select_lex::init_select() cond_value= having_value= Item::COND_UNDEF; inner_refs_list.empty(); full_group_by_flag= 0; + insert_tables= 0; merged_into= 0; } diff --git a/sql/table.cc b/sql/table.cc index 898a42044d7..290a82eb56a 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3797,7 +3797,6 @@ bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type) if (where) { - DBUG_ASSERT(where->fixed); check_option= where->copy_andor_structure(thd); } if (is_cascaded)