From: Sehrope Sarkuni <noreply@github.com>
To: pgsql-jdbc@lists.postgresql.org
Subject: [pgjdbc/pgjdbc] dbb30a: Fix PGCopyOutputStream out of order writes (#1854)
Date: Thu, 12 Nov 2020 06:03:13 -0800
Message-ID: <pgjdbc/pgjdbc/push/refs/heads/master/375cb3-dbb30a@github.com> (raw)
Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: dbb30af18e2dccb6e49040dd3108245935605340
https://github.com/pgjdbc/pgjdbc/commit/dbb30af18e2dccb6e49040dd3108245935605340
Author: Sehrope Sarkuni <sehrope@jackdb.com>
Date: 2020-11-12 (Thu, 12 Nov 2020)
Changed paths:
M pgjdbc/src/main/java/org/postgresql/copy/PGCopyOutputStream.java
M pgjdbc/src/test/java/org/postgresql/test/TestUtil.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/CopyTest.java
Log Message:
-----------
Fix PGCopyOutputStream out of order writes (#1854)
* test: Add TestUtil.queryForString(...) helper
Adds a helper method to execute a query and reads a single text column as a string.
* test: Add failing test for interleaved usage of PGCopyOutputStream APIs
Adds a failing test that writes to a PGCopyOutputStream using both the write(byte[])
and write(ByteStreamWriter) APIs to catch internal buffering breaking the order.
* fix: Flush PGCopyOutputStream internal buffer before writing via ByteStreamWriter
Fixes out of order writes when interleaving writes using buffered write(byte[]) and
writeToCopy(ByteStreamWriter) APIs.
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-jdbc@postgresql.org
Cc: noreply@github.com
Subject: Re: [pgjdbc/pgjdbc] dbb30a: Fix PGCopyOutputStream out of order writes (#1854)
In-Reply-To: <pgjdbc/pgjdbc/push/refs/heads/master/375cb3-dbb30a@github.com>
References: <pgjdbc/pgjdbc/push/refs/heads/master/375cb3-dbb30a@github.com>
* 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