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

Bug Report: schemadiff: will not drop a duplicate FK/CHECK constraint in ConstraintNamesIgnoreAll|ConstraintNamesIgnoreVitess #14386

Closed
shlomi-noach opened this issue Oct 29, 2023 · 0 comments · Fixed by #14387
Assignees
Labels

Comments

@shlomi-noach
Copy link
Contributor

Overview of the Issue

Given these two tables:

create table t1 (id int primary key, i int, constraint `chk1` CHECK ((`i` > 2)), constraint `chk2` CHECK ((`i` > 2)));

create table t2 (id int primary key, i int, constraint `chk1` CHECK ((`i` > 2)));

Diffing the two, we expect to see a diff of

DROP CONSTRAINT `chk2`

However, with DiffHints.ConstraintNamesStrategy being ConstraintNamesIgnoreAll or ConstraintNamesIgnoreVitess, it's possible to get an empty diff. Specifically, using ConstraintNamesIgnoreAll on the above leads to an empty diff.

schemadiff should identify the scenario where there's two different constraints, even if it ignores their names.

Reproduction Steps

Binary Version

18, 17, 16

Operating System and Environment details

-

Log Fragments

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant