Bug#48920: COUNT DISTINCT returns 1 for NULL values when in a
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.
Showing
Please register or sign in to comment