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

MDEV-35105 Assertion `tab->join->order' fails upon vector search with DISTINCT

don't apply distinct optimization to order by a vector index
This commit is contained in:
Sergei Golubchik
2024-10-09 09:25:12 +02:00
parent 9ddb94f60e
commit b56ca29f89
3 changed files with 20 additions and 1 deletions

View File

@@ -4402,7 +4402,8 @@ JOIN::optimize_distinct()
}
/* Optimize "select distinct b from t1 order by key_part_1 limit #" */
if (order && skip_sort_order && !unit->lim.is_with_ties())
if (order && skip_sort_order && !unit->lim.is_with_ties()
&& (*order->item)->type() == Item::FIELD_ITEM)
{
/* Should already have been optimized away */
DBUG_ASSERT(ordered_index_usage == ordered_index_order_by);