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.2: opt: do not mutate GenerateConstrainedScans input filters #55394

Merged
merged 1 commit into from
Oct 9, 2020

Conversation

mgartner
Copy link
Collaborator

@mgartner mgartner commented Oct 9, 2020

Backport 1/1 commits from #55391.

/cc @cockroachdb/release


This commit fixes a bug in GenerateConstrainedScans which can cause
incorrect query results in tables with a partial index. Filters reduced
while proving implication of a partial index would mutate the input
filters. These filters would remain mutated for future iterations over
other indexes, causing constrained scans to be created without these
necessary filters.

Fixes #55387

Release justification: This fixes a critical correctness bug for a new
feature, partial indexes.

Release note (bug fix): A bug was fixed that caused incorrect query
results on tables with partial indexes. This bug did not affect any
queries involving tables without partial indexes.

This commit fixes a bug in GenerateConstrainedScans which can cause
incorrect query results in tables with a partial index. Filters reduced
while proving implication of a partial index would mutate the input
filters. These filters would remain mutated for future iterations over
other indexes, causing constrained scans to be created without these
necessary filters.

Fixes cockroachdb#55387

Release justification: This fixes a critical correctness bug for a new
feature, partial indexes.

Release note (bug fix): A bug was fixed that caused incorrect query
results on tables with partial indexes. This bug did not affect any
queries involving tables without partial indexes.
@mgartner mgartner requested a review from a team as a code owner October 9, 2020 19:29
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde RaduBerinde merged commit 343d5d3 into cockroachdb:release-20.2 Oct 9, 2020
@mgartner mgartner deleted the backport20.2-55391 branch October 9, 2020 22:27
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.

None yet

3 participants