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

sql/schemachanger: fixed a ordial number bug in ALTER PRIMARY KEY #86192

Conversation

Xiang-Gu
Copy link
Contributor

Previously, we had a bug in ALTER PRIMARY KEY such that when the new
primary key is a superset of the old primary key, we incorrectly gave
ordinal numbers to IndexColumn elements. This PR fixed it and added
a few logic tests for cases when the new primary key intersects with
the old primary key.

Fixes: #85877

Release note: None

Release justification: fixed a bug that was revealed in roachtest
failure (issue #85877)

Previously, we had a bug in ALTER PRIMARY KEY such that when the new
primary key is a superset of the old primary key, we incorrectly gave
ordinal numbers to IndexColumn elements. This PR fixed it and added
a few logic tests for cases when the new primary key intersects with
the old primary key.

Fixes: cockroachdb#85877

Release note: None

Release justification: fixed a bug that was revealed in roachtest
failure (issue cockroachdb#85877)
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm:

This feels like the sort of bug that randomized testing would catch quickly. We should add support for ALTER PRIMARY KEY to that thing. I filed #86199.

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

@Xiang-Gu Xiang-Gu marked this pull request as ready for review August 16, 2022 15:23
@Xiang-Gu Xiang-Gu requested a review from a team August 16, 2022 15:23
@Xiang-Gu
Copy link
Contributor Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 16, 2022

Build succeeded:

@craig craig bot merged commit aed288d into cockroachdb:master Aug 16, 2022
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.

roachtest: alterpk-bank failed
3 participants