Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: allow cascading action when default is set implicitly to null
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: cockroachdb#38975 Release note (sql change): Columns without an explicit default value now support foreign keys with the SET DEFAULT action.
- Loading branch information