pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't call simplify_aggref with a NULL PlannerInfo
Date: Sat, 29 Nov 2025 23:55:53 +0000
Message-ID: <E1vPUnB-0022e0-01@gemulon.postgresql.org> (raw)

Don't call simplify_aggref with a NULL PlannerInfo

42473b3b3 added prosupport infrastructure to allow simplification of
Aggrefs during constant-folding.  In some cases the context->root that's
given to eval_const_expressions_mutator() can be NULL.  42473b3b3 failed
to take that into account, which could result in a crash.

To fix, add a check and only call simplify_aggref() when the PlannerInfo
is set.

Author: David Rowley <dgrowleyml@gmail.com>
Reported-by: Birler, Altan <altan.birler@tum.de>
Discussion: https://postgr.es/m/132d4da23b844d5ab9e352d34096eab5@tum.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5424f4da9031ac4681ab002d20f021232070c96a

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)



Message-ID: <E1vPUnB-0022e0-01@gemulon.postgresql.org>
Permalink:  ../E1vPUnB-0022e0-01@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vPUnB-0022e0-01@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Don't call simplify_aggref with a NULL PlannerInfo
  In-Reply-To: <E1vPUnB-0022e0-01@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox