-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opt/optbuilder: check for coercibility instead of tuple types
This commit changes the handling of tuple-returning routines to mirror that of postgres. In particular, when the routine return type is a tuple, postgres first attempts to coerce result columns to the return type of the routine. Only if that attempt fails, postgres wraps the result column in a tuple, and again attempts the coercion. This change affects the handling of routines that return (for example) a single composite-typed column. For example, the following two logic tests should produce the same result: ``` statement ok CREATE TYPE two_typ AS (x INT, y INT); CREATE FUNCTION f() RETURNS two_typ LANGUAGE SQL AS $$ SELECT 1, 2; $$; query T SELECT f(); ---- (1,2) ``` vs ``` statement ok CREATE TYPE two_typ AS (x INT, y INT); CREATE FUNCTION f() RETURNS two_typ LANGUAGE SQL AS $$ SELECT ROW(1, 2); $$; query T SELECT f(); ---- (1,2) ``` There is not release note, since this shouldn't affect versions prior to 24.1. Fixes #120942 Release note: None
- Loading branch information
1 parent
87ff7dd
commit 8b86dce
Showing
7 changed files
with
272 additions
and
90 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
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
Oops, something went wrong.