1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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
This commit is contained in:
Oleg Smirnov
2022-05-13 18:10:11 +04:00
parent 8881c0100e
commit 40d9dbb28f
3 changed files with 122 additions and 2 deletions

View File

@ -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();
}