summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index b449cdae0c7..3cad647ba1c 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2041,7 +2041,24 @@ end:
doing_key_read= 1;
head->mark_columns_used_by_index(index);
}
+
head->prepare_for_position();
+
+ if (head->no_keyread)
+ {
+ /*
+ We can get here when doing multi-table delete and having index_merge
+ condition on a table that we're deleting from. It probably doesn't make
+ sense to use index_merge, but de-facto it is used.
+
+ When it is used, we need to index columns to be read (before maria-5.3,
+ read_multi_range_first() would set it).
+ We shouldn't call mark_columns_used_by_index(), because it calls
+ enable_keyread(), which is not allowed.
+ */
+ head->mark_columns_used_by_index_no_reset(index, head->read_set);
+ }
+
head->file= org_file;
head->key_read= org_key_read;
bitmap_copy(&column_bitmap, head->read_set);