From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix possible crash in add_paths_to_append_rel()
Date: Tue, 10 Oct 2023 03:50:30 +0000
Message-ID: <E1qq3lN-000stz-VC@gemulon.postgresql.org> (raw)
Fix possible crash in add_paths_to_append_rel()
While working on a8a968a82, I failed to consider that
cheapest_startup_path can be NULL when there is no non-parameterized
path in the pathlist. This is well documented in set_cheapest(), I just
failed to notice.
Here we adjust the code to just check if the RelOptInfo has a
cheapest_startup_path set before adding it to the startup_subpaths list.
Reported-by: Richard Guo
Author: Richard Guo
Discussion: https://postgr.es/m/CAMbWs49w3t03V69XhdCuw+GDwivny4uQUxrkVp6Gejaspt0wMQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/fc4089f3c65a5f1b413a3299ba02b66a8e5e37d0
Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 11 +++++++----
src/test/regress/expected/union.out | 16 ++++++++++++++++
src/test/regress/sql/union.sql | 9 ++++++++-
3 files changed, 31 insertions(+), 5 deletions(-)
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: Fix possible crash in add_paths_to_append_rel()
In-Reply-To: <E1qq3lN-000stz-VC@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