-
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
sql: add assignment casts for UPSERTs #74763
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 11 of 12 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @rytaft)
pkg/sql/opt/optbuilder/mutation_builder.go, line 724 at r1 (raw file):
} // roundDecimalValues wraps each DECIMAL-related column (including arrays of
🥳
Assignment casts are now added to query plans for upserts, including `UPSERT`, `INSERT .. ON CONFLICT DO NOTHING`, and `INSERT .. ON CONFLICT DO UPDATE ..` statements. Assignment casts are a more general form of the logic for rounding decimal values, so the use of `round_decimal_values` in mutations is no longer needed. This logic has been removed. Fixes cockroachdb#67083 There is no release note because the behavior of upserts should not change with this commit. Release note: None
7fefa78
to
e7cab43
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.
Reviewed 11 of 12 files at r1, 1 of 1 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @mgartner)
Release note: None
e7cab43
to
ec66320
Compare
TFTRs! bors r+ |
Build succeeded: |
pkg/sql/opt/optbuilder/mutation_builder.go, line 724 at r1 (raw file): Previously, RaduBerinde wrote…
I think @andy-kimball might be happy to see this complication now being naturally handled through assignment casts. |
sql: add assignment casts for UPSERTs
Assignment casts are now added to query plans for upserts, including
UPSERT
,INSERT .. ON CONFLICT DO NOTHING
, andINSERT .. ON CONFLICT DO UPDATE ..
statements.Assignment casts are a more general form of the logic for rounding
decimal values, so the use of
round_decimal_values
in mutations is nolonger needed. This logic has been removed.
Fixes #67083
There is no release note because the behavior of upserts should not
change with this commit.
Release note: None
sql: add logic tests for assignment casts of ON UPDATE expressions
Release note: None