• unknown's avatar
    Fixed bug #29104: assertion abort for grouping queries using views. · 45e5f9f3
    unknown authored
    The abort happened when a query contained a conjunctive predicate
    of the form 'view column = constant' in the WHERE condition and 
    the grouping list also contained a reference to a view column yet
    a different one.
    
    Removed the failing assertion as invalid in a general case.
    
    Also fixed a bug that prevented applying some optimization for grouping
    queries using views. If the WHERE condition of such a query contains
    a conjunctive condition of the form 'view column = constant' and
    this view column is used in the grouping list then grouping by this
    column can be eliminated. The bug blocked performing this elimination.
    
    
    mysql-test/r/view.result:
      Added a test case for bug #29104.
    mysql-test/t/view.test:
      Added a test case for bug #29104.
    sql/item.cc:
      Fixed bug #29104: assertion abort for grouping queries using views.
      The abort happened when a query contained a conjunctive predicate
      of the form 'view column = constant' in the WHERE condition and 
      the grouping list also contained a reference to a view column yet
      a different one.
      
      Removed the failing assertion as invalid in a general case.
      
      Also fixed a bug that prevented applying some optimization for grouping
      queries using views. If the WHERE condition of such a query contains
      a conjunctive condition of the form 'view column = constant' and
      this view column is used in the grouping list then grouping by this
      column can be eliminated. The bug blocked performing this elimination.
      This bug was in the function Item_field::eq while the failing
      assertion was in the function Item_direct_view_ref::eq.
    45e5f9f3
view.result 101 KB