BUG#860300: Second crash with get_fanout_with_deps() with semijoin + materialization

- Make get_post_group_estimate() take into account semi-join materialization nests.
This commit is contained in:
Sergey Petrunya 2011-09-28 12:58:01 +04:00
commit 35ecfa90e3
4 changed files with 62 additions and 1 deletions

View file

@ -4394,7 +4394,13 @@ double get_fanout_with_deps(JOIN *join, table_map tset)
for (JOIN_TAB *tab= first_top_level_tab(join, WITHOUT_CONST_TABLES); tab;
tab= next_top_level_tab(join, tab))
{
if ((tab->table->map & checked_deps) && !tab->emb_sj_nest &&
/*
Ignore SJM nests. They have tab->table==NULL. There is no point to walk
inside them, because GROUP BY clause cannot refer to tables from within
subquery.
*/
if (!tab->is_sjm_nest() && (tab->table->map & checked_deps) &&
!tab->emb_sj_nest &&
tab->records_read != 0)
{
fanout *= rows2double(tab->records_read);