[libpostgresql-jdbc-java] 20/22: A previous test to ensure sane behavior in the presence of null bytes didn't work for the V2 protocol because that error happens earlier than in the V3 case.

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


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

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

commit e8dff84e49919ed1629fcf0c4ad16afbd1297b93
Author: Kris Jurka <books at ejurka.com>
Date:   Sat May 1 20:49:22 2010 +0000

    A previous test to ensure sane behavior in the presence of null
    bytes didn't work for the V2 protocol because that error happens
    earlier than in the V3 case.
---
 org/postgresql/test/jdbc2/BatchExecuteTest.java | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/org/postgresql/test/jdbc2/BatchExecuteTest.java b/org/postgresql/test/jdbc2/BatchExecuteTest.java
index b5dac63..797f16f 100644
--- a/org/postgresql/test/jdbc2/BatchExecuteTest.java
+++ b/org/postgresql/test/jdbc2/BatchExecuteTest.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2004-2008, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java,v 1.16 2008/01/08 06:56:30 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java,v 1.16.4.1 2010/02/04 00:48:54 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -290,14 +290,13 @@ public class BatchExecuteTest extends TestCase
 
         PreparedStatement pstmt = con.prepareStatement("INSERT INTO batchstring VALUES (?)");
 
-        pstmt.setString(1, "a");
-        pstmt.addBatch();
-        pstmt.setString(1, "\u0000");
-        pstmt.addBatch();
-        pstmt.setString(1, "b");
-        pstmt.addBatch();
-
         try {
+            pstmt.setString(1, "a");
+            pstmt.addBatch();
+            pstmt.setString(1, "\u0000");
+            pstmt.addBatch();
+            pstmt.setString(1, "b");
+            pstmt.addBatch();
             pstmt.executeBatch();
             fail("Should have thrown an exception.");
         } catch (SQLException sqle) {

-- 
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