1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-37252 Do not check is_key_used in get_index_for_order

This allows UPDATE to use ORDER BY indexes in the update columns.
This commit is contained in:
Yuchen Pei
2025-07-17 15:15:36 +10:00
parent ce7ab467db
commit 7215fe7894
3 changed files with 4 additions and 5 deletions

View File

@@ -33411,8 +33411,7 @@ uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select,
double new_cost;
if (test_if_cheaper_ordering(FALSE, NULL, order, table,
table->keys_in_use_for_order_by, -1, limit,
&key, &direction, &limit, &new_cost) &&
!is_key_used(table, key, table->write_set))
&key, &direction, &limit, &new_cost))
{
*need_sort= FALSE;
*scanned_limit= limit;