Commit graph

2 commits

Author SHA1 Message Date
Jorgen Loland
47b774b21c BUG#58456 - Assertion 0 in QUICK_INDEX_MERGE_SELECT::need_sorted_output
in opt_range.h

In this bug, there are two alternative access plans: 
 * Index merge range access
 * Const ref access

best_access_path() decided that the ref access was preferrable, 
but make_join_select() still decided to point 
SQL_SELECT::quick to the index merge because the table had 
type==JT_CONST which was not handled. 

At the same time the table's ref.key still referred to the 
index the ref access would use indicating that ref access 
should be used. In this state, different parts of the 
optimizer code have different perceptions of which access path
is in use (ref or range).

test_if_skip_sort_order() was called to check if the ref access
needed ordering, but test_if_skip_sort_order() got confused and
requested the index merge to return records in sorted order. 
Index merge cannot do this, and fired an ASSERT.

The fix is to take join_tab->type==JT_CONST into concideration
when make_join_select() decides whether or not to use the 
range access method.

mysql-test/r/join_outer_innodb.result:
  Add test for BUG#58456
mysql-test/t/join_outer_innodb.test:
  Add test for BUG#58456
2010-12-16 12:25:02 +01:00
unknown
0dbe99f8aa Move innodb dependent test to join_outer_innodb
mysql-test/r/join_outer_innodb.result:
  New BitKeeper file ``mysql-test/r/join_outer_innodb.result''
mysql-test/t/join_outer_innodb.test:
  New BitKeeper file ``mysql-test/t/join_outer_innodb.test''
2006-05-22 13:57:32 +02:00