pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use the properly transformed RangeVar for expandTableLikeClause(
Date: Sun, 13 Sep 2020 16:52:12 +0000
Message-ID: <E1kHVEa-0004h4-NB@gemulon.postgresql.org> (raw)

Use the properly transformed RangeVar for expandTableLikeClause().

transformCreateStmt() adjusts the transformed statement's RangeVar
to specify the target schema explicitly, for the express reason
of making sure that auxiliary statements derived by parse
transformation operate on the right table.  But the refactoring
I did in commit 502898192 got this wrong and passed the untransformed
RangeVar to expandTableLikeClause().  This could lead to assertion
failures or weird misbehavior if the wrong table was accessed.

Per report from Alexander Lakhin.  Like the previous patch, back-patch
to all supported branches.

Discussion: https://postgr.es/m/05051f9d-b32b-cb35-6735-0e9f2ab86b5f@gmail.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/783a21eff37ec2cbe44b6e88aa4edb15a151155e

Modified Files
--------------
src/backend/tcop/utility.c                      | 23 +++++++++++++++++------
src/test/regress/expected/create_table_like.out | 18 ++++++++++++++++++
src/test/regress/sql/create_table_like.sql      |  5 +++++
3 files changed, 40 insertions(+), 6 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1kHVEa-0004h4-NB@gemulon.postgresql.org>
Permalink:  ../E1kHVEa-0004h4-NB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kHVEa-0004h4-NB@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Use the properly transformed RangeVar for expandTableLikeClause(
  In-Reply-To: <E1kHVEa-0004h4-NB@gemulon.postgresql.org>
  References: <E1kHVEa-0004h4-NB@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