forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
125282: scbuild: use proper checks when creating a virtual computed column r=Dedej-Bergin a=Dedej-Bergin This bug only existed in the declarative schema changer due to the declarative schema changer code not running checks with ReplaceColumnVars() and SanitizeVarFreeExp() like in the legacy schema changer. The fix was to add a call to b.ComputedColumnExpression() which calls schemaexpr.ValidateComputedColumnExpression which calls DequalifyAndValidateExpr which calls DequalifyAndValidateExprImpl, and that calls both ReplaceColumnVars and SanitizeVarFreeExpr. Fixes: cockroachdb#124546 Release note (bug fix): ALTER TABLE ... ADD CONSTRAINT UNIQUE will now fail with a well-formed error message and code 42601 if a statement tries to add a unique constraint on an expression. Co-authored-by: Bergin Dedej <[email protected]>
- Loading branch information
Showing
3 changed files
with
26 additions
and
40 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