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: sql: fix crash with deletes in edge cases #58266

Merged
merged 1 commit into from Dec 25, 2020

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #58153.

/cc @cockroachdb/release


The execFactory itself computes the set of columns to fetch during the
DELETE operation. Previously, this was enforced by slicing up the
internal FetchCols slice of the Deleter. However, there is another
internal slice FetchColIDtoRowIndex that must be kept in sync with
FetchCols, and this was forgotten. This commit fixes this issue and
refactors the code slightly to be more explicit on how those slices are
populated.

Fixes: #54629.

Release note (bug fix): Previously, CockroachDB could crash when
performing a DELETE operation after an alteration of the primary key
when in some cases, and now it is fixed. The bug was introduced in 20.1
version.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)

The `execFactory` itself computes the set of columns to fetch during the
DELETE operation. Previously, this was enforced by slicing up the
internal `FetchCols` slice of the `Deleter`. However, there is another
internal slice `FetchColIDtoRowIndex` that must be kept in sync with
`FetchCols`, and this was forgotten. This commit fixes this issue and
refactors the code slightly to be more explicit on how those slices are
populated.

Release note (bug fix): Previously, CockroachDB could crash when
performing a DELETE operation after an alteration of the primary key
when in some cases, and now it is fixed. The bug was introduced in 20.1
version.
@yuzefovich yuzefovich merged commit 67442af into cockroachdb:release-20.2 Dec 25, 2020
@yuzefovich yuzefovich deleted the backport20.2-58153 branch December 25, 2020 18:28
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