summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8_lob.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/oci8/oci8_lob.c')
-rw-r--r--ext/oci8/oci8_lob.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c
index 1bccf3188..0a6aa8c61 100644
--- a/ext/oci8/oci8_lob.c
+++ b/ext/oci8/oci8_lob.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_lob.c,v 1.7.2.6.2.18 2008/02/25 23:52:10 sixd Exp $ */
+/* $Id: oci8_lob.c,v 1.7.2.6.2.20 2008/12/31 11:17:40 sebastian Exp $ */
@@ -302,6 +302,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini
}
if (is_clob) {
+#ifdef OCI_NLS_CHARSET_MAXBYTESZ
PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (connection->errcode != OCI_SUCCESS) {
@@ -309,6 +310,10 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
+#else
+ /* Oracle 8.1 doesn't define OCI_NLS_CHARSET_MAXBYTESZ, so allocate worst case size */
+ bytes_per_char = 4;
+#endif
} else {
/* BLOBs don't have encoding, so bytes_per_char == 1 */
}