[pgjdbc/pgjdbc] dbb30a: Fix PGCopyOutputStream out of order writes (#1854)

Поиск
Список
Период
Сортировка
Искать

[pgjdbc/pgjdbc] dbb30a: Fix PGCopyOutputStream out of order writes (#1854)

От:
Sehrope Sarkuni <noreply@github.com>
Дата:
  Branch: refs/heads/master
  Home:   https://github.com/pgjdbc/pgjdbc
  Commit: dbb30af18e2dccb6e49040dd3108245935605340
      https://github.com/pgjdbc/pgjdbc/commit/dbb30af18e2dccb6e49040dd3108245935605340
  Author: Sehrope Sarkuni 
  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.




FAQ