mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge MariaDB 5.1.66 -> 5.2.12
This commit is contained in:
@@ -538,8 +538,6 @@ JOIN::prepare(Item ***rref_pointer_array,
|
||||
|
||||
if (having)
|
||||
{
|
||||
Query_arena backup, *arena;
|
||||
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||
nesting_map save_allow_sum_func= thd->lex->allow_sum_func;
|
||||
thd->where="having clause";
|
||||
thd->lex->allow_sum_func|= 1 << select_lex_arg->nest_level;
|
||||
@@ -549,8 +547,6 @@ JOIN::prepare(Item ***rref_pointer_array,
|
||||
having->check_cols(1)));
|
||||
select_lex->having_fix_field= 0;
|
||||
select_lex->having= having;
|
||||
if (arena)
|
||||
thd->restore_active_arena(arena, &backup);
|
||||
|
||||
if (having_fix_rc || thd->is_error())
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
@@ -1468,12 +1464,19 @@ JOIN::optimize()
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Calculate a possible 'limit' of table rows for 'GROUP BY': 'need_tmp'
|
||||
implies that there will be more postprocessing so the specified
|
||||
'limit' should not be enforced yet in the call to
|
||||
'test_if_skip_sort_order'.
|
||||
*/
|
||||
const ha_rows limit = need_tmp ? HA_POS_ERROR : unit->select_limit_cnt;
|
||||
|
||||
if (!(select_options & SELECT_BIG_RESULT) &&
|
||||
((group_list &&
|
||||
(!simple_group ||
|
||||
!test_if_skip_sort_order(&join_tab[const_tables], group_list,
|
||||
unit->select_limit_cnt, 0,
|
||||
limit, 0,
|
||||
&join_tab[const_tables].table->
|
||||
keys_in_use_for_group_by))) ||
|
||||
select_distinct) &&
|
||||
|
||||
Reference in New Issue
Block a user