Commit ae01a353 authored by unknown's avatar unknown

fix for crash with small sort_buffer

parent f3eb7fe0
...@@ -198,6 +198,11 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length, ...@@ -198,6 +198,11 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length,
param.keys--; param.keys--;
maxbuffer+=10; /* Some extra range */ maxbuffer+=10; /* Some extra range */
if (memavl < param.sort_length*MERGEBUFF2)
{
my_error(ER_OUT_OF_SORTMEMORY,MYF(0));
goto err;
}
if (memavl < MIN_SORT_MEMORY) if (memavl < MIN_SORT_MEMORY)
{ {
my_error(ER_OUTOFMEMORY,MYF(ME_ERROR+ME_WAITTANG),sortbuff_size); my_error(ER_OUTOFMEMORY,MYF(ME_ERROR+ME_WAITTANG),sortbuff_size);
......
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