summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-12-28 19:38:37 +0200
committerMonty <monty@mariadb.org>2023-02-10 12:58:50 +0200
commit02b7735b82d22ee684b1d334a98d3216113701fa (patch)
tree45bf31153a64cdfe88344272fb9d7ee84afeae1f /sql/sql_union.cc
parent4be0bfad98c41acb6a2a7d5722051081ab5d239a (diff)
downloadmariadb-git-02b7735b82d22ee684b1d334a98d3216113701fa.tar.gz
MDEV-30310 Assertion failure in best_access_path upon IN exceeding IN_PREDICATE_CONVERSION_THRESHOLD, derived_with_keys=off
The bug was some old code that, without any explanation, reset PART_KEY_FLAG from fields in temporary tables. This caused join_tab->key_dependent to not be updated properly, which caused an assert.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc5
1 files changed, 0 insertions, 5 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 188f98aa7dd..e77023f1fd3 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -354,8 +354,6 @@ select_unit::create_result_table(THD *thd_arg, List<Item> *column_types,
return TRUE;
table->keys_in_use_for_query.clear_all();
- for (uint i=0; i < table->s->fields; i++)
- table->field[i]->flags &= ~(PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG);
if (create_table)
{
@@ -393,9 +391,6 @@ select_union_recursive::create_result_table(THD *thd_arg,
return true;
incr_table->keys_in_use_for_query.clear_all();
- for (uint i=0; i < table->s->fields; i++)
- incr_table->field[i]->flags &= ~(PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG);
-
return false;
}