1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #50335: Assertion `!(order->used & map)' in eq_ref_table

The problem was in an incorrect debug assertion. The expression 
used in the failing assertion states that when finding 
references matching ORDER BY expressions, there can be only one 
reference to a single table. But that does not make any sense, 
all test cases for this bug are valid examples with multiple 
identical WHERE expressions referencing the same table which
are also present in the ORDER BY list. 
 
Fixed by removing the failing assertion. We also have to take 
care of the 'found' counter so that we count multiple 
references only once. We rely on this fact later in 
eq_ref_table().
This commit is contained in:
Alexey Kopytov
2010-02-25 18:48:53 +03:00
parent a341ec7400
commit 735de9ea7e
3 changed files with 29 additions and 3 deletions

View File

@ -7028,9 +7028,11 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab)
}
if (order)
{
found++;
DBUG_ASSERT(!(order->used & map));
order->used|=map;
if (!(order->used & map))
{
found++;
order->used|= map;
}
continue; // Used in ORDER BY
}
if (!only_eq_ref_tables(join,start_order, (*ref_item)->used_tables()))