Обсуждение: Fix misuse use of window_gettupleslot function (src/backend/executor/nodeWindowAgg.c)

Поиск
Список
Период
Сортировка

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

От
Ranier Vilela
Дата:
Hi.

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).

The function "window_gettupleslot" can fail.

All other calls check the return, In this case it could not be different.

Fix by checking the return and reporting a message to the user,
in case of failure.
The error message, however, I'm not sure if it's ideal.

best regards,
Ranier Vilela

Вложения
Ranier Vilela <ranier.vf@gmail.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