pgsql: Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.
Date: 2021-06-18 16:09:41
Message-ID: E1luH3t-0002qj-6Q@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.

This works fine in the "simple Query" code path; but if the
statement is in the plan cache then it's corrupted for future
re-execution. Apply copyObject() to protect the original
tree from modification, as we've done elsewhere.

This narrow fix is applied only to the back branches. In HEAD,
the problem was fixed more generally by commit 7c337b6b5; but
that changed ProcessUtility's API, so it's infeasible to
back-patch.

Per bug #17053 from Charles Samborski.

Discussion: https://postgr.es/m/931771.1623893989@sss.pgh.pa.us
Discussion: https://postgr.es/m/17053-3ca3f501bbc212b4@postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1a3d30255a4e821445927ca0949f00364de660fd

Modified Files
--------------
src/backend/commands/typecmds.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2021-06-18 17:24:32 Re: pgsql: s/table_close/heap_close/ in v11.
Previous Message Tom Lane 2021-06-18 15:45:48 pgsql: s/table_close/heap_close/ in v11.