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: fix ALTER PRIMARY KEY with virtual columns on the table #62843

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

otan
Copy link
Contributor

@otan otan commented Mar 31, 2021

Release note (bug fix): Fix a bug where ALTER PRIMARY KEY would fail if
the table contained virtual columns.

@otan otan requested review from rafiss and a team March 31, 2021 04:34
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

yay testing!! nice find

btw, optimizer team just added VIRTUAL columns this release, so i think only the 21.1 backport is needed.

CONSTRAINT "primary" PRIMARY KEY (new_pk ASC),
UNIQUE INDEX table_with_virtual_cols_id_key (id ASC),
FAMILY fam_0_new_pk (new_pk),
FAMILY fam_1_id (id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like fam_1_id isn't expected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hehe, this randomised family stuff man

Release note (bug fix): Fix a bug where ALTER PRIMARY KEY would fail if
the table contained virtual columns.
@otan
Copy link
Contributor Author

otan commented Mar 31, 2021

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Mar 31, 2021

Build failed:

@otan
Copy link
Contributor Author

otan commented Mar 31, 2021

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Mar 31, 2021

Build succeeded:

@craig craig bot merged commit c6125c3 into cockroachdb:master Mar 31, 2021
@RaduBerinde
Copy link
Member

Nice find, thanks for fixing!

@rafiss rafiss added this to the 21.1 milestone Apr 22, 2021
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.

4 participants