diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-05-09 14:15:37 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-05-09 14:15:37 -0400 |
commit | 539f8c563ce70cecb1d45f026015162ca52c7306 (patch) | |
tree | c2a8756715db3c7b69e380708d121de3618f601a /src/test/regress/sql/select.sql | |
parent | c0406fa768edd6b9e4bb543b04c871cd80f03934 (diff) | |
download | postgresql-539f8c563ce70cecb1d45f026015162ca52c7306.tar.gz postgresql-539f8c563ce70cecb1d45f026015162ca52c7306.zip |
Fix core dump in transformValuesClause when there are no columns.
The parser code that transformed VALUES from row-oriented to
column-oriented lists failed if there were zero columns.
You can't write that straightforwardly (though probably you
should be able to), but the case can be reached by expanding
a "tab.*" reference to a zero-column table.
Per bug #17477 from Wang Ke. Back-patch to all supported branches.
Discussion: https://postgr.es/m/17477-0af3c6ac6b0a6ae0@postgresql.org
Diffstat (limited to 'src/test/regress/sql/select.sql')
-rw-r--r-- | src/test/regress/sql/select.sql | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/regress/sql/select.sql b/src/test/regress/sql/select.sql index fdab06d5bc1..0b040abba9e 100644 --- a/src/test/regress/sql/select.sql +++ b/src/test/regress/sql/select.sql @@ -148,6 +148,11 @@ SELECT 2+2, 57 UNION ALL TABLE int8_tbl; +-- corner case: VALUES with no columns +CREATE TEMP TABLE nocols(); +INSERT INTO nocols DEFAULT VALUES; +SELECT * FROM nocols n, LATERAL (VALUES(n.*)) v; + -- -- Test ORDER BY options -- |