1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-18 17:41:14 +03:00

binary stream patch by Kris Jurka fixes empty stream failure

This commit is contained in:
Dave Cramer 2003-12-12 00:27:41 +00:00
parent 2b75042dbd
commit 6a621cac4a

View File

@ -26,7 +26,7 @@ import java.sql.Timestamp;
import java.sql.Types;
import java.util.Vector;
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.41 2003/10/29 02:39:09 davec Exp $
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.41.2.1 2003/12/12 00:27:41 davec Exp $
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@ -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