[libpostgresql-jdbc-java] 04/11: When the driver asks the server to resolve a type the resolved type is stored in the SimpleQuery object. When the statement is executed again the driver determines whether the existing types match or if it needs to be reprepared by comparing the current Statement's settings with the SimpleQuery. The Statement will have the unspecified oid while the SimpleQuery will have the resolved oid, so there will not be a match and the statement will needlessly be reprepared. Allow an unspecified oid to match any resolved type.

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


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

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

commit 622438427ea9e6a77d3fbf2fcea45e6dbb29f713
Author: Kris Jurka <books at ejurka.com>
Date:   Sun Aug 6 18:02:54 2006 +0000

    When the driver asks the server to resolve a type the resolved type
    is stored in the SimpleQuery object.  When the statement is executed
    again the driver determines whether the existing types match or if
    it needs to be reprepared by comparing the current Statement's
    settings with the SimpleQuery.  The Statement will have the
    unspecified oid while the SimpleQuery will have the resolved oid, so
    there will not be a match and the statement will needlessly be
    reprepared.  Allow an unspecified oid to match any resolved type.
    
    Reported by Akira Sato.
---
 org/postgresql/core/v3/SimpleQuery.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org/postgresql/core/v3/SimpleQuery.java b/org/postgresql/core/v3/SimpleQuery.java
index d3a8beb..b3e70b2 100644
--- a/org/postgresql/core/v3/SimpleQuery.java
+++ b/org/postgresql/core/v3/SimpleQuery.java
@@ -4,7 +4,7 @@
 * Copyright (c) 2004, Open Cloud Limited.
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/core/v3/SimpleQuery.java,v 1.9 2005/07/04 18:50:29 davec Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/core/v3/SimpleQuery.java,v 1.9.2.1 2006/04/26 20:07:07 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -91,7 +91,7 @@ class SimpleQuery implements V3Query {
 
         // Check for compatible types.
         for (int i = 0; i < paramTypes.length; ++i)
-            if (paramTypes[i] != preparedTypes[i])
+            if (paramTypes[i] != 0 && paramTypes[i] != preparedTypes[i])
                 return false;
 
         return true;

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