-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
*: Properly support partial UNIQUE WITHOUT INDEX referencing type descs #96681
Conversation
a5b2274
to
d5b662e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @Xiang-Gu)
pkg/sql/unique_without_index_test.go
line 53 at r1 (raw file):
tdb.Exec(t, "CREATE TYPE typ AS ENUM ('a', 'b');") tdb.Exec(t, "CREATE TABLE t (i INT PRIMARY KEY, j STRING);") tdb.Exec(t, "ALTER TABLE t ADD UNIQUE WITHOUT INDEX (j) WHERE (j::typ != 'a');")
Can you ensure that dropping the enum member fails because it's referenced by the constraint? Then ensure that it succeeds after you drop the constraint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have a release note?
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @Xiang-Gu)
d5b662e
to
7189289
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally didn't put one because this feature UNIQUE WITHOUT INDEX is hidden from users (both in code and in doc).
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)
Previously if a partial UNIQUE WITHOUT INDEX references a type descriptor in its predicate, we didn't add back-references in the type descriptor, both in the legacy and declarative schema changer. This commit fixes this. Release note: None
7189289
to
f113af3
Compare
TFTR! bors r+ |
Build succeeded: |
Previously if a partial UNIQUE WITHOUT INDEX references a type descriptor in its predicate, we didn't add back-references in the type descriptor, both in the legacy and declarative schema changer. This commit fixes this.
Fixes #96678
Release note: None