From: Tatsuo Ishii <ishii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix multi WinGetFuncArgInFrame/Partition calls with IGNORE NULLS
Date: Wed, 22 Oct 2025 03:11:58 +0000
Message-ID: <E1vBPGY-002tEF-1X@gemulon.postgresql.org> (raw)
Fix multi WinGetFuncArgInFrame/Partition calls with IGNORE NULLS.
Previously it was mistakenly assumed that there's only one window
function argument which needs to be processed by WinGetFuncArgInFrame
or WinGetFuncArgInPartition when IGNORE NULLS option is specified. To
eliminate the limitation, WindowObject->notnull_info is modified from
"uint8 *" to "uint8 **" so that WindowObject->notnull_info could store
pointers to "uint8 *" which holds NOT NULL info corresponding to each
window function argument. Moreover, WindowObject->num_notnull_info is
changed from "int" to "int64 *" so that WindowObject->num_notnull_info
could store the number of NOT NULL info corresponding to each function
argument. Memories for these data structures will be allocated when
WinGetFuncArgInFrame or WinGetFuncArgInPartition is called. Thus no
memory except the pointers is allocated for function arguments which
do not call these functions
Also fix the set mark position logic in WinGetFuncArgInPartition to
not raise a "cannot fetch row before WindowObject's mark position"
error in IGNORE NULLS case.
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://postgr.es/m/2952409.1760023154%40sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2d7b247cb414ccbc052c485fd82a841477a7e1ff
Modified Files
--------------
src/backend/executor/nodeWindowAgg.c | 136 +++++++++++++++++++++++++----------
1 file changed, 98 insertions(+), 38 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: ishii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix multi WinGetFuncArgInFrame/Partition calls with IGNORE NULLS
In-Reply-To: <E1vBPGY-002tEF-1X@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox