pgsql: Relocate a badly placed Assert in COPY FROM code

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Relocate a badly placed Assert in COPY FROM code
Date: 2024-08-16 22:36:45
Message-ID: E1sf5Yr-0002cq-DK@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Relocate a badly placed Assert in COPY FROM code

There's not much point in asserting a pointer isn't NULL after some code
has already dereferenced that pointer.

Adjust the code so that the Assert occurs before the pointer dereference.

The Assert probably has questionable value in the first place, but it
seems worth keeping around to document the contract between
CopyMultiInsertInfoNextFreeSlot() and its callers.

Author: Amul Sul <sulamul(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAAJ_b94hXQzXaJxTLShkxQUgezf_SUxhzX9TH2f-g6gP7bne7g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bd8fe12ef3f727ed3658daf9b26beaf2b891e9bc

Modified Files
--------------
src/backend/commands/copyfrom.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2024-08-17 01:12:20 pgsql: C comment: fix for commit b5a9b18cd0b
Previous Message Nathan Bossart 2024-08-16 20:07:15 pgsql: Further reduce dependence on -fwrapv semantics in jsonb.