Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-20.1: sql: fix execution of non-scalar count(*) #46891

Merged

Commits on Apr 1, 2020

  1. sql: fix execution of non-scalar count(*)

    It is possible to have non-scalar aggregations with no grouping columns - this
    happens when the grouping columns are constant and reduced by the optimizer. In
    this case, we must not produce a row if the input is empty. We plumbed a scalar
    flag and type through execution, but there is a special fast path for `count(*)`
    which still relies on just checking if there are no grouping columns.
    
    This change fixes this issue and moves this logic into a helper so that the code
    is not duplicated between the row and col exec.
    
    Fixes cockroachdb#45453.
    
    Release note (bug fix): fixed incorrect result with count(*) when grouping on
    constant columns.
    RaduBerinde committed Apr 1, 2020
    Copy the full SHA
    6807591 View commit details
    Browse the repository at this point in the history