Subject: | [PATCH] v1.36 fails to compile against Oracle 10g due to absent TAF constant |
DBD::Oracle 1.36 has unconditional compilation using the
OCI_ATTR_TAF_ENABLED preprocessor constant, which is not present in the
headers for Oracle 10g. Attached is a minimal patch which makes use of
this constant conditional on its existence. It does not remove all
TAF-related code from DBD::Oracle.
With this patch, DBD::Oracle 1.36 builds and runs successfully under OS
X 10.6.8 with the Oracle 10.2.0.4.0 Instant Client.
Subject: | DBD_Oracle_noTAF.patch |
--- Oracle.xs~ 2011-12-06 16:15:37.000000000 -0500
+++ Oracle.xs 2012-01-05 18:29:36.000000000 -0500
@@ -357,9 +357,13 @@
sword status;
ub4 can_taf = 0;
CODE:
+#ifdef OCI_ATTR_TAF_ENABLED
OCIAttrGet_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, &can_taf, NULL,
OCI_ATTR_TAF_ENABLED, imp_dbh->errhp, status);
if (status != OCI_SUCCESS) {
+#else
+ if (1) {
+#endif
oci_error(dbh, imp_dbh->errhp, status, "OCIAttrGet OCI_ATTR_TAF_ENABLED");
XSRETURN_IV(0);
}
--- dbdimp.c~ 2011-12-06 16:15:37.000000000 -0500
+++ dbdimp.c 2012-01-05 18:31:31.000000000 -0500
@@ -902,9 +902,13 @@
if (imp_dbh->using_taf){
bool can_taf;
+#ifdef OCI_ATTR_TAF_ENABLED
OCIAttrGet_log_stat(imp_dbh->srvhp, OCI_HTYPE_SERVER, &can_taf, NULL,
OCI_ATTR_TAF_ENABLED, imp_dbh->errhp, status);
+#else
+ can_taf = 0;
+#endif
if (!can_taf){
croak("You are attempting to enable TAF on a server that is not TAF Enabled \n");
}