Re: Fix misuse use of window_gettupleslot function (src/backend/executor/nodeWindowAgg.c)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix misuse use of window_gettupleslot function (src/backend/executor/nodeWindowAgg.c)
Date: 2025-10-05 16:05:01
Message-ID: 1687327.1759680301@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:
> Per Coverity.
> CID 1635309: (#1 of 1): Unchecked return value (CHECKED_RETURN)
> 7. check_return: Calling window_gettupleslot without checking return value
> (as is done elsewhere 8 out of 9 times).

Yeah, the security team's Coverity instance just whined about that
too. But isn't the correct behavior simply "return -1"? It looks
to me like a failure should be interpreted as "row doesn't exist,
therefore it's not in frame".

What would be really useful is a test case that reaches this
condition. That would make it plain what to do.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-10-05 16:20:30 Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options
Previous Message Tom Lane 2025-10-05 15:59:17 Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options