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 ed443d8fe060b19b93353f2e39148160db59c456 Author: Kris Jurka <[email protected]> Date: Mon Jan 18 07:47:41 2010 +0000 LOB truncation didn't allow truncating to zero length because it was improperly using the positioning length checks which don't allow a zero length. Simon Kissane --- org/postgresql/jdbc2/AbstractJdbc2BlobClob.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java b/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java index 6793aec..3a12adf 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java +++ b/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java @@ -3,7 +3,7 @@ * Copyright (c) 2005-2008, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java,v 1.8 2007/09/10 08:34:53 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2BlobClob.java,v 1.9 2008/01/08 06:56:28 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -74,7 +74,15 @@ public abstract class AbstractJdbc2BlobClob if (!conn.haveMinimumServerVersion("8.3")) throw new PSQLException(GT.tr("Truncation of large objects is only implemented in 8.3 and later servers."), PSQLState.NOT_IMPLEMENTED); - assertPosition(len); + if (len < 0) + { + throw new PSQLException(GT.tr("Cannot truncate LOB to a negative length."), PSQLState.INVALID_PARAMETER_VALUE); + } + if (len > Integer.MAX_VALUE) + { + throw new PSQLException(GT.tr("PostgreSQL LOBs can only index to: {0}", new Integer(Integer.MAX_VALUE)), PSQLState.INVALID_PARAMETER_VALUE); + } + lo.truncate((int)len); } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

