cvs: /php3 ChangeLog /php3/functions oci8.c

From: Date: Fri, 17 Sep 1999 08:18:38 +0000
Subject: cvs: /php3 ChangeLog /php3/functions oci8.c
Groups: php.dev 
Request: Send a blank email to php-dev+get-11023@lists.php.net to get a copy of this message
thies Fri Sep 17 04:18:38 1999 EDT Modified files: /php3 ChangeLog /php3/functions oci8.c Log: fix #2316 - fetching empty LOBs via OCI8 Index: php3/ChangeLog diff -u php3/ChangeLog:1.762 php3/ChangeLog:1.763 --- php3/ChangeLog:1.762 Tue Sep 14 06:29:46 1999 +++ php3/ChangeLog Fri Sep 17 04:18:37 1999 @@ -2,6 +2,7 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ???? ??, 1999, Version 3.0.13 +- OCI8 fix for fetching empty LOBs (Thies) - OCI8 supports appending and positioning when saving LOBs (Thies) - Added Mcal support (Mark Musone) - OCI8 doesn't use define callbacks any longer. (Thies) Index: php3/functions/oci8.c diff -u php3/functions/oci8.c:1.124 php3/functions/oci8.c:1.125 --- php3/functions/oci8.c:1.124 Tue Sep 14 06:29:47 1999 +++ php3/functions/oci8.c Fri Sep 17 04:18:37 1999 @@ -33,7 +33,7 @@ #define OCI8_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */ -/* $Id: oci8.c,v 1.124 1999/09/14 10:29:47 thies Exp $ */ +/* $Id: oci8.c,v 1.125 1999/09/17 08:18:37 thies Exp $ */ /* TODO list: * @@ -919,7 +919,7 @@ loblen = oci8_loaddesc(statement->conn,descr,&buffer); - if (loblen > 0) { + if (loblen >= 0) { value->type = IS_STRING; value->value.str.len = loblen; value->value.str.val = buffer; @@ -1452,6 +1452,7 @@ /* }}} */ /* {{{ oci8_loaddesc() */ + static ub4 oci8_loaddesc(oci8_connection *connection, oci8_descriptor *mydescr, char **buffer) { @@ -1467,12 +1468,18 @@ if (connection->error) { oci8_error(connection->pError, "OCILobGetLength", connection->error); - return 0; + return -1; } + *buffer = emalloc(loblen + 1); if (! buffer) { + return -1; + } + + if (loblen == 0) { + (*buffer)[ 0 ] = 0; return 0; } @@ -1485,7 +1492,7 @@ if (connection->error) { oci8_error(connection->pError, "OCILobFileOpen",connection->error); efree(buffer); - return 0; + return -1; } } @@ -1505,7 +1512,7 @@ if (connection->error) { oci8_error(connection->pError, "OCILobRead", connection->error); efree(buffer); - return 0; + return -1; } if (mydescr->type == OCI_DTYPE_FILE) { @@ -1516,7 +1523,7 @@ if (connection->error) { oci8_error(connection->pError, "OCILobFileClose", connection->error); efree(buffer); - return 0; + return -1; } } @@ -1704,6 +1711,7 @@ /* }}} */ /* {{{ oci8_open_user() + */ static oci8_session *oci8_open_user(oci8_server* server,char *username,char *password,int persistent,int exclusive) @@ -2752,7 +2760,7 @@ loblen = oci8_loaddesc(connection,descr,&buffer); - if (loblen > 0) { + if (loblen >= 0) { RETURN_STRINGL(buffer,loblen,0); } }

« previous php.dev (#11023) next »