From 6b5441c30fb93353496e4a2723b063cebe372db8 Mon Sep 17 00:00:00 2001 From: "Thies C. Arntzen" Date: Sat, 7 Oct 2000 09:10:54 +0000 Subject: [PATCH] @- Fixed returning of empty LOB fields in OCI8. (Thies) --- ext/oci8/oci8.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 2d0142f2eb..0e34f4caa7 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1555,7 +1555,7 @@ static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,ub4 *loblen) { ub4 siz = 0; - ub4 readlen; + ub4 readlen = 0; char *buf; *loblen = 0; @@ -1572,7 +1572,6 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,u } } - connection->error = OCILobGetLength(connection->pServiceContext, connection->pError, @@ -1586,7 +1585,7 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,u buf = emalloc(readlen + 1); - do { + while (readlen > 0) { /* thies loop should not be entered on readlen == 0 */ connection->error = OCILobRead(connection->pServiceContext, connection->pError, @@ -1609,7 +1608,7 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,u } else { break; } - } while (1); + } if (connection->error) { oci_error(connection->pError, "OCILobRead", connection->error); -- 2.40.0