summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorOleg Smirnov <olernov@gmail.com>2022-05-13 18:10:11 +0400
committerOleg Smirnov <olernov@gmail.com>2022-05-19 08:31:01 +0400
commit40d9dbb28f43708b498a4d62f61dc34fd87eb9b9 (patch)
tree678178dac0b50a5a7e4fc97b4b12080612632473 /sql/sql_update.cc
parent8881c0100e2131077410b360b27b7af30db56e1a (diff)
downloadmariadb-git-40d9dbb28f43708b498a4d62f61dc34fd87eb9b9.tar.gz
MDEV-28246 Optimizer uses all partitions after upgrade to 10.3
Cause: a copy of the joined TABLE_LIST is created during multi_update::prepare and TABLE::pos_in_table_list of the tables are set to point to the new TABLE_LIST object. This prevents some optimization steps to perform correctly. Solution: do not update pos_in_table_list during multi_update::prepare
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index a6a0b78259d..66c3acedb23 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1977,10 +1977,9 @@ int multi_update::prepare(List<Item> &not_used_values,
if (!tl)
DBUG_RETURN(1);
update.link_in_list(tl, &tl->next_local);
- tl->shared= table_count++;
+ table_ref->shared= tl->shared= table_count++;
table->no_keyread=1;
table->covering_keys.clear_all();
- table->pos_in_table_list= tl;
table->prepare_triggers_for_update_stmt_or_event();
table->reset_default_fields();
}