1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Bug #44886: SIGSEGV in test_if_skip_sort_order() -

uninitialized variable used as subscript

Grouping select from a "constant" InnoDB table (a table
of a single row) joined with other tables caused a crash.
This commit is contained in:
Gleb Shchepa
2009-06-08 01:40:53 +05:00
parent 69e78274ae
commit eecf06873e
3 changed files with 43 additions and 1 deletions

View File

@ -12658,7 +12658,10 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
one row). The sorting doesn't matter.
*/
if (key_part == key_part_end && reverse == 0)
{
*used_key_parts= 0;
DBUG_RETURN(1);
}
}
else
DBUG_RETURN(0);
@ -13155,7 +13158,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
select_limit= table_records;
if (group)
{
rec_per_key= keyinfo->rec_per_key[used_key_parts-1];
rec_per_key= used_key_parts ? keyinfo->rec_per_key[used_key_parts-1]
: 1;
set_if_bigger(rec_per_key, 1);
/*
With a grouping query each group containing on average