Bug #37401 One Item_sum constructor does not initialize quick_group. All others do.
Submitted: 13 Jun 2008 18:43 Modified: 10 Jul 2008 21:13
Reporter: Mark Callaghan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.0.54,5.1.24, 5.0, 5.1, 6.0 bzr OS:Any
Assigned to: CPU Architecture:Any
Tags: Constructor, Item_sum
Triage: Triaged: D3 (Medium)

[13 Jun 2008 18:43] Mark Callaghan
Description:
This constructor does not set quick_group. The other Item_constructors do. This makes things confusing for classes derived from Item_sum.

Item_sum::Item_sum(List<Item> &list) :arg_count(list.elements),
  forced_const(FALSE)
{
  if ((args=(Item**) sql_alloc(sizeof(Item*)*arg_count)))
  {
    uint i=0;
    List_iterator_fast<Item> li(list);
    Item *item;

    while ((item=li++))
    {
      args[i++]= item;
    }
  }
  mark_as_sum_func();
  list.empty();                                 // Fields are used
}

How to repeat:
Review the code

Suggested fix:
Set quick_group in this constructor.
[10 Jul 2008 21:13] Sveta Smirnova
Thank you for the report.

Verified as described.