1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge 5.1->5.5.

This commit is contained in:
Norvald H. Ryeng
2012-06-18 09:45:42 +02:00
2 changed files with 7 additions and 1 deletions

View File

@ -557,6 +557,8 @@ 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;
@ -565,6 +567,10 @@ JOIN::prepare(Item ***rref_pointer_array,
(having->fix_fields(thd, &having) ||
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 */
thd->lex->allow_sum_func= save_allow_sum_func;