diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2020-02-11 17:16:37 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2020-02-12 20:16:23 +0530 |
commit | f0606a7530a74579e73e9043c4204f830b5a168a (patch) | |
tree | 71cc9ea829be723a54f4f65a151ddc491182f75b /sql | |
parent | 1a6f708ec594ac0ae2dd30db926ab07b100fa24b (diff) | |
download | mariadb-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')
-rw-r--r-- | sql/filesort_utils.cc | 3 |
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) { |