-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opt: implement ON DELETE SET NULL/DEFAULT #48831
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @andy-kimball and @RaduBerinde)
pkg/sql/opt/optbuilder/testdata/fk-on-delete-set-default, line 113 at r1 (raw file):
CREATE TABLE child_multicol ( c INT PRIMARY KEY, p INT DEFAULT (c), q INT DEFAULT (p + 1), r INT DEFAULT (p+q),
[nit] inconsistent formatting of the scalar expressions
pkg/sql/opt/optbuilder/testdata/fk-on-delete-set-null, line 6 at r1 (raw file):
exec-ddl CREATE TABLE child (c INT PRIMARY KEY, p INT REFERENCES parent(p) ON DELETE SET NULL)
how will match simple v. match full interact with this? is it worth adding some tests?
1f03233
to
4fcdf50
Compare
Implementing the ON DELETE SET NULL and SET DEFAULT actions. These actions trigger an update in the child table whenever a row is deleted from the parent. Release note: None
4fcdf50
to
da525b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
bors r+
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @andy-kimball and @rytaft)
pkg/sql/opt/optbuilder/testdata/fk-on-delete-set-default, line 113 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
[nit] inconsistent formatting of the scalar expressions
Done.
pkg/sql/opt/optbuilder/testdata/fk-on-delete-set-null, line 6 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
how will match simple v. match full interact with this? is it worth adding some tests?
There is no difference in the cascade - any rows that had any NULLs on the FK columns will not match in the semi-join so will not result in any cascades.
Build failed |
bors r+ |
Build succeeded |
Implementing the ON DELETE SET NULL and SET DEFAULT actions. These actions
trigger an update in the child table whenever a row is deleted from the parent.
Release note: None