BUG #19405: Assertion in eval_windowaggregates() fails due to integer overflow
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Date: 2026-02-13T05:00:01Z
Lists: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 19405
Logged by: Alexander Lakhin
Email address: exclusion@gmail.com
PostgreSQL version: 18.2
Operating system: Ubuntu 24.04
Description:
The following script:
CREATE TABLE t (i integer);
INSERT INTO t SELECT g FROM generate_series(1, 2) g;
SELECT SUM(i) OVER (ROWS BETWEEN 1 PRECEDING AND 0x7fffffffffffffff
FOLLOWING EXCLUDE CURRENT ROW) FROM t;
triggers:
TRAP: failed Assert("aggregatedupto_nonrestarted <=
winstate->aggregatedupto"), File: "nodeWindowAgg.c", Line: 1024, PID:
3288248
ExceptionalCondition at assert.c:51:13
eval_windowaggregates at nodeWindowAgg.c:1061:31
ExecWindowAgg at nodeWindowAgg.c:2367:5
ExecProcNode at executor.h:320:1
ExecutePlan at execMain.c:1711:10
standard_ExecutorRun at execMain.c:366:3
...
Reproduced on REL_14_STABLE .. master.
Commits
-
Fix integer overflow in nodeWindowAgg.c
- 305cf0df0c78 14.23 landed
- 4da71fc37a20 15.18 landed
- 0fe032e6a666 16.14 landed
- f8736f8bc531 17.10 landed
- bfc7dff26d53 18.4 landed
- 8b6c89e377b5 19 (unreleased) landed