mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
PS and SP made compatible in mechanism used for preparing query for rexecutions (Bug #2266)
mysql-test/r/sp.result: test suite for Bug #2266 mysql-test/t/sp.test: test suite for Bug #2266 sql/item_subselect.cc: made ancestor for Statement (Item_arena) sql/item_subselect.h: made ancestor for Statement (Item_arena) sql/item_sum.cc: made ancestor for Statement (Item_arena) sql/item_sum.h: made ancestor for Statement (Item_arena) sql/mysql_priv.h: reset_stmt_for_execute use PS and SP sql/sp_head.cc: sp_head use Item_arena as ancestor to be PS cleunup compatible SP use PS storing/restoring/cleanup mechanisms cleanup() of SP Items added Items created in temporary memory pool during SP execution saved for normal freeing after SP execution sql/sp_head.h: sp_head use Item_arena sql/sql_base.cc: made ancestor for Statement (Item_arena) results of wild_setup made permanent setup_conds make natural joins expanding only once and store results in PS/SP memory sql/sql_class.cc: made ancestor for Statement (Item_arena) sql/sql_class.h: made ancestor for Statement (Item_arena) method to detect PS preparation added sql/sql_delete.cc: storing where for DELETE and mark first execution sql/sql_derived.cc: use method sql/sql_insert.cc: mark first execution for INSERT sql/sql_lex.cc: flags to correctly make transformations of query and storing them in memory of PS/SP made ancestor for Statement (Item_arena) sql/sql_lex.h: reved variable od SP ol saving data flags to correctly make transformations of query and storing them in memory of PS/SP sql/sql_parse.cc: cleunup unit for any query sql/sql_prepare.cc: made ancestor for Statement (Item_arena) storing where moved to preparation changed interface of reset_stmt_for_execute to use it is SP do not restore where/order by/group by before first execution (but tables and unit can be chenged without execution and should be prepared (subqueries executes on demand)) sql/sql_select.cc: storing where for SELECT/multi-DELETE/... and mark first execution sql/sql_union.cc: made ancestor for Statement (Item_arena) sql/sql_update.cc: storing where for UPDATE and mark first execution
This commit is contained in:
@ -1011,10 +1011,12 @@ void st_select_lex::init_query()
|
||||
having_fix_field= 0;
|
||||
resolve_mode= NOMATTER_MODE;
|
||||
cond_count= with_wild= 0;
|
||||
conds_processed_with_permanent_arena= 0;
|
||||
ref_pointer_array= 0;
|
||||
select_n_having_items= 0;
|
||||
prep_where= 0;
|
||||
explicit_limit= 0;
|
||||
first_execution= 1;
|
||||
}
|
||||
|
||||
void st_select_lex::init_select()
|
||||
@ -1414,7 +1416,9 @@ bool st_select_lex::add_order_to_list(THD *thd, Item *item, bool asc)
|
||||
|
||||
bool st_select_lex::add_item_to_list(THD *thd, Item *item)
|
||||
{
|
||||
return item_list.push_back(item);
|
||||
DBUG_ENTER("st_select_lex::add_item_to_list");
|
||||
DBUG_PRINT("info", ("Item: %p", item));
|
||||
DBUG_RETURN(item_list.push_back(item));
|
||||
}
|
||||
|
||||
|
||||
@ -1500,12 +1504,12 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
|
||||
We have to create array in prepared statement memory if it is
|
||||
prepared statement
|
||||
*/
|
||||
Statement *stmt= thd->current_statement ? thd->current_statement : thd;
|
||||
Item_arena *arena= thd->current_arena ? thd->current_arena : thd;
|
||||
return (ref_pointer_array=
|
||||
(Item **)stmt->alloc(sizeof(Item*) *
|
||||
(item_list.elements +
|
||||
select_n_having_items +
|
||||
order_group_num)* 5)) == 0;
|
||||
(Item **)arena->alloc(sizeof(Item*) *
|
||||
(item_list.elements +
|
||||
select_n_having_items +
|
||||
order_group_num)* 5)) == 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user