PHP_EXT_SRCDIR([oci8])/$ac_provsrc:;
$ac_bdir[$]ac_hdrobj: $ac_srcdir[$]ac_provsrc
- CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
+ CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHPOCI_,DTRACE_,g' \$[]@.bak > \$[]@
\$(OCI8_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Stig S�ther Bakken <ssb@php.net> |
+ | Authors: Stig Sæther Bakken <ssb@php.net> |
| Thies C. Arntzen <thies@thieso.net> |
| Maxim Maletsky <maxim@maxim.cx> |
| |
connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection));
connection->hash_key = estrndup(hashed_details.c, hashed_details.len);
connection->is_persistent = 0;
+#ifdef HAVE_OCI8_DTRACE
+ connection->client_id = NULL;
+#endif
} else {
connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection));
if (connection == NULL) {
return NULL;
}
connection->is_persistent = 1;
+#ifdef HAVE_OCI8_DTRACE
+ connection->client_id = NULL;
+#endif
}
} else {
connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection));
connection->hash_key = estrndup(hashed_details.c, hashed_details.len);
connection->is_persistent = 0;
+#ifdef HAVE_OCI8_DTRACE
+ connection->client_id = NULL;
+#endif
}
/* {{{ Get the session pool that suits this connection request from the persistent list. This
php_oci_spool_close(connection->private_spool TSRMLS_CC);
}
- if (connection->is_persistent) {
- if (connection->hash_key) {
- free(connection->hash_key);
- }
- free(connection);
- } else {
- if (connection->hash_key) {
- efree(connection->hash_key);
- }
- efree(connection);
+ if (connection->hash_key) {
+ pefree(connection->hash_key, connection->is_persistent);
+ }
+#ifdef HAVE_OCI8_DTRACE
+ if (connection->client_id) {
+ pefree(connection->client_id, connection->is_persistent);
}
+#endif /* HAVE_OCI8_DTRACE */
+ pefree(connection, connection->is_persistent);
connection = NULL;
OCI_G(in_call) = in_call_save;
return result;
* the OCI session
*/
connection->next_pingp = NULL;
+#ifdef HAVE_OCI8_DTRACE
+ if (connection->client_id) {
+ pefree(connection->client_id, connection->is_persistent);
+ connection->client_id = NULL;
+ }
+#endif /* HAVE_OCI8_DTRACE */
}
OCI_G(in_call) = in_call_save;
{
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_CHECK_CONNECTION_ENABLED()) {
- DTRACE_OCI8_CHECK_CONNECTION(connection, connection && connection->is_open ? 1 : 0, (long)errcode, (unsigned long)serverStatus);
+ DTRACE_OCI8_CHECK_CONNECTION(connection, connection->client_id, connection->is_open ? 1 : 0, (long)errcode, (unsigned long)serverStatus);
}
#endif /* HAVE_OCI8_DTRACE */
}
+----------------------------------------------------------------------+
*/
-provider php {
- probe oci8__check__connection(void *connection, int is_open, long errcode, unsigned long server_status);
+provider phpoci {
+ probe oci8__check__connection(void *connection, char *client_id, int is_open, long errcode, unsigned long server_status);
probe oci8__connect__entry(char *username, char *dbname, char *charset, long session_mode, int persistent, int exclusive);
probe oci8__connect__return(void *connection);
probe oci8__connection__close(void *connection);
probe oci8__error(int status, long errcode);
- probe oci8__execute__mode(void *connection, unsigned int mode);
- probe oci8__sqltext(void *connection, char *sql);
+ probe oci8__execute__mode(void *connection, char *client_id, void *statement, unsigned int mode);
+ probe oci8__sqltext(void *connection, char *client_id, void *statement, char *sql);
probe oci8__connect__p__dtor__close(void *connection);
probe oci8__connect__p__dtor__release(void *connection);
RETURN_FALSE;
}
+#ifdef HAVE_OCI8_DTRACE
+ /* The alternatives to storing client_id like done below are
+ i) display it in a probe here in oci_set_client_identifier and
+ let the user D script correlate the connection address probe
+ argument and the client_id. This would likely require user D
+ script variables, which would use kernel memory.
+ ii) call OCIAttrGet for each probe definition that uses
+ client_id. This would be slower than storing it.
+ */
+
+ if (connection->client_id) {
+ pefree(connection->client_id, connection->is_persistent);
+ }
+
+ if (client_id) {
+ /* this long winded copy allows compatibility with older PHP versions */
+ connection->client_id = (char *)safe_emalloc(client_id_len+1, sizeof(char), connection->is_persistent);
+ memcpy(connection->client_id, client_id, client_id_len);
+ connection->client_id[client_id_len] = '\0';
+ } else {
+ connection->client_id = NULL;
+ }
+#endif /* HAVE_OCI8_DTRACE */
+
RETURN_TRUE;
}
/* }}} */
if (OCI_G(edition)) {
efree(OCI_G(edition));
- OCI_G(edition) = NULL;
}
if (edition) {
- OCI_G(edition) = (char *)safe_emalloc(edition_len+1, sizeof(text), 0);
+ OCI_G(edition) = (char *)safe_emalloc(edition_len+1, sizeof(char), 0);
memcpy(OCI_G(edition), edition, edition_len);
OCI_G(edition)[edition_len] = '\0';
+ } else {
+ OCI_G(edition) = NULL;
}
RETURN_TRUE;
if (!query_len) {
/* do not allocate stmt handle for refcursors, we'll get it from OCIStmtPrepare2() */
PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->stmt), OCI_HTYPE_STMT, 0, NULL));
- } else {
-#ifdef HAVE_OCI8_DTRACE
- if (DTRACE_OCI8_SQLTEXT_ENABLED()) {
- DTRACE_OCI8_SQLTEXT(connection, query);
- }
-#endif /* HAVE_OCI8_DTRACE */
}
-
+
PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->err), OCI_HTYPE_ERROR, 0, NULL));
if (query_len > 0) {
OCI_DEFAULT
)
);
+#ifdef HAVE_OCI8_DTRACE
+ if (DTRACE_OCI8_SQLTEXT_ENABLED()) {
+ DTRACE_OCI8_SQLTEXT(connection, connection->client_id, statement, query);
+ }
+#endif /* HAVE_OCI8_DTRACE */
+
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
/* only these are allowed */
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_EXECUTE_MODE_ENABLED()) {
- DTRACE_OCI8_EXECUTE_MODE(statement->connection, mode);
+ DTRACE_OCI8_EXECUTE_MODE(statement->connection, statement->connection->client_id, statement, mode);
}
#endif /* HAVE_OCI8_DTRACE */
break;
<active>no</active>
</lead>
- <date>2013-09-06</date>
+ <date>2013-09-27</date>
<time>12:00:00</time>
<version>
- <release>2.0.2</release>
- <api>2.0.2</api>
+ <release>2.0.3</release>
+ <api>2.0.3</api>
</version>
<stability>
<release>devel</release>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
-Review and improve error handling code and data types.
-Fix oci_set_*($connection, ...) error handling so oci_error($connection) works.
-Add DTrace oci8-connection-close probe
-Add the connection handle to several DTrace probes.
+Add the oci_set_client_identifier() value and statement structure pointer to several DTrace probes.
+Use 'phpoci' as the DTrace provider name since uniqueness is required by the Linux fasttrap module.
+Update Windows builds to create only php_oci8_12c.dll.
</notes>
<contents>
<dir name="/">
</extsrcrelease>
<changelog>
+<release>
+ <version>
+ <release>2.0.2</release>
+ <api>2.0.2</api>
+ </version>
+ <stability>
+ <release>devel</release>
+ <api>devel</api>
+ </stability>
+ <license uri="http://www.php.net/license">PHP</license>
+ <notes>
+Review and improve error handling code and data types.
+Fix oci_set_*($connection, ...) error handling so oci_error($connection) works.
+Add DTrace oci8-connection-close probe
+Add the connection handle to several DTrace probes.
+ </notes>
+</release>
+
<release>
<version>
<release>2.0.1</release>
*/
#undef PHP_OCI8_VERSION
#endif
-#define PHP_OCI8_VERSION "2.0.2-dev"
+#define PHP_OCI8_VERSION "2.0.3-dev"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
time_t idle_expiry; /* time when the connection will be considered as expired */
time_t *next_pingp; /* (pointer to) time of the next ping */
char *hash_key; /* hashed details of the connection */
+#ifdef HAVE_OCI8_DTRACE
+ char *client_id; /* The oci_set_client_identifier() value */
+#endif
} php_oci_connection;
/* }}} */
;extension=php_exif.dll ; Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll
-;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
-;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
+;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll
-;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
-;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
+;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll