summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2025-10-18 16:07:04 +1300
committerDavid Rowley <drowley@postgresql.org>2025-10-18 16:07:04 +1300
commit5c0a20003b4396930a354105ccf47402ca5047d2 (patch)
treed84ec284ba328d7a0a4d32ede59866b523d4f8ec /src/backend
parent86d118f9a60c6aafe1a6331fdf80455df24f32ae (diff)
Fix reset of incorrect hash iterator in GROUPING SETS queries
This fixes an unlikely issue when fetching GROUPING SET results from their internally stored hash tables. It was possible in rare cases that the hash iterator would be set up incorrectly which could result in a crash. This was introduced in 4d143509c, so backpatch to v18. Many thanks to Yuri Zamyatin for reporting and helping to debug this issue. Bug: #19078 Reported-by: Yuri Zamyatin <yuri@yrz.am> Author: David Rowley <dgrowleyml@gmail.com> Reviewed-by: Jeff Davis <pgsql@j-davis.com> Discussion: https://postgr.es/m/19078-dfd62f840a2c0766@postgresql.org Backpatch-through: 18
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/executor/nodeAgg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index a4f3d30f307..64643c3943a 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -2911,7 +2911,7 @@ agg_retrieve_hash_table_in_memory(AggState *aggstate)
perhash = &aggstate->perhash[aggstate->current_set];
- ResetTupleHashIterator(hashtable, &perhash->hashiter);
+ ResetTupleHashIterator(perhash->hashtable, &perhash->hashiter);
continue;
}