From 27adfa0777e2891db596d1a48b10f1aed12e966d Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Fri, 16 Oct 2009 20:28:45 +0400 Subject: [PATCH] Backporting a patch for Bug#47421 from 6.0: revno: 2617.68.41 committer: Alexander Nozdrin branch nick: mysql-6.0-codebase-bugfixing-bug47421 timestamp: Wed 2009-09-23 17:48:11 +0400 message: A patch for Bug#47421 (Server crash from - SELECT SUM ( DISTINCT ) in azalea). The problem was that DBUG_RETURN() macro should have been used instead the 'return' operator. --- sql/item_sum.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index c8576722c69..5dafee7ff27 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -847,7 +847,7 @@ bool Aggregator_distinct::setup(THD *thd) DBUG_ENTER("Item_sum_distinct::setup"); /* It's legal to call setup() more than once when in a subquery */ if (tree) - return FALSE; + DBUG_RETURN(FALSE); /* Virtual table and the tree are created anew on each re-execution of @@ -855,7 +855,7 @@ bool Aggregator_distinct::setup(THD *thd) mem_root. */ if (field_list.push_back(&field_def)) - return TRUE; + DBUG_RETURN(TRUE); item_sum->null_value= item_sum->maybe_null= 1; item_sum->quick_group= 0; @@ -871,7 +871,7 @@ bool Aggregator_distinct::setup(THD *thd) } if (always_null) - return FALSE; + DBUG_RETURN(FALSE); enum enum_field_types field_type; @@ -884,7 +884,7 @@ bool Aggregator_distinct::setup(THD *thd) arg->unsigned_flag); if (! (table= create_virtual_tmp_table(thd, field_list))) - return TRUE; + DBUG_RETURN(TRUE); /* XXX: check that the case of CHAR(0) works OK */ tree_key_length= table->s->reclength - table->s->null_bytes;