diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 05:05:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 05:05:20 +0000 |
commit | a14b88819a8a22da4f5abb19a3b1b61aebb10a7c (patch) | |
tree | 45f36cde15c9ff8c45d9efbaa7b02426ca984121 /src/backend/utils/adt/int8.c | |
parent | Adding debian version 15.6-0+deb12u1. (diff) | |
download | postgresql-15-a14b88819a8a22da4f5abb19a3b1b61aebb10a7c.tar.xz postgresql-15-a14b88819a8a22da4f5abb19a3b1b61aebb10a7c.zip |
Merging upstream version 15.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/backend/utils/adt/int8.c')
-rw-r--r-- | src/backend/utils/adt/int8.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/backend/utils/adt/int8.c b/src/backend/utils/adt/int8.c index 98d4323..464b64b 100644 --- a/src/backend/utils/adt/int8.c +++ b/src/backend/utils/adt/int8.c @@ -833,6 +833,21 @@ int8inc_support(PG_FUNCTION_ARGS) SupportRequestWFuncMonotonic *req = (SupportRequestWFuncMonotonic *) rawreq; MonotonicFunction monotonic = MONOTONICFUNC_NONE; int frameOptions = req->window_clause->frameOptions; + WindowFunc *wfunc = req->window_func; + + if (list_length(wfunc->args) == 1) + { + Node *expr = eval_const_expressions(NULL, linitial(wfunc->args)); + + /* + * Due to the Node representation of WindowClause runConditions in + * version prior to v17, we need to insist that the count arg is + * Const to allow safe application of the runCondition + * optimization. + */ + if (!IsA(expr, Const)) + PG_RETURN_POINTER(NULL); + } /* No ORDER BY clause then all rows are peers */ if (req->window_clause->orderClause == NIL) |