summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2016-12-22 15:51:37 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2016-12-22 15:51:37 +0530
commit706fb790bcf9105a73f34002fe28c75032267c4b (patch)
tree17ce19ceef53641acb572e1bfbf92de188c0f240 /sql/filesort.cc
parent5e051bfa15d201228b103d7f536436a61cde8707 (diff)
downloadmariadb-git-706fb790bcf9105a73f34002fe28c75032267c4b.tar.gz
MDEV-10927: Crash When Using sort_union Optimization
In file sql/filesort.cc,when merge_buffers() is called then - queue_remove(&queue,0) is called - For the function queue_remove there is assertion states that the element to be removed should have index >=1 - this is causing the assertion to fail. Fixed by removing the top element.
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 5bb5c64409a..38404b01cf7 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1411,7 +1411,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
if (!(error= (int) read_to_buffer(from_file, buffpek,
rec_length)))
{
- queue_remove(&queue,0);
+ (void) queue_remove_top(&queue);
reuse_freed_buff(&queue, buffpek, rec_length);
}
else if (error == -1)