summaryrefslogtreecommitdiff
path: root/ext/oci8
diff options
context:
space:
mode:
authorEdin Kadribasic <edink@php.net>2002-08-20 07:26:50 +0000
committerEdin Kadribasic <edink@php.net>2002-08-20 07:26:50 +0000
commit48389cc2a6d62681fcbad22bb6727926c0b37678 (patch)
tree653b69ef60bad3c1febd4fe3745f18cd01f31b54 /ext/oci8
parente3217423834a89167d3eb19445c2ba346f7b2984 (diff)
downloadphp-git-48389cc2a6d62681fcbad22bb6727926c0b37678.tar.gz
Fixed build with Oracle 8.0.x (bug #18973).
Diffstat (limited to 'ext/oci8')
-rw-r--r--ext/oci8/config.m41
-rw-r--r--ext/oci8/oci8.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 1b3e6d9ddf..d6d1f98d3c 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -70,6 +70,7 @@ if test "$PHP_OCI8" != "no"; then
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
+ AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
;;
*)
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 2e0d86b7b9..ac29732286 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -4231,8 +4231,10 @@ PHP_FUNCTION(ocierror)
sb4 errcode = 0;
sword error = 0;
dvoid *errh = NULL;
+#ifdef HAVE_OCI8_ATTR_STATEMENT
ub2 errorofs = 0;
text *sqltext = NULL;
+#endif
if (zend_get_parameters_ex(1, &arg) == SUCCESS) {
statement = (oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_stmt);
@@ -4240,6 +4242,7 @@ PHP_FUNCTION(ocierror)
errh = statement->pError;
error = statement->error;
+#ifdef HAVE_OCI8_ATTR_STATEMENT
CALL_OCI_RETURN(statement->error, OCIAttrGet(
(dvoid *)statement->pStmt,
OCI_HTYPE_STMT,
@@ -4255,6 +4258,7 @@ PHP_FUNCTION(ocierror)
(ub4 *)0,
OCI_ATTR_PARSE_ERROR_OFFSET,
statement->pError));
+#endif
} else {
connection = (oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_conn);
@@ -4290,8 +4294,10 @@ PHP_FUNCTION(ocierror)
array_init(return_value);
add_assoc_long(return_value, "code", errcode);
add_assoc_string(return_value, "message", (char*) errbuf, 1);
+#ifdef HAVE_OCI8_ATTR_STATEMENT
add_assoc_long(return_value, "offset", errorofs);
add_assoc_string(return_value, "sqltext", sqltext ? (char *) sqltext : "", 1);
+#endif
} else {
RETURN_FALSE;
}