-
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.
39136: sql: allow cascading action when default is set implicitly to null r=tyleroberts a=tyleroberts Add support for implicitly setting the default value of a column to null, for cascading tables for both ON DELETE and ON UPDATE. The problem was in updateRows within cascader.go when the column ids were being updated for a table. If a user did not explicitly specify NULL as the default value, the default expression was dereferenced, which was null. Instead of deferencing said value, and setting it to the column id, we now just set the column id to nil if the default expression is also nil. This is the same behavior for the explicit case. Resolves: #38975 Release note (sql change): Now supports the implicit setting of NULL values for foreign keys. Co-authored-by: Tyler314 <tyler@cockroachlabs.com>
- Loading branch information
Showing
7 changed files
with
153 additions
and
46 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