• unknown's avatar
    Bug #21540: Subqueries with no from and aggregate functions return · 2a00a073
    unknown authored
                wrong results
     Mark the containing Item(s) (Item_subselect descendant usually) of 
     a subselect as containing aggregate functions if it has references
     to aggregates functions that are calculated outside its context.
     This tels end_send_group() not to make an Item_subselect descendant in
     select list a copy and causes the correct value being returned.
    
    
    mysql-test/r/func_group.result:
      Bug #21540: Subqueries with no from and aggregate functions return
                  wrong results
       - test cases
    mysql-test/r/subselect.result:
      Bug #21540: Subqueries with no from and aggregate functions return
                  wrong results
       - fixed the result of an existing testcase.
    mysql-test/t/subselect.test:
      Bug #21540: Subqueries with no from and aggregate functions return
                  wrong results
       - test cases
    sql/item_sum.cc:
      Bug #21540: Subqueries with no from and aggregate functions return
                  wrong results
       Mark the containing Item (Item_subselect descendant usually) of 
       a subselect as containing aggregate functions if it has references
       to aggregates functions that are calculated outside its context.
       This tels end_send_group() not to make an Item_subselect descendant in
       select list a copy and causes the correct value being returned.
    2a00a073
subselect.test 90.7 KB