summaryrefslogtreecommitdiff
path: root/sql/uniques.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-01-22 12:28:20 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-01-22 12:28:20 +0530
commit39e4fe8fa13ee8003a5d5aaca38094a634cd791a (patch)
tree010f5354343c2e2d63ba6f19f228097ee21272a1 /sql/uniques.cc
parentdaf28db027a8bdcb7b2b69c54639fec35a2dd259 (diff)
downloadmariadb-git-39e4fe8fa13ee8003a5d5aaca38094a634cd791a.tar.gz
MDEV-21541: main.sum_distinct-big fails with Assertion `m_buffer_end == __null || end <= m_buffer_end'
For Merge_chuck structures first set the start and end positions of the buffer and then adjust the end positions of the buffer if the records are dynamic in nature.
Diffstat (limited to 'sql/uniques.cc')
-rw-r--r--sql/uniques.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/uniques.cc b/sql/uniques.cc
index a8170951e88..931aa868199 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -528,8 +528,8 @@ static bool merge_walk(uchar *merge_buffer, size_t merge_buffer_size,
*/
for (top= begin; top != end; ++top)
{
- top->set_buffer_start(merge_buffer + (top - begin) * piece_size);
- top->set_buffer_end(top->buffer_start() + piece_size);
+ top->set_buffer(merge_buffer + (top - begin) * piece_size,
+ merge_buffer + (top - begin) * piece_size + piece_size);
top->set_max_keys(max_key_count_per_piece);
bytes_read= read_to_buffer(file, top, &sort_param);
if (unlikely(bytes_read == (ulong) -1))