mirror of
https://github.com/php/php-src.git
synced 2025-01-19 02:03:47 +08:00
fix #2316 - fetching empty LOBs via OCI8
This commit is contained in:
parent
5a5646dce1
commit
128b733eca
@ -2,6 +2,7 @@ PHP 4.0 CHANGE LOG ChangeLog
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
?? ?? 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)
|
||||
|
@ -100,7 +100,6 @@ DLEXPORT php3_module_entry *get_module() { return &oci_module_entry; };
|
||||
/* }}} */
|
||||
/* {{{ startup/shutdown/info/internal function prototypes */
|
||||
|
||||
|
||||
PHP_MINIT_FUNCTION(oci);
|
||||
PHP_RINIT_FUNCTION(oci);
|
||||
PHP_MSHUTDOWN_FUNCTION(oci);
|
||||
@ -818,7 +817,7 @@ oci_make_pval(pval *value,oci_statement *statement,oci_out_column *column, char
|
||||
|
||||
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 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer)
|
||||
|
||||
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 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer)
|
||||
if (connection->error) {
|
||||
oci_error(connection->pError, "OCILobFileOpen",connection->error);
|
||||
efree(buffer);
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1392,7 +1396,7 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer)
|
||||
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 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer)
|
||||
if (connection->error) {
|
||||
oci_error(connection->pError, "OCILobFileClose", connection->error);
|
||||
efree(buffer);
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2624,7 +2628,7 @@ PHP_FUNCTION(ociloadlob)
|
||||
|
||||
loblen = oci_loadlob(connection,descr,&buffer);
|
||||
|
||||
if (loblen > 0) {
|
||||
if (loblen >= 0) {
|
||||
RETURN_STRINGL(buffer,loblen,0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user