mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed bug #26159.
A wrong order of statements in QUICK_GROUP_MIN_MAX_SELECT::reset caused a crash when a query with DISTINCT was executed by a loose scan for an InnoDB table that had been emptied.
This commit is contained in:
@@ -8765,14 +8765,13 @@ int QUICK_GROUP_MIN_MAX_SELECT::reset(void)
|
||||
DBUG_ENTER("QUICK_GROUP_MIN_MAX_SELECT::reset");
|
||||
|
||||
file->extra(HA_EXTRA_KEYREAD); /* We need only the key attributes */
|
||||
result= file->ha_index_init(index);
|
||||
result= file->index_last(record);
|
||||
if (result == HA_ERR_END_OF_FILE)
|
||||
DBUG_RETURN(0);
|
||||
if (result)
|
||||
if ((result= file->ha_index_init(index)))
|
||||
DBUG_RETURN(result);
|
||||
if (quick_prefix_select && quick_prefix_select->reset())
|
||||
DBUG_RETURN(1);
|
||||
result= file->index_last(record);
|
||||
if (result == HA_ERR_END_OF_FILE)
|
||||
DBUG_RETURN(0);
|
||||
/* Save the prefix of the last group. */
|
||||
key_copy(last_prefix, record, index_info, group_prefix_len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user