opt: assignment casts of non-equivalent types in DEFAULT and ON UPDATE #81863
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit allows the optimizer to build assignment casts for
DEFAULT
and
ON UPDATE
expressions that have types that are not equivalent withtheir column's type. If the cast from the
DEFAULT
orON UPDATE
expression type to the column type is not a valid assignment cast, an
error is returned. In practice, this error should never occur because 1)
it is currently impossible to create
DEFAULT
andON UPDATE
expressions that do not match their column's type (the tests here get
around this limitation because they use the optimizer test catalog which
has much looser restrictions) and 2) a future PR will allow creating
DEFAULT
andON UPDATE
expressions that do not match their column'stype only if the cast from the expression type to the column type is a
valid assignment cast.
Unblocks #81071
Release note: None