summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2004-01-28 07:15:55 +0000
committerAntony Dovgal <tony2001@php.net>2004-01-28 07:15:55 +0000
commitfab593566eb123bf9907a019aa23b3244c45477d (patch)
treec2d41f168f1b17052db6272ac824a1e931ce401b
parent7bbe518f8b4bfb7408aab4e5896337626b460555 (diff)
downloadphp-git-fab593566eb123bf9907a019aa23b3244c45477d.tar.gz
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
-rw-r--r--ext/oci8/oci8.c6
1 files changed, 4 insertions, 2 deletions
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(