]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use the properly transformed RangeVar for expandTableLikeClause().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 13 Sep 2020 16:51:21 +0000 (12:51 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 13 Sep 2020 16:51:21 +0000 (12:51 -0400)
commitf11210013d0205381e00d749e76c5dfd63527b5a
tree937152df8cfe61ca2ecd6e55966960e1fea2b8b3
parenta089aa122bfdadd28b5e309e987b1adfff952768
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
src/backend/tcop/utility.c
src/test/regress/expected/create_table_like.out
src/test/regress/sql/create_table_like.sql