summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2017-02-28 17:39:28 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2017-02-28 20:52:26 +0100
commit75f6067e89d7a777e7c1a1580a833aacc501d290 (patch)
tree4127227514ffca156423953a9897d3222dab9db4 /sql/sql_select.cc
parent5a0fff50f87e20c4e95a84143a0a3bb67e03e29e (diff)
downloadmariadb-git-75f6067e89d7a777e7c1a1580a833aacc501d290.tar.gz
MDEV-9635: Server crashes in part_of_refkey or assertion `!created && key_to_save < (int)s->keys' failed in TABLE::use_index(int) or with join_cache_level>2
Do not try to create index where ref is for hash join.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 4133c8258a2..43b3b6bf47b 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -9422,7 +9422,7 @@ void JOIN::drop_unused_derived_keys()
continue;
if (!table->pos_in_table_list->is_materialized_derived())
continue;
- if (table->max_keys > 1)
+ if (table->max_keys > 1 && !tab->is_ref_for_hash_join())
table->use_index(tab->ref.key);
if (table->s->keys)
{