Commit d292b57e authored by Tor Didriksen's avatar Tor Didriksen

Bug#49165 Remove unused/confusing code/comments in setup_conds()


sql/sql_base.cc:
  Query_arena *arena and backup are both unused.
  Removing those, allows us to remove select_lex->conds_processed_with_permanent_arena
sql/sql_lex.cc:
  conds_processed_with_permanent_arena is unused
sql/sql_lex.h:
  conds_processed_with_permanent_arena was unused
parent 0d0edba0
...@@ -8008,7 +8008,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, ...@@ -8008,7 +8008,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
COND **conds) COND **conds)
{ {
SELECT_LEX *select_lex= thd->lex->current_select; SELECT_LEX *select_lex= thd->lex->current_select;
Query_arena *arena= thd->stmt_arena, backup;
TABLE_LIST *table= NULL; // For HP compilers TABLE_LIST *table= NULL; // For HP compilers
/* /*
it_is_update set to TRUE when tables of primary SELECT_LEX (SELECT_LEX it_is_update set to TRUE when tables of primary SELECT_LEX (SELECT_LEX
...@@ -8024,10 +8023,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, ...@@ -8024,10 +8023,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
select_lex->is_item_list_lookup= 0; select_lex->is_item_list_lookup= 0;
DBUG_ENTER("setup_conds"); DBUG_ENTER("setup_conds");
if (select_lex->conds_processed_with_permanent_arena ||
arena->is_conventional())
arena= 0; // For easier test
thd->mark_used_columns= MARK_COLUMNS_READ; thd->mark_used_columns= MARK_COLUMNS_READ;
DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns)); DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns));
select_lex->cond_count= 0; select_lex->cond_count= 0;
...@@ -8096,7 +8091,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, ...@@ -8096,7 +8091,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
We do this ON -> WHERE transformation only once per PS/SP statement. We do this ON -> WHERE transformation only once per PS/SP statement.
*/ */
select_lex->where= *conds; select_lex->where= *conds;
select_lex->conds_processed_with_permanent_arena= 1;
} }
thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup;
DBUG_RETURN(test(thd->is_error())); DBUG_RETURN(test(thd->is_error()));
......
...@@ -1672,7 +1672,6 @@ void st_select_lex::init_query() ...@@ -1672,7 +1672,6 @@ void st_select_lex::init_query()
parent_lex->push_context(&context); parent_lex->push_context(&context);
cond_count= between_count= with_wild= 0; cond_count= between_count= with_wild= 0;
max_equal_elems= 0; max_equal_elems= 0;
conds_processed_with_permanent_arena= 0;
ref_pointer_array= 0; ref_pointer_array= 0;
select_n_where_fields= 0; select_n_where_fields= 0;
select_n_having_items= 0; select_n_having_items= 0;
......
...@@ -659,11 +659,6 @@ class st_select_lex: public st_select_lex_node ...@@ -659,11 +659,6 @@ class st_select_lex: public st_select_lex_node
uint select_n_where_fields; uint select_n_where_fields;
enum_parsing_place parsing_place; /* where we are parsing expression */ enum_parsing_place parsing_place; /* where we are parsing expression */
bool with_sum_func; /* sum function indicator */ bool with_sum_func; /* sum function indicator */
/*
PS or SP cond natural joins was alredy processed with permanent
arena and all additional items which we need alredy stored in it
*/
bool conds_processed_with_permanent_arena;
ulong table_join_options; ulong table_join_options;
uint in_sum_expr; uint in_sum_expr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment