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 typed Array within IndirectionExpr in ParenExpr
This patch adds a case that cockroachdb#63103 missed. When we have something like `ARRAY['a'::typ, 'b'::typ]`, we format it to `ARRAY['a'::typ, 'b'::typ]:::public.typ[]`. This causes issues if used in an `IndirectionExpr`, such as `ARRAY['a'::typ, 'b'::typ]:::public.typ[][1]`, as the `[1]` is 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 instead formats it as `(ARRAY['a'::typ, 'b'::typ]:::public.typ[])[1]`. Release note: None
- Loading branch information
1 parent
3f02489
commit 8156a5d
Showing
3 changed files
with
34 additions
and
3 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