]> granicus.if.org Git - php/commitdiff
two fixes:
authorAntony Dovgal <tony2001@php.net>
Wed, 28 Jan 2004 07:15:55 +0000 (07:15 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 28 Jan 2004 07:15:55 +0000 (07:15 +0000)
-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

ext/oci8/oci8.c

index 1d054e3f3e7195724252f04ce593b69b937f6543..237b8ef4140bd4bf2116a17226b52137316d397a 100644 (file)
@@ -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(