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-19.2: opt: fix in-place modification of window definition in optbuilder #47716

Merged

Conversation

RaduBerinde
Copy link
Member

Backport 1/1 commits from #47715.

/cc @cockroachdb/release


The optbuilder code which handles window functions inadvertently modifies the
WindowDef in place. This leads to loss of qualification in the PARTITION BY
and ORDER BY columns (which get replaced with *scopeColumns). This is a
problem for views where the query stored in the descriptor could be invalid
without the qualification.

This change fixes this by making copies as necessary.

Fixes #47704.

Release note (bug fix): fixed case where PARTITION BY and ORDER BY columns in
window specifications were losing qualifications when used inside views.

The optbuilder code which handles window functions inadvertently modifies the
`WindowDef` in place. This leads to loss of qualification in the PARTITION BY
and ORDER BY columns (which get replaced with `*scopeColumn`s). This is a
problem for views where the query stored in the descriptor could be invalid
without the qualification.

This change fixes this by making copies as necessary.

Fixes cockroachdb#47704.

Release note (bug fix): fixed case where PARTITION BY and ORDER BY columns in
window specifications were losing qualifications when used inside views.
@RaduBerinde RaduBerinde requested a review from rytaft April 20, 2020 20:34
@RaduBerinde RaduBerinde requested a review from a team as a code owner April 20, 2020 20:34
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@blathers-crl
Copy link

blathers-crl bot commented Apr 20, 2020

❌ The GitHub CI (Cockroach) build has failed on 5f3d080d.

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

@RaduBerinde RaduBerinde merged commit 3b556da into cockroachdb:release-19.2 Apr 21, 2020
@RaduBerinde RaduBerinde deleted the backport19.2-47715 branch April 21, 2020 01:39
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.

3 participants