Commit 04328c3d authored by ramil@mysql.com's avatar ramil@mysql.com

A fix (bug #8799: Killed filesorts can fail inited==RND assertion in ha_rnd_end).

parent ec775b65
......@@ -452,8 +452,11 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if (*killed)
{
DBUG_PRINT("info",("Sort killed by user"));
(void) file->extra(HA_EXTRA_NO_CACHE);
file->ha_rnd_end();
if (!indexfile && !quick_select)
{
(void) file->extra(HA_EXTRA_NO_CACHE);
file->ha_rnd_end();
}
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
}
if (error == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment