• Jorgen Loland's avatar
    Bug#48920: COUNT DISTINCT returns 1 for NULL values when in a · 3dab08f1
    Jorgen Loland authored
               subquery in the select list
          
    When a dependent subquery with count(distinct <col>) was 
    evaluated multiple times, the Distinct_Aggregator was reused. 
    However, the Aggregator was not reset, so when the subquery was
    evaluated for the next record in the outer select, old dependent
    info was used.
          
    The fix is to clear() the existing aggregator in 
    Item_sum::set_aggregator(). This ensures that the aggregator is
    reevaluated with the new dependent information.
    3dab08f1
item_sum.cc 86.5 KB