pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix COPY FROM when database encoding is SQL_ASCII.
Date: Sun, 29 May 2022 21:08:32 +0000
Message-ID: <E1nvQ9H-001lLE-Tn@gemulon.postgresql.org> (raw)

Fix COPY FROM when database encoding is SQL_ASCII.

In the codepath when no encoding conversion is required, the check for
incomplete character at the end of input incorrectly used server
encoding's max character length, instead of the client's. Usually the
server and client encodings are the same when we're not performing
encoding conversion, but SQL_ASCII is an exception.

In the passing, also fix some outdated comments that still talked about
the old COPY protocol. It was removed in v14.

Per bug #17501 from Vitaly Voronov. Backpatch to v14 where this was
introduced.

Discussion: https://www.postgresql.org/message-id/17501-128b1dd039362ae6@postgresql.org

Branch
------
master

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

Modified Files
--------------
src/backend/commands/copyfromparse.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)



view thread (2+ messages)

Message-ID: <E1nvQ9H-001lLE-Tn@gemulon.postgresql.org>
Permalink:  ../E1nvQ9H-001lLE-Tn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nvQ9H-001lLE-Tn@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: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Fix COPY FROM when database encoding is SQL_ASCII.
  In-Reply-To: <E1nvQ9H-001lLE-Tn@gemulon.postgresql.org>
  References: <E1nvQ9H-001lLE-Tn@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