From 74aaae04841f6ff60e6ee36c7ba5e0fccae8a156 Mon Sep 17 00:00:00 2001 From: Ryan Holdren Date: Sat, 12 Aug 2017 20:24:03 -0700 Subject: [PATCH 1/2] Fix data access by field index in PgRow --- src/main/java/com/github/pgasync/impl/PgConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/pgasync/impl/PgConnection.java b/src/main/java/com/github/pgasync/impl/PgConnection.java index efc42e8..4c5a671 100644 --- a/src/main/java/com/github/pgasync/impl/PgConnection.java +++ b/src/main/java/com/github/pgasync/impl/PgConnection.java @@ -17,7 +17,7 @@ import static com.github.pgasync.impl.message.RowDescription.ColumnDescription; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CountDownLatch; @@ -184,7 +184,7 @@ public void onCompleted() { } static Map getColumns(ColumnDescription[] descriptions) { - Map columns = new HashMap<>(); + Map columns = new LinkedHashMap<>(); for (int i = 0; i < descriptions.length; i++) { columns.put(descriptions[i].getName().toUpperCase(), new PgColumn(i, descriptions[i].getType())); } From fe19b1bd2030fe8dadb94a4958a130c7d436a134 Mon Sep 17 00:00:00 2001 From: Ryan Holdren Date: Fri, 19 Jan 2018 18:16:59 -0800 Subject: [PATCH 2/2] Fix bug where errors are swallowed if the message is longer than 255 characters --- pom.xml | 2 +- .../java/com/github/pgasync/impl/io/ErrorResponseDecoder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fce3351..6fdb629 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.github.alaisi.pgasync postgres-async-driver - 0.10-SNAPSHOT + 0.10.ryan postgres-async-driver Asynchronous PostgreSQL Java driver diff --git a/src/main/java/com/github/pgasync/impl/io/ErrorResponseDecoder.java b/src/main/java/com/github/pgasync/impl/io/ErrorResponseDecoder.java index 27d0af1..392607c 100644 --- a/src/main/java/com/github/pgasync/impl/io/ErrorResponseDecoder.java +++ b/src/main/java/com/github/pgasync/impl/io/ErrorResponseDecoder.java @@ -52,7 +52,7 @@ public ErrorResponse read(ByteBuffer buffer) { String code = null; String message = null; - byte[] field = new byte[255]; + byte[] field = new byte[2048]; for (byte type = buffer.get(); type != 0; type = buffer.get()) { String value = getCString(buffer, field); if (type == (byte) 'S') {