forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: wrap CastExpr within IndirectionExpr in a ParenExpr
Fixes cockroachdb#63097. When we type check ParenExpr, we remove the parentheses. This can cause issues for IndirectionExprs. For example, something like `('{a}'::_typ)[1]` would turn into `'{a}'::_typ[1]` after type checking, resulting in the `[1]` being interpreted as part of the type. This would result in errors when trying to use these expressions in default expressions. This patch checks for this specific case, and if it finds that there is a CastExpr within an IndirecionExpr, it will wrap it in a ParenExpr. Release note: None
- Loading branch information
1 parent
dbc9c4b
commit 6741f26
Showing
3 changed files
with
51 additions
and
1 deletion.
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