diff options
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r-- | sql/filesort.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 15020b56e52..86d2fb1a8d0 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1,4 +1,5 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* + Copyright (c) 2000, 2010, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,7 +12,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ /** @@ -138,8 +140,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, error= 1; bzero((char*) ¶m,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; if (!(table->file->ha_table_flags() & HA_FAST_KEY_READ) && !table->fulltext_searched && !sort_positions) @@ -251,6 +251,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, else { thd->query_plan_flags|= QPLAN_FILESORT_DISK; + /* 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); @@ -859,7 +861,7 @@ static void make_sortkey(register SORTPARAM *param, if (sort_field->need_strxnfrm) { char *from=(char*) res->ptr(); - uint tmp_length; + uint tmp_length __attribute__((unused)); if ((uchar*) from == to) { set_if_smaller(length,sort_field->length); |