summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-08-16 18:44:17 +0200
committerSergei Golubchik <serg@mariadb.org>2017-08-16 18:44:17 +0200
commita4885dde4ccec68bbb0268796f62e68e08ba4837 (patch)
tree68b41ff9e35e714f9806266f6cc01ca7ec6f6474 /sql/opt_range.cc
parent1b7e55900a952c780fb401876024f4e1b476c641 (diff)
downloadmariadb-git-a4885dde4ccec68bbb0268796f62e68e08ba4837.tar.gz
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.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index ec59c0acf86..c15810ba686 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -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