Commit bafa0fdf authored by Alexander Nozdrin's avatar Alexander Nozdrin

Backporting a patch for Bug#47421 from 6.0:

revno: 2617.68.41
committer: Alexander Nozdrin <alik@sun.com>
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 <char_column>) in azalea).
  
  The problem was that DBUG_RETURN() macro should have been
  used instead the 'return' operator.
parent ad8d89cd
...@@ -847,7 +847,7 @@ bool Aggregator_distinct::setup(THD *thd) ...@@ -847,7 +847,7 @@ bool Aggregator_distinct::setup(THD *thd)
DBUG_ENTER("Item_sum_distinct::setup"); DBUG_ENTER("Item_sum_distinct::setup");
/* It's legal to call setup() more than once when in a subquery */ /* It's legal to call setup() more than once when in a subquery */
if (tree) if (tree)
return FALSE; DBUG_RETURN(FALSE);
/* /*
Virtual table and the tree are created anew on each re-execution of Virtual table and the tree are created anew on each re-execution of
...@@ -855,7 +855,7 @@ bool Aggregator_distinct::setup(THD *thd) ...@@ -855,7 +855,7 @@ bool Aggregator_distinct::setup(THD *thd)
mem_root. mem_root.
*/ */
if (field_list.push_back(&field_def)) if (field_list.push_back(&field_def))
return TRUE; DBUG_RETURN(TRUE);
item_sum->null_value= item_sum->maybe_null= 1; item_sum->null_value= item_sum->maybe_null= 1;
item_sum->quick_group= 0; item_sum->quick_group= 0;
...@@ -871,7 +871,7 @@ bool Aggregator_distinct::setup(THD *thd) ...@@ -871,7 +871,7 @@ bool Aggregator_distinct::setup(THD *thd)
} }
if (always_null) if (always_null)
return FALSE; DBUG_RETURN(FALSE);
enum enum_field_types field_type; enum enum_field_types field_type;
...@@ -884,7 +884,7 @@ bool Aggregator_distinct::setup(THD *thd) ...@@ -884,7 +884,7 @@ bool Aggregator_distinct::setup(THD *thd)
arg->unsigned_flag); arg->unsigned_flag);
if (! (table= create_virtual_tmp_table(thd, field_list))) if (! (table= create_virtual_tmp_table(thd, field_list)))
return TRUE; DBUG_RETURN(TRUE);
/* XXX: check that the case of CHAR(0) works OK */ /* XXX: check that the case of CHAR(0) works OK */
tree_key_length= table->s->reclength - table->s->null_bytes; tree_key_length= table->s->reclength - table->s->null_bytes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment