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

catalog: remove outdated CHECK post-deserialization changes #120008

Merged
merged 1 commit into from Mar 7, 2024

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Mar 6, 2024

This post-deserialization changes is vestigial. It is no longer
needed since during the upgrade to 23.2, all descriptors had changes
applied.

The maybeAddConstraintIDs change had a bug that caused it to clobber the
mutation of an in-progress schema change. Luckily we can just remove the
change entirely rather than fixing it.

fixes #120017

Release note (bug fix): Fixed a bug that occurred when using ALTER TABLE
to drop and re-add a CHECK constraint with the same name.

Copy link

blathers-crl bot commented Mar 6, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rafiss rafiss changed the title wip - fix add/drop check catalog: remove outdated CHECK post-deserialization changes Mar 6, 2024
@rafiss rafiss added backport-23.2.x Flags PRs that need to be backported to 23.2. backport-23.2.3-rc labels Mar 6, 2024
@rafiss rafiss marked this pull request as ready for review March 6, 2024 21:31
@rafiss rafiss requested a review from a team as a code owner March 6, 2024 21:31
@rafiss rafiss requested a review from annrpom March 6, 2024 21:32
Copy link
Contributor

@annrpom annrpom left a comment

Choose a reason for hiding this comment

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

lgtm mod some test rewrites - the tests that are failing make sense as well (i.e. we don't seem to be breaking anything we shouldn't; every test failing seems to have an assumption that we don't meet anymore)

@@ -3598,3 +3598,34 @@ CREATE UNIQUE INDEX ON public.t_118626(c) WHERE n>= 1;

statement ok
ALTER TABLE public.t_118626 ALTER PRIMARY KEY USING COLUMNS(b);

# Regression test to make sure that we can drop and re-add a CHECK constraint
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the legacy schema changer doesn't like this test - are we able to specify "do this only in dsc land" in logic tests?

Copy link
Collaborator Author

@rafiss rafiss Mar 7, 2024

Choose a reason for hiding this comment

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

there is! i have now added a skip directive here for the legacy schema changer

@rafiss rafiss requested a review from a team as a code owner March 7, 2024 05:39
@rafiss rafiss requested review from msbutler and removed request for a team March 7, 2024 05:39
@msbutler
Copy link
Collaborator

msbutler commented Mar 7, 2024

changes to backupccl look fine!

This post-deserialization changes is vestigial. It is no longer
needed since during the upgrade to 23.2, all descriptors had changes
applied.

The maybeAddConstraintIDs change had a bug that caused it to clobber the
mutation of an in-progress schema change. Luckily we can just remove the
change entirely rather than fixing it.

Release note (bug fix): Fixed a bug that occurred when using ALTER TABLE
to drop and re-add a CHECK constraint with the same name.
@rafiss
Copy link
Collaborator Author

rafiss commented Mar 7, 2024

tftr!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 7, 2024

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.2.x Flags PRs that need to be backported to 23.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: ALTER that drops and re-adds a CHECK constraint leaves table in an invalid state
4 participants