-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
58053: opt, sql: add end-to-end support for uniqueness checks r=rytaft a=rytaft **opt: generalize explain output for constraint checks** This commit changes the explain output for constraint checks to say "constraint-check" rather than "fk-check" so that it can be used for uniqueness checks in addition to foreign key checks. Release note (sql change): The explain output for foreign key checks is now labeled constraint-check rather than fk-check. This change is in preparation for adding support for unique constraint checks, which will use the same label. **sql: update unique violation error to be Postgres compatible** This commit fixes the violation error for unique constraints to match the message used by Postres. Previously, the error would have been printed as: `duplicate key value (k)=(1) violates unique constraint "primary"` Now this message is printed as: ``` ERROR: duplicate key value violates unique constraint "primary" DETAIL: Key (k)=(1) already exists. ``` Release note (sql change): The error message for unique constraint violations now matches the error used by Postgres. For example, the new error message looks like this: ERROR: duplicate key value violates unique constraint "primary" DETAIL: Key (k)=(1) already exists. **opt: add end-to-end support for uniqueness checks** This commit updates the `execbuilder` to build uniqueness checks for insert and update queries when needed. It also fixes a few other bugs in the existing code that were preventing the checks from being built. As of this commit, uniqueness checks for insert and update now work end-to-end. This commit also includes a number of `execbuilder` and logic tests for uniqueness checks. There is no release note since these checks are still gated behind the `experimental_enable_unique_without_index_constraints` session variable. Informs #41535 Release note: None Co-authored-by: Rebecca Taft <[email protected]>
- Loading branch information
Showing
32 changed files
with
1,270 additions
and
103 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.