Only in src/: TestQueryWithNullArgument.java
diff -ru old/org/postgresql/jdbc2/AbstractJdbc2Connection.java src/org/postgresql/jdbc2/AbstractJdbc2Connection.java
--- old/org/postgresql/jdbc2/AbstractJdbc2Connection.java 2013-09-10 19:59:31.661212020 +0300
+++ src/org/postgresql/jdbc2/AbstractJdbc2Connection.java 2013-09-10 19:56:39.161203807 +0300
@@ -228,9 +228,15 @@
bindStringAsVarchar = haveMinimumCompatibleVersion("8.0");
}
+ int timestamp_oid;
+ timestamp_oid = Oid.UNSPECIFIED; // Default
+ if ("with_timezone".equals(info.getProperty("timestamp")))
+ timestamp_oid = Oid.TIMESTAMPTZ;
+ if ("without_timezone".equals(info.getProperty("timestamp")))
+ timestamp_oid = Oid.TIMESTAMP;
// Initialize timestamp stuff
timestampUtils = new TimestampUtils(haveMinimumServerVersion("7.4"), haveMinimumServerVersion("8.2"),
- !protoConnection.getIntegerDateTimes());
+ !protoConnection.getIntegerDateTimes(), timestamp_oid);
// Initialize common queries.
commitQuery = getQueryExecutor().createSimpleQuery("COMMIT");
diff -ru old/org/postgresql/jdbc2/AbstractJdbc2Statement.java src/org/postgresql/jdbc2/AbstractJdbc2Statement.java
--- old/org/postgresql/jdbc2/AbstractJdbc2Statement.java 2013-09-10 19:59:44.405212627 +0300
+++ src/org/postgresql/jdbc2/AbstractJdbc2Statement.java 2013-09-10 20:03:43.781224024 +0300
@@ -3315,7 +3315,8 @@
// we're actually dealing with, UNSPECIFIED seems the lesser evil, even if it
// does give more scope for type-mismatch errors being silently hidden.
- bindString(i, connection.getTimestampUtils().toString(cal, t), Oid.UNSPECIFIED); // Let the server infer the right type.
+ TimestampUtils utils = connection.getTimestampUtils();
+ bindString(i, utils.toString(cal, t), utils.timestampOid); // Let the server infer the right type.
}
// ** JDBC 2 Extensions for CallableStatement**
diff -ru old/org/postgresql/jdbc2/TimestampUtils.java src/org/postgresql/jdbc2/TimestampUtils.java
--- old/org/postgresql/jdbc2/TimestampUtils.java 2013-09-10 19:59:11.905211079 +0300
+++ src/org/postgresql/jdbc2/TimestampUtils.java 2013-09-10 20:07:20.785234356 +0300
@@ -47,10 +47,27 @@
*/
private final boolean usesDouble;
+ /**
+ * OID to use for {@link Timestamp} type.
+ * Must be one of:
+ *