1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-13535 Query on MyISAM table corrupts the table

don't assume that the table always has a primary key,
head->s->primary_key might be MAX_KEY, which won't start keyread.
This commit is contained in:
Sergei Golubchik
2017-08-16 18:44:17 +02:00
parent 1b7e55900a
commit a4885dde4c
3 changed files with 6 additions and 1 deletions

View File

@ -10889,13 +10889,13 @@ int read_keys_and_merge_scans(THD *thd,
DBUG_ENTER("read_keys_and_merge");
/* We're going to just read rowids. */
head->file->ha_start_keyread(head->s->primary_key);
head->prepare_for_position();
cur_quick_it.rewind();
cur_quick= cur_quick_it++;
bool first_quick= TRUE;
DBUG_ASSERT(cur_quick != 0);
head->file->ha_start_keyread(cur_quick->index);
/*
We reuse the same instance of handler so we need to call both init and