BUG#869001: Wrong result with semijoin + materialization + firstmatch + multipart key

- Make advance_sj_state() not to attempt building duplicate removal strategies
  when we're doing optimization of an SJM-nest.
This commit is contained in:
Sergey Petrunya 2011-10-12 13:19:37 +04:00
commit 2160a25adc
5 changed files with 121 additions and 0 deletions

View file

@ -2179,6 +2179,17 @@ void advance_sj_state(JOIN *join, table_map remaining_tables,
pos->sj_strategy= SJ_OPT_NONE;
pos->prefix_dups_producing_tables= join->cur_dups_producing_tables;
/* We're performing optimization inside SJ-Materialization nest */
if (join->emb_sjm_nest)
{
pos->invalidate_firstmatch_prefix();
pos->first_loosescan_table= MAX_TABLES;
pos->dupsweedout_tables= 0;
pos->sjm_scan_need_tables= 0;
return;
}
/* Initialize the state or copy it from prev. tables */
if (idx == join->const_tables)
{