]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix reset of incorrect hash iterator in GROUPING SETS queries
authorDavid Rowley <drowley@postgresql.org>
Sat, 18 Oct 2025 03:07:41 +0000 (16:07 +1300)
committerDavid Rowley <drowley@postgresql.org>
Sat, 18 Oct 2025 03:07:41 +0000 (16:07 +1300)
commit0b6a02f0355c8950ffe22b52eac86f6261e19caf
treed9b3228b5327d8123f00661a5346214239587126
parentaa151022ec13f6a24f70c30dbfb9a5747db620e8
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
src/backend/executor/nodeAgg.c
src/include/lib/simplehash.h