]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Make ExecForPortionOfLeftovers() obey SRF protocol.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 Apr 2026 14:21:52 +0000 (10:21 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 Apr 2026 14:21:52 +0000 (10:21 -0400)
commit207cb2abcba00f78d57cdaca896f41c9453b0f2f
tree683e15dc51963caa6aa8899afd483b9eb98b2c0d
parent5dbb63fc82b72ccc6f9e7be0361efdeee5deeb50
Make ExecForPortionOfLeftovers() obey SRF protocol.

Before each call to the SRF, initialize isnull and isDone, as per the
comments for struct ReturnSetInfo.  This fixes a Coverity warning
about rsi.isDone not being initialized.  The built-in
{multi,}range_minus_multi functions don't return without setting it,
but a user-supplied function might not be as accommodating.

We also add statistics tracking around the function call, which
will be expected once user-defined withoutPortionProcs functions
are supported, and a cross-check on rsi.returnMode just for
paranoia's sake.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Co-authored-by: Paul A Jungwirth <pj@illuminatedcomputing.com>
Discussion: https://postgr.es/m/4126231.1776622202@sss.pgh.pa.us
src/backend/executor/nodeModifyTable.c