Commit 0e5230e1 authored by Sergei Golubchik's avatar Sergei Golubchik

support keyread in READ_RECORD

make init_read_record() to detect enabled keyread
and use index_* access methods, not rnd_*

this makes MariaDB to use keyread a lot more often than before
parent 1913daf4
...@@ -279,6 +279,18 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table, ...@@ -279,6 +279,18 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
info->read_record= (addon_field ? info->read_record= (addon_field ?
rr_unpack_from_buffer : rr_from_pointers); rr_unpack_from_buffer : rr_from_pointers);
} }
else if (table->file->keyread_enabled())
{
int error;
info->read_record= rr_index_first;
if (!table->file->inited &&
(error= table->file->ha_index_init(table->file->keyread, 1)))
{
if (print_error)
table->file->print_error(error, MYF(0));
DBUG_RETURN(1);
}
}
else else
{ {
DBUG_PRINT("info",("using rr_sequential")); DBUG_PRINT("info",("using rr_sequential"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment