Fix core dump in transformValuesClause when there are no columns.
authorTom Lane <[email protected]>
Mon, 9 May 2022 18:15:37 +0000 (14:15 -0400)
committerTom Lane <[email protected]>
Mon, 9 May 2022 18:15:37 +0000 (14:15 -0400)
commit4eabaffcada25206c3f8f89f7cb0b27ffb9372bc
tree6e743287106d29f782bb092e9436cc8c3c7ca68a
parent86a21803c7d860bd0cbd8c81c34cc9250d4cc173
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
src/backend/parser/analyze.c
src/test/regress/expected/select.out
src/test/regress/sql/select.sql