[libpostgresql-jdbc-java] 07/19: binary stream patch by Kris Jurka fixes empty stream failure

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


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

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

commit 19802620f39d4b8e92f47f105ddc2b35ddeba939
Author: Dave Cramer <davec at fastcrypt.com>
Date:   Fri Dec 12 00:27:41 2003 +0000

    binary stream patch by Kris Jurka fixes empty stream failure
---
 org/postgresql/jdbc1/AbstractJdbc1Statement.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/org/postgresql/jdbc1/AbstractJdbc1Statement.java b/org/postgresql/jdbc1/AbstractJdbc1Statement.java
index 690853c..0350267 100644
--- a/org/postgresql/jdbc1/AbstractJdbc1Statement.java
+++ b/org/postgresql/jdbc1/AbstractJdbc1Statement.java
@@ -1479,6 +1479,11 @@ public abstract class AbstractJdbc1Statement implements BaseStatement
 			{
 				setBytes(parameterIndex, l_bytes);
 			}
+			// x.read will return -1 not 0 on an empty InputStream
+			else if (l_bytesRead == -1)
+			{
+				setBytes(parameterIndex, new byte[0]);
+			}
 			else
 			{
 				//the stream contained less data than they said

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