Fix Coverity issue reported in commit 2273fa32bce.
authorTatsuo Ishii <ishii@postgresql.org>
Sun, 19 Oct 2025 00:29:26 +0000 (09:29 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Sun, 19 Oct 2025 00:29:26 +0000 (09:29 +0900)
commitdd766a441d69d16d1c8ab0d3a41a10649702d202
tree364759d853bdb08f809fb72c3a99efdaccfe92c6
parente533524b23b8dd504d38c09c9f84b38289ca635d
Fix Coverity issue reported in commit 2273fa32bce.

Coverity complains that the return value from gettuple_eval_partition
(stored in variable "datum") in a do..while loop in
WinGetFuncArgInPartition is overwritten when exiting the while
loop. This commit tries to fix the issue by changing the
gettuple_eval_partition call to:

(void) gettuple_eval_partition()

explicitly stating that we discard the return value. We are just
interested in whether we are inside or outside of partition, NULL or
NOT NULL here.

Also enhance some comments for easier code reading.

Reported-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/aPCOabSE4VfJLaky%40paquier.xyz
src/backend/executor/nodeWindowAgg.c