-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: Allow unique-without-index not valid constraint in table creation #115354
sql: Allow unique-without-index not valid constraint in table creation #115354
Conversation
It looks like your PR touches SQL parser code but doesn't add or edit parser tests. Please make sure you add or edit parser tests if you edit the parser. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Release note (bug fix): we fixed a bug where if we add a unique-without-index-not-valid constraint to a table, then the `create_statement` from `SHOW CREATE t` is not executable and errors with "unique constraint cannot be NOT VALID". The intention here is to disallow index-backed-unique constraint and this patch fixes that.
519e621
to
44d218c
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 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @Xiang-Gu)
-- commits
line 8 at r1:
I don't understand this last sentence
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @rytaft)
Previously, rytaft (Rebecca Taft) wrote…
I don't understand this last sentence
"index-backed-unique constraint" is the usual UNIQUE constraint (implemented by creating a unique index).
UNIQUE-WITHOUT-INDEX constraint, on the other hand, is sometimes referred to as "non-index-backed-unique constraint" bc it's not implemented by a unique index.
TFTR! bors r+ |
Previously, Xiang-Gu (Xiang Gu) wrote…
I see, I think I was just confused about what you were disallowing. I guess the point is that you're disallowing use of NOT VALID only with index-backed unique constraints. This could probably use a bit of clarification, but not a big deal. |
Build failed (retrying...): |
Build succeeded: |
Fixes #115352
Release note (bug fix): we fixed a bug where if we add a unique-without-index-not-valid constraint to a table, then the
create_statement
fromSHOW CREATE t
is not executable and errors with "unique constraint cannot be NOT VALID". The intention here is to disallow index-backed-unique constraint and this patch fixes that.