]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix COPY FROM when database encoding is SQL_ASCII.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sun, 29 May 2022 20:53:45 +0000 (23:53 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sun, 29 May 2022 20:57:16 +0000 (23:57 +0300)
commitf82595ac903e4e4062d909e73693dd809c6845c0
treec6171ddd8cafccb32e05f8244935db9914a1d46e
parent9f2d1946d4b41a27cb5b62da7a5f070acc62cd4e
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
src/backend/commands/copyfromparse.c