• Olav Sandstaa's avatar
    Backporting of jorgen.loland@sun.com-20100618093212-lifp1psig3hbj6jj · 5d2f2cc1
    Olav Sandstaa authored
    from mysql-next-mr-opt-backporting.
    
    Bug#54515: Crash in opt_range.cc::get_best_group_min_max on 
               SELECT from VIEW with GROUP BY
          
    When handling the grouping items in get_best_group_min_max, the
    items need to be of type Item_field. In this bug, an ASSERT 
    triggered because the item used for grouping was an 
    Item_direct_view_ref (i.e., the group column is from a view). 
    The fix is to get the real_item since Item_ref* pointing to 
    Item_field is ok.
    
    mysql-test/r/select.result:
      Add test for BUG#54515
    mysql-test/t/select.test:
      Add test for BUG#54515
    sql/opt_range.cc:
      Get the real_item() when processing grouping items in 
      get_best_group_min_max.
    5d2f2cc1
select.result 141 KB