Re: BUG #17477: A crash bug in transformValuesClause()
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: "Jonathan S. Katz" <jkatz@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, krking@zju.edu.cn,
pgsql-bugs@lists.postgresql.org
Date: 2022-05-09T18:15:04Z
Lists: pgsql-bugs
On Tue, May 10, 2022 at 2:20 AM Jonathan S. Katz <jkatz@postgresql.org> wrote: > > On 5/9/22 11:25 AM, Tom Lane wrote: > > Masahiko Sawada <sawada.mshk@gmail.com> writes: > >> It seems like transformValuesClause() cannot handle properly the value > >> clause having a relation that has an empty column. Should we raise an > >> error in this case? > > > > Given that we try to support zero-column relations, I'm not sure why > > we'd insist on disallowing zero-column VALUES. I think the problem > > is that the code in transformValuesClause needs to be tweaked to > > make that work. The attached quick hack seems to do the trick. > > Agree with the reasoning. > > Confirmed reproducing the crash and that this fixes it. I did a short > double-take on the error message: > > ERROR: subquery must return only one column > > but it is accurate, given this is what the subquery must do, and zero != > one. Agreed. I've also confirmed that the patch fixes this issue and passed the regression tests. Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/
Commits
-
Fix core dump in transformValuesClause when there are no columns.
- fe20afaee8aa 15.0 landed
- ab2f78392173 14.3 landed
- 91a3a74c65f4 13.7 landed
- 90e52884edf7 12.11 landed
- 539f8c563ce7 11.16 landed
- 4eabaffcada2 10.21 landed