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

Bug #55472: Assertion failed in heap_rfirst function of hp_rfirst.c on

DELETE statement

Single-table delete ordered by a field that has a hash-type index
may cause an assertion failure or a crash.

An optimization added by the fix for the bug 36569 forced the
optimizer to use ORDER BY-compatible indices when applicable.

However, the existence of unsorted indices (HASH index algorithm
for some engines such as MEMORY/HEAP, NDB) was ignored.

The test_if_order_by_key function has been modified to skip
unsorted indices.


mysql-test/r/heap_hash.result:
  Test case for bug #55472.
mysql-test/t/heap_hash.test:
  Test case for bug #55472.
sql/sql_select.cc:
  Bug #55472: Assertion failed in heap_rfirst function of hp_rfirst.c on
              DELETE statement
  
  The test_if_order_by_key function has been modified to skip
  unsorted indices.
This commit is contained in:
Gleb Shchepa
2010-07-29 01:02:43 +04:00
parent e4cbcaf942
commit 95d9205c17
3 changed files with 29 additions and 1 deletions

View File

@ -13244,7 +13244,7 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
DBUG_RETURN(0);
}
if (key_part->field != field)
if (key_part->field != field || !field->part_of_sortkey.is_set(idx))
DBUG_RETURN(0);
/* set flag to 1 if we can use read-next on key, else to -1 */