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

colbuilder: fix planning with no aggregate funcs in non-scalar context #87451

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

yuzefovich
Copy link
Member

Previously, in a case when the aggregator doesn't have any aggregate functions to evaluate, we would replace it with a special "fixed num tuples" operator, with the number of tuples always set to 1. But that is only correct if the aggregator is in scalar context - in the non-scalar context we should return no tuples. The bug has been present since forever, and I couldn't come up with a repro without disabling some of the optimizer rules, so it seems unlikely to occur in production, thus, there is no release note.

Fixes: #87434.

Release justification: bug fix.

Release note: None

Previously, in a case when the aggregator doesn't have any aggregate
functions to evaluate, we would replace it with a special "fixed num
tuples" operator, with the number of tuples always set to 1. But that is
only correct if the aggregator is in scalar context - in the non-scalar
context we should return no tuples. The bug has been present since
forever, and I couldn't come up with a repro without disabling some of
the optimizer rules, so it seems unlikely to occur in production, thus,
there is no release note.

Release justification: bug fix.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@mgartner mgartner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks! :lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @msirek)

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 6, 2022

Build succeeded:

@blathers-crl
Copy link

blathers-crl bot commented Sep 6, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 6543c8f to blathers/backport-release-21.2-87451: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 21.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: unoptimized, vectorized query incorrectly returns a row when it should return none
3 participants