Skip to content

Commit 4bb71ef

Browse files
author
Dave Cramer
committed
binary stream patch by Kris Jurka fixes empty stream failure
1 parent f9d3ed6 commit 4bb71ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.sql.Types;
2727
import java.util.Vector;
2828

29-
/* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v 1.42 2003/11/29 19:52:10 pgsql Exp $
29+
/* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v 1.43 2003/12/12 00:26:20 davec Exp $
3030
* This class defines methods of the jdbc1 specification. This class is
3131
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
3232
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@@ -1479,6 +1479,11 @@ public void setBinaryStream(int parameterIndex, InputStream x, int length) throw
14791479
{
14801480
setBytes(parameterIndex, l_bytes);
14811481
}
1482+
// x.read will return -1 not 0 on an empty InputStream
1483+
else if (l_bytesRead == -1)
1484+
{
1485+
setBytes(parameterIndex, new byte[0]);
1486+
}
14821487
else
14831488
{
14841489
//the stream contained less data than they said

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy