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

Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1

into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-bugteam
This commit is contained in:
gkodinov/kgeorge@magare.gmz
2008-03-28 11:27:03 +02:00
11 changed files with 753 additions and 53 deletions

View File

@ -13158,6 +13158,11 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
tab->read_first_record= best_key_direction > 0 ?
join_read_first:join_read_last;
tab->type=JT_NEXT; // Read with index_first(), index_next()
if (select && select->quick)
{
delete select->quick;
select->quick= 0;
}
if (table->covering_keys.is_set(best_key))
{
table->key_read=1;
@ -13168,15 +13173,27 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
{
tab->ref.key= -1;
tab->ref.key_parts= 0;
if (select && select->quick)
{
delete select->quick;
select->quick= 0;
}
if (select_limit < table_records)
tab->limit= select_limit;
}
}
else if (tab->type != JT_ALL)
{
/*
We're about to use a quick access to the table.
We need to change the access method so as the quick access
method is actually used.
*/
DBUG_ASSERT(tab->select->quick);
tab->type=JT_ALL;
tab->use_quick=1;
tab->ref.key= -1;
tab->ref.key_parts=0; // Don't use ref key.
tab->read_first_record= join_init_read_record;
/*
TODO: update the number of records in join->best_positions[tablenr]
*/
}
}
used_key_parts= best_key_parts;
order_direction= best_key_direction;