[libpostgresql-jdbc-java] 03/10: Fix an array unit test when running with the V2 protocol. With V2 we must provide the type information because it is not passed to the server.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:20:50 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL8_3_607
in repository libpostgresql-jdbc-java.

commit ac2b013cf521e5dbbf077ef76720de9a326561e5
Author: Kris Jurka <books at ejurka.com>
Date:   Tue Aug 10 20:33:59 2010 +0000

    Fix an array unit test when running with the V2 protocol.  With V2
    we must provide the type information because it is not passed to
    the server.
---
 org/postgresql/test/jdbc4/ArrayTest.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/org/postgresql/test/jdbc4/ArrayTest.java b/org/postgresql/test/jdbc4/ArrayTest.java
index 6dd3f0b..f3e46eb 100644
--- a/org/postgresql/test/jdbc4/ArrayTest.java
+++ b/org/postgresql/test/jdbc4/ArrayTest.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2007-2008, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/test/jdbc4/ArrayTest.java,v 1.2 2008/01/08 06:07:50 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/test/jdbc4/ArrayTest.java,v 1.3 2008/01/08 06:56:31 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -74,7 +74,13 @@ public class ArrayTest extends TestCase {
         if (!TestUtil.haveMinimumServerVersion(_conn, "8.2"))
             return;
 
-        PreparedStatement pstmt = _conn.prepareStatement("SELECT ?");
+        String sql = "SELECT ?";
+        // We must provide the type information for V2 protocol
+        if (TestUtil.isProtocolVersion(_conn, 2)) {
+            sql = "SELECT ?::int8[]";
+        }
+
+        PreparedStatement pstmt = _conn.prepareStatement(sql);
         String in[] = new String[2];
         in[0] = null;
         in[1] = null;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list