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.
This commit is contained in:
parent
cd6f3b55da
commit
a44794d05e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user