-
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.
opt: Fix UPDATE error when constraint is used with computed column
The following statement fails with an ambiguous column name error: CREATE TABLE t (a INT, b INT AS (a + 1) STORED, CONSTRAINT ck CHECK (b > 0)); UPDATE t SET a = 123 WHERE a = 456; The problem is that the input scope for the constraint expression contains two versions of column "b", namely the column containing the existing value of "b" and the column containing the updated value of "b". The fix is to clear the name of the existing value so that the constraint expression binds unambiguously to the updated value. Fixes #34649 Release note: None
- Loading branch information
1 parent
72edf20
commit be12e8f
Showing
7 changed files
with
456 additions
and
307 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
Oops, something went wrong.