mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@ -358,7 +358,31 @@ bool dbug_user_var_equals_int(THD *thd, const char *name, int value)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
#endif /* DBUG_OFF */
|
||||
|
||||
/*
|
||||
Intialize POSITION structure.
|
||||
*/
|
||||
|
||||
POSITION::POSITION()
|
||||
{
|
||||
table= 0;
|
||||
records_read= cond_selectivity= read_time= 0.0;
|
||||
prefix_record_count= 0.0;
|
||||
key= 0;
|
||||
use_join_buffer= 0;
|
||||
sj_strategy= SJ_OPT_NONE;
|
||||
n_sj_tables= 0;
|
||||
spl_plan= 0;
|
||||
range_rowid_filter_info= 0;
|
||||
ref_depend_map= dups_producing_tables= 0;
|
||||
inner_tables_handled_with_other_sjs= 0;
|
||||
dups_weedout_picker.set_empty();
|
||||
firstmatch_picker.set_empty();
|
||||
loosescan_picker.set_empty();
|
||||
sjmat_picker.set_empty();
|
||||
}
|
||||
|
||||
|
||||
static void trace_table_dependencies(THD *thd,
|
||||
JOIN_TAB *join_tabs, uint table_count)
|
||||
@ -1604,10 +1628,11 @@ bool JOIN::build_explain()
|
||||
curr_tab->tracker= thd->lex->explain->get_union(select_nr)->
|
||||
get_tmptable_read_tracker();
|
||||
}
|
||||
else
|
||||
else if (select_nr < INT_MAX)
|
||||
{
|
||||
curr_tab->tracker= thd->lex->explain->get_select(select_nr)->
|
||||
get_using_temporary_read_tracker();
|
||||
Explain_select *tmp= thd->lex->explain->get_select(select_nr);
|
||||
if (tmp)
|
||||
curr_tab->tracker= tmp->get_using_temporary_read_tracker();
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
@ -4970,6 +4995,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
|
||||
|
||||
/* The following should be optimized to only clear critical things */
|
||||
bzero((void*)stat, sizeof(JOIN_TAB)* table_count);
|
||||
|
||||
/* Initialize POSITION objects */
|
||||
for (i=0 ; i <= table_count ; i++)
|
||||
(void) new ((char*) (join->positions + i)) POSITION;
|
||||
@ -16126,7 +16152,7 @@ static void update_const_equal_items(THD *thd, COND *cond, JOIN_TAB *tab,
|
||||
Item_func::COND_AND_FUNC));
|
||||
}
|
||||
else if (cond->type() == Item::FUNC_ITEM &&
|
||||
((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
|
||||
((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
|
||||
{
|
||||
Item_equal *item_equal= (Item_equal *) cond;
|
||||
bool contained_const= item_equal->get_const() != NULL;
|
||||
@ -16321,7 +16347,7 @@ propagate_cond_constants(THD *thd, I_List<COND_CMP> *save_list,
|
||||
(((Item_func*) cond)->functype() == Item_func::EQ_FUNC ||
|
||||
((Item_func*) cond)->functype() == Item_func::EQUAL_FUNC))
|
||||
{
|
||||
Item_func_eq *func=(Item_func_eq*) cond;
|
||||
Item_bool_func2 *func= dynamic_cast<Item_bool_func2*>(cond);
|
||||
Item **args= func->arguments();
|
||||
bool left_const= args[0]->const_item() && !args[0]->is_expensive();
|
||||
bool right_const= args[1]->const_item() && !args[1]->is_expensive();
|
||||
@ -17263,7 +17289,7 @@ void propagate_new_equalities(THD *thd, Item *cond,
|
||||
}
|
||||
}
|
||||
else if (cond->type() == Item::FUNC_ITEM &&
|
||||
((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
|
||||
((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
|
||||
{
|
||||
Item_equal *equal_item;
|
||||
List_iterator<Item_equal> it(*new_equalities);
|
||||
@ -17508,7 +17534,7 @@ Item_cond::remove_eq_conds(THD *thd, Item::cond_result *cond_value,
|
||||
}
|
||||
else if (and_level &&
|
||||
new_item->type() == Item::FUNC_ITEM &&
|
||||
((Item_cond*) new_item)->functype() ==
|
||||
((Item_func*) new_item)->functype() ==
|
||||
Item_func::MULT_EQUAL_FUNC)
|
||||
{
|
||||
li.remove();
|
||||
@ -25455,8 +25481,8 @@ copy_fields(TMP_TABLE_PARAM *param)
|
||||
(*ptr->do_copy)(ptr);
|
||||
|
||||
List_iterator_fast<Item> it(param->copy_funcs);
|
||||
Item_copy_string *item;
|
||||
while ((item = (Item_copy_string*) it++))
|
||||
Item_copy *item;
|
||||
while ((item= (Item_copy*) it++))
|
||||
item->copy();
|
||||
}
|
||||
|
||||
@ -29602,6 +29628,7 @@ void unpack_to_base_table_fields(TABLE *table)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@} (end of group Query_Optimizer)
|
||||
*/
|
||||
|
Reference in New Issue
Block a user