mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-13 18:07:05 +08:00
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
This commit is contained in:
@ -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
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user