forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree: apply casts in typeCheckSameTypedExprs for non-equivalent types
Function typeCheckSameTypedExprs is updated by cockroachdb#108387 and cockroachdb#109635 to apply implicit CASTs to the different expressions input to an array, tuple, case expression or other similar expression, to coerce them all to a common data type, instead of erroring out. This is not done, however, if the data types of these expressions are not equivalent with each other, causing some cases to error out. The fix is to match Postgres behavior and apply the casts even for non-equivalent types. Informs: cockroachdb#109105 Release note (sql change): This patch modifies type checking of arrays, tuples, and case statements to allow implicit casting of scalar expressions referenced in these constructs to a common data type, even for types in different type families, as long at the implicit cast is legal.
- Loading branch information
Mark Sirek
committed
Sep 10, 2023
1 parent
9e526be
commit adf7103
Showing
3 changed files
with
82 additions
and
21 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