pgsql: Clean up range-table building in copy.c

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Clean up range-table building in copy.c
Date: 2015-01-28 22:43:39
Message-ID: E1YGbKl-0000ge-Kh@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clean up range-table building in copy.c

Commit 804b6b6db4dcfc590a468e7be390738f9f7755fb added the build of a
range table in copy.c to initialize the EState es_range_table since it
can be needed in error paths. Unfortunately, that commit didn't
appreciate that some code paths might end up not initializing the rte
which is used to build the range table.

Fix that and clean up a couple others things along the way- build it
only once and don't explicitly set it on the !is_from path as it
doesn't make any sense there (cstate is palloc0'd, so this isn't an
issue from an initializing standpoint either).

The prior commit went back to 9.0, but this only goes back to 9.1 as
prior to that the range table build happens immediately after building
the RTE and therefore doesn't suffer from this issue.

Pointed out by Robert.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f8519a6a464c92730dfa21298022f74d105f54d4

Modified Files
--------------
src/backend/commands/copy.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2015-01-29 02:47:23 pgsql: Add usebypassrls to pg_user and pg_shadow
Previous Message Stephen Frost 2015-01-28 17:33:39 pgsql: Fix column-privilege leak in error-message paths