summaryrefslogtreecommitdiff
path: root/sql/filesort_utils.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-02-11 17:16:37 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-02-12 20:16:23 +0530
commitf0606a7530a74579e73e9043c4204f830b5a168a (patch)
tree71cc9ea829be723a54f4f65a151ddc491182f75b /sql/filesort_utils.cc
parent1a6f708ec594ac0ae2dd30db926ab07b100fa24b (diff)
downloadmariadb-git-f0606a7530a74579e73e9043c4204f830b5a168a.tar.gz
MDEV-21665: Server crashes in my_qsort2 / Filesort_buffer::sort_buffer
Allocation should use ALIGN_SIZE when we need to make sure that we have atleast enough space to store one record in MERGEBUFF2 buffers
Diffstat (limited to 'sql/filesort_utils.cc')
-rw-r--r--sql/filesort_utils.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/filesort_utils.cc b/sql/filesort_utils.cc
index 06e3f477993..95b9dc51cf8 100644
--- a/sql/filesort_utils.cc
+++ b/sql/filesort_utils.cc
@@ -111,7 +111,8 @@ uchar *Filesort_buffer::alloc_sort_buffer(uint num_records,
one key.
TODO varun: move this to the place where min_sort_memory is used.
*/
- set_if_bigger(buff_size, (record_length +sizeof(uchar*)) * MERGEBUFF2);
+ set_if_bigger(buff_size,
+ ALIGN_SIZE((record_length +sizeof(uchar*)) * MERGEBUFF2));
if (m_rawmem)
{