merge 5.3 -> 5.5

This commit is contained in:
unknown 2013-09-25 17:16:13 +03:00
commit 64d6d8334f
18 changed files with 130 additions and 167 deletions

View file

@ -620,6 +620,15 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
sl->context.outer_context= 0;
// Prepare underlying views/DT first.
sl->handle_derived(lex, DT_PREPARE);
if (derived->outer_join)
{
/* Mark that table is part of OUTER JOIN and fields may be NULL */
for (TABLE_LIST *cursor= (TABLE_LIST*) sl->table_list.first;
cursor;
cursor= cursor->next_local)
cursor->outer_join|= JOIN_TYPE_OUTER;
}
}
unit->derived= derived;
@ -714,6 +723,10 @@ exit:
/* Add new temporary table to list of open derived tables */
table->next= thd->derived_tables;
thd->derived_tables= table;
/* If table is used by a left join, mark that any column may be null */
if (derived->outer_join)
table->maybe_null= 1;
}
if (arena)
thd->restore_active_arena(arena, &backup);