Valery's Mlog

Mindlog of a Freak
July 10th, 2006 by Valery Dachev

OCI8 LOB Patch

Very briefly… there’s a bug in reading the contets of LOB fields in the latest version (1.2.1) of OCI8 extension. I’ll drop the patch here as it is only available in the CVS version of the package:

diff -u -r ext/oci8.old/oci8-1.2.1/oci8_lob.c ext/oci8/oci8-1.2.1/oci8_lob.c
--- ext/oci8.old/oci8-1.2.1/oci8_lob.c	2006-05-02 09:33:15.000000000 +0300
+++ ext/oci8/oci8-1.2.1/oci8_lob.c	2006-07-10 14:20:46.000000000 +0300
@@ -150,11 +150,16 @@
 {
 	php_oci_connection *connection = descriptor->connection;
 	ub4 length = 0;
+#if defined(HAVE_OCI_LOB_READ2)
+	oraub8 bytes_read, bytes_total = 0, offset = 0;
+	oraub8 requested_len = read_length; /* this is by default */
+	oraub8 chars_read = 0;
+#else
 	int bytes_read, bytes_total = 0, offset = 0;
 	int requested_len = read_length; /* this is by default */
-#if defined(HAVE_OCI_LOB_READ2)
-	int chars_read = 0, is_clob = 0;
+	int chars_read = 0;
 #endif
+	int is_clob = 0;

 	*data_len = 0;
 	*data = NULL;

Leave a Reply

%d bloggers like this: