From 706fb790bcf9105a73f34002fe28c75032267c4b Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Thu, 22 Dec 2016 15:51:37 +0530 Subject: 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. --- sql/filesort.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/filesort.cc') 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) -- cgit v1.2.1