sql: drop schemas when dropping parent database#53126
Merged
Merged
Conversation
Member
50c1b69 to
1d0b7cd
Compare
41e6415 to
639711c
Compare
Contributor
Author
|
This is ready for a review! |
Fixes cockroachdb#52362. This commit updates `DROP DATABASE CASCADE` to also clean up any child user defined schemas. Release note: None
639711c to
3551c83
Compare
thoszhang
approved these changes
Aug 24, 2020
thoszhang
left a comment
There was a problem hiding this comment.
Reviewed 5 of 5 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)
Contributor
Author
|
bors r* |
Contributor
Author
|
bors r+ |
Contributor
|
Build failed (retrying...): |
craig Bot
pushed a commit
that referenced
this pull request
Aug 24, 2020
53067: opt: add INSERT ON CONFLICT WHERE syntax for selecting arbiter indexes r=mgartner a=mgartner This commit adds support for selecting unique partial indexes as "arbiters" for `INSERT ON CONFLICT` statements. An arbiter index is a unique index that is used to detect conflicts in which to perform the `ON CONFLICT` action on. Unique partial indexes can only be used as arbiters if the arbiter predicate in the `ON CONFLICT` statement implies the partial index's predicate. To avoid parsing the same partial index predicates multiple times, this commit also adds a `parsedIndexExprs` cache to `mutationBuilder`, similar to the cache it has for default and computed column expressions. Finally, this commit also makes the parsing of `ON CONFLICT DO UPDATE` more strict. It now requires a list of conflict columns. This matches Postgres behavior. From https://www.postgresql.org/docs/12/sql-insert.html: > For ON CONFLICT DO UPDATE, a conflict_target must be provided. In Postgres, the `conflict_target` can be a list of columns or a constraint name. Cockroach currently only supports a list of column names as a conflict target, so the list of column names preceeding `DO UPDATE` is now required by the parser. Release note (sql change): An `INSERT ... ON CONFLICT DO UPDATE` statement without a list of column names after `ON CONFLICT` now results in a SQL syntax error with the error code 42601. Previously it errored with the message "there is no unqiue or exlcusion constraint matching the ON CONFLICT specification" and the error code 42P10. 53126: sql: drop schemas when dropping parent database r=rohany a=rohany Fixes #52362. This commit updates `DROP DATABASE CASCADE` to also clean up any child user defined schemas. Release note: None Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com> Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
Contributor
|
Build failed (retrying...): |
Contributor
Author
|
bors r- |
Contributor
|
Canceled. |
Contributor
Author
|
bors r+ |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #52362.
This commit updates
DROP DATABASE CASCADEto also clean up any childuser defined schemas.
Release note: None