1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #24778: Innodb: No result when using ORDER BY

This bug was intruduced by the fix for bug#17212 (in 4.1). It is not 
ok to call test_if_skip_sort_order since this function will 
alter the execution plan. By contract it is not ok to call 
test_if_skip_sort_order in this context.

This bug appears only in the case when the optimizer has chosen 
an index for accessing a particular table but finds a covering 
index that enables it to skip ORDER BY. This happens in 
test_if_skip_sort_order.
This commit is contained in:
mhansson/martin@linux-st28.site
2007-03-14 12:15:14 +01:00
parent f2ce1445e1
commit e61cce4d6b
3 changed files with 90 additions and 4 deletions

View File

@ -6106,10 +6106,7 @@ make_join_readinfo(JOIN *join, ulonglong options)
*/
if (!ordered_set &&
(table == join->sort_by_table &&
(!join->order || join->skip_sort_order ||
test_if_skip_sort_order(tab, join->order, join->select_limit,
1, &table->keys_in_use_for_order_by))
) ||
(!join->order || join->skip_sort_order)) ||
(join->sort_by_table == (TABLE *) 1 && i != join->const_tables))
ordered_set= 1;