summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
authorNorvald H. Ryeng <norvald.ryeng@oracle.com>2011-08-30 09:56:07 +0200
committerNorvald H. Ryeng <norvald.ryeng@oracle.com>2011-08-30 09:56:07 +0200
commitc6de8c8c05d020f16817fb0bfb05c9c3df475a76 (patch)
treec5dca5e103c85b4d9af71dd127f370cb70fe4f45 /sql/filesort.cc
parentf610c5658748ae97a5e2c1e1afbd229f2121a082 (diff)
downloadmariadb-git-c6de8c8c05d020f16817fb0bfb05c9c3df475a76.tar.gz
Bug#11765254 - 58200: ASSERTION FAILED: PARAM.SORT_LENGTH WHEN
GROUPING BY FUNCTIONS.... (PART The bug was introduced in a patch for bug 49897. Problem: The assertion inserted by the original patch to guard against zero-lenght sort keys during merge phase triggers also when the whole set fits in memory. Fix: Move assert so that it does not trigger if the whole set is in memory. mysql-test/r/group_by.result: Add test for bug#11765254 mysql-test/t/group_by.test: Add test for bug#11765254 sql/filesort.cc: Move assertion
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 0ff354b334c..715528bcd52 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -144,8 +144,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
error= 1;
bzero((char*) &param,sizeof(param));
param.sort_length= sortlength(thd, sortorder, s_length, &multi_byte_charset);
- /* filesort cannot handle zero-length records. */
- DBUG_ASSERT(param.sort_length);
param.ref_length= table->file->ref_length;
param.addon_field= 0;
param.addon_length= 0;
@@ -257,6 +255,9 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
}
else
{
+ /* filesort cannot handle zero-length records during merge. */
+ DBUG_ASSERT(param.sort_length != 0);
+
if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
{
x_free(table_sort.buffpek);