Commit 3b63182e authored by Tor Didriksen's avatar Tor Didriksen

Bug#17326567 MYSQL SERVER FILESORT IMPLEMENTATION HAS A VERY SERIOUS BUG

The filesort implementation needs space for at least 15 records
(plus some internal overhead) in its main sort buffer.
parent df5018f2
/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -216,7 +216,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
goto err;
memavl= thd->variables.sortbuff_size;
min_sort_memory= max(MIN_SORT_MEMORY, param.sort_length*MERGEBUFF2);
min_sort_memory=
max(MIN_SORT_MEMORY,
ALIGN_SIZE(MERGEBUFF2 * (param.rec_length + sizeof(uchar*))));
while (memavl >= min_sort_memory)
{
ulong old_memavl;
......
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