[libpostgresql-jdbc-java] 05/08: When setNull is called with a TIME or TIMESTAMP type we cannot pass that type information on to the backend because we really don't know whether it is with or without a time zone. For a NULL value it doesn't matter, but we can't establish a type because a later call with a non-null value using the same PreparedStatement can potentially end up using a specific type that is incorrect.

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


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

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

commit fbeba014d7eb7468b0e5cb3a2dc3ed97e02d5dba
Author: Kris Jurka <books at ejurka.com>
Date:   Sat May 1 16:08:09 2010 +0000

    When setNull is called with a TIME or TIMESTAMP type we cannot pass
    that type information on to the backend because we really don't know
    whether it is with or without a time zone.  For a NULL value it
    doesn't matter, but we can't establish a type because a later call
    with a non-null value using the same PreparedStatement can
    potentially end up using a specific type that is incorrect.
    
    Per example from Martti Jeenicke
---
 org/postgresql/jdbc2/AbstractJdbc2Statement.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
index 31113d6..9625132 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2004-2005, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.96.2.8 2009/05/27 23:55:35 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.96.2.9 2009/09/26 15:21:40 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -1068,10 +1068,8 @@ public abstract class AbstractJdbc2Statement implements BaseStatement
             oid = Oid.DATE;
             break;
         case Types.TIME:
-            oid = Oid.TIME;
-            break;
         case Types.TIMESTAMP:
-            oid = Oid.TIMESTAMPTZ;
+            oid = Oid.UNSPECIFIED;
             break;
         case Types.BIT:
             oid = Oid.BOOL;

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