From 8303f3daf7ef3e8c56602490f01b268e96504bc5 Mon Sep 17 00:00:00 2001 From: Vallimaharajan Date: Wed, 13 Nov 2024 20:26:00 +0530 Subject: [PATCH] Skip partition immediately after run condition failure in WINDOWAGG_PASSTHROUGH_STRICT mode --- src/backend/executor/nodeWindowAgg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 51a6708a39..ec13a9e030 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -2206,9 +2206,11 @@ ExecWindowAgg(PlanState *pstate) */ spool_tuples(winstate, winstate->currentpos); - /* Move to the next partition if we reached the end of this partition */ + /* Move to the next partition if we reached the end of this partition or + * if we are in STRICT pass-through mode */ if (winstate->partition_spooled && - winstate->currentpos >= winstate->spooled_rows) + (winstate->currentpos >= winstate->spooled_rows || + winstate->status == WINDOWAGG_PASSTHROUGH_STRICT)) { release_partition(winstate); -- 2.34.1