cvs: /php4 ChangeLog /php4/ext/oci8 oci8.c
| From: | Thies C . Arntzen | Date: | Fri, 17 Sep 1999 08:25:04 +0000 |
| Subject: | cvs: /php4 ChangeLog /php4/ext/oci8 oci8.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-4557@lists.php.net to get a copy of this message | ||
thies Fri Sep 17 04:25:04 1999 EDT
Modified files:
/php4 ChangeLog
/php4/ext/oci8 oci8.c
Log:
fix #2316 - fetching empty LOBs via OCI8
Index: php4/ChangeLog
diff -u php4/ChangeLog:1.112 php4/ChangeLog:1.113
--- php4/ChangeLog:1.112 Fri Sep 17 01:40:58 1999
+++ php4/ChangeLog Fri Sep 17 04:25:02 1999
@@ -2,6 +2,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? 1999, Version 4.0 Beta 3
+- OCI8 fix for fetching empty LOBs (Thies)
- Added user-level callbacks for session module (Sascha)
- Added support for unknown POST content types (Zeev)
- Added "wddx" serialization handler for session module (Sascha)
Index: php4/ext/oci8/oci8.c
diff -u php4/ext/oci8/oci8.c:1.26 php4/ext/oci8/oci8.c:1.27
--- php4/ext/oci8/oci8.c:1.26 Tue Sep 14 08:41:00 1999
+++ php4/ext/oci8/oci8.c Fri Sep 17 04:25:03 1999
@@ -22,7 +22,7 @@
#define OCI_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */
-/* $Id: oci8.c,v 1.26 1999/09/14 12:41:00 thies Exp $ */
+/* $Id: oci8.c,v 1.27 1999/09/17 08:25:03 thies Exp $ */
/* TODO list:
*
@@ -100,7 +100,6 @@
/* }}} */
/* {{{ startup/shutdown/info/internal function prototypes */
-
PHP_MINIT_FUNCTION(oci);
PHP_RINIT_FUNCTION(oci);
PHP_MSHUTDOWN_FUNCTION(oci);
@@ -818,7 +817,7 @@
loblen = oci_loadlob(statement->conn,descr,&buffer);
- if (loblen > 0) {
+ if (loblen >= 0) {
value->type = IS_STRING;
value->value.str.len = loblen;
value->value.str.val = buffer;
@@ -1354,12 +1353,17 @@
if (connection->error) {
oci_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;
}
@@ -1372,7 +1376,7 @@
if (connection->error) {
oci_error(connection->pError, "OCILobFileOpen",connection->error);
efree(buffer);
- return 0;
+ return -1;
}
}
@@ -1392,7 +1396,7 @@
if (connection->error) {
oci_error(connection->pError, "OCILobRead", connection->error);
efree(buffer);
- return 0;
+ return -1;
}
if (mydescr->type == OCI_DTYPE_FILE) {
@@ -1403,7 +1407,7 @@
if (connection->error) {
oci_error(connection->pError, "OCILobFileClose", connection->error);
efree(buffer);
- return 0;
+ return -1;
}
}
@@ -2624,7 +2628,7 @@
loblen = oci_loadlob(connection,descr,&buffer);
- if (loblen > 0) {
+ if (loblen >= 0) {
RETURN_STRINGL(buffer,loblen,0);
}
}