• unknown's avatar
    BUG#21354: (COUNT(*) = 1) not working in SELECT inside prepared · 3177e8eb
    unknown authored
               statement.
    
    The problem was that during statement re-execution if the result was
    empty the old result could be returned for group functions.
    
    The solution is to implement proper cleanup() method in group
    functions.
    
    
    mysql-test/r/ps.result:
      Add result for bug#21354: (COUNT(*) = 1) not working in SELECT inside
      prepared statement.
    mysql-test/t/func_gconcat.test:
      Add a comment that the test case is from bug#836.
    mysql-test/t/ps.test:
      Add test case for bug#21354: (COUNT(*) = 1) not working in SELECT inside
      prepared statement.
    sql/item_sum.cc:
      Call clear() in Item_sum_count::cleanup().
    sql/item_sum.h:
      Add comments.
      Add proper cleanup() methods.
      Change Item_sum::no_rows_in_result() to call clear() instead of reset(),
      as the latter also issues add(), and there is nothing to add when there
      are no rows in result.
    3177e8eb
func_gconcat.test 14.5 KB