From: Antony Dovgal Date: Wed, 28 Jan 2004 07:15:55 +0000 (+0000) Subject: two fixes: X-Git-Tag: php-5.0.0b4RC1~267 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fab593566eb123bf9907a019aa23b3244c45477d;p=php two fixes: -oci_lob_load shouldn't reset LOB's length to zero -Oracle feels bad, but reports no error, when trying to erase LOB with offset bigger than LOB --- diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 1d054e3f3e..237b8ef414 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -2284,8 +2284,6 @@ static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char return -1; } - mydescr->lob_size = *loblen; - if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) { CALL_OCI_RETURN(connection->error, OCILobFileClose( @@ -4475,6 +4473,10 @@ PHP_FUNCTION(oci_lob_erase) if (erase_length < 1) { RETURN_LONG(0); } + + if (erase_offset > descr->lob_size) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "oci_lob_erase(): offset is greater than LOB's length"); + } CALL_OCI_RETURN(connection->error, OCILobErase(