1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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
This commit is contained in:
Sergei Golubchik
2017-02-06 23:36:39 +01:00
parent 1913daf42c
commit 0e5230e12d

View File

@@ -279,6 +279,18 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
info->read_record= (addon_field ?
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
{
DBUG_PRINT("info",("using rr_sequential"));