[svn:dbd-oracle] r14667 - dbd-oracle/trunk
[email protected] Mon, 31 Jan 2011 12:43:15 -0800 (PST)
| Newsgroups | perl.dbd.oracle.changes |
|---|---|
| Message-ID | <[email protected]> |
Author: byterock
Date: Mon Jan 31 12:43:15 2011
New Revision: 14667
Modified:
dbd-oracle/trunk/Oracle.pm
dbd-oracle/trunk/Oracle.xs
dbd-oracle/trunk/dbdimp.c
dbd-oracle/trunk/dbdimp.h
dbd-oracle/trunk/oci8.c
Log:
Amended the 4 new server side debug/trace attributes, all now have set and get handlers on the DB Handle. They are now ora_driver_name, ora_client_info, ora_session_user and ora_action from John Scoles
Cleaned up the pod some more little.
Modified: dbd-oracle/trunk/Oracle.pm
==============================================================================
--- dbd-oracle/trunk/Oracle.pm (original)
+++ dbd-oracle/trunk/Oracle.pm Mon Jan 31 12:43:15 2011
@@ -345,8 +345,8 @@
}
sub private_attribute_info {
- return { ora_max_nested_cursors => undef,
- ora_array_chunk_size => undef,
+ return { ora_max_nested_cursors => undef,
+ ora_array_chunk_size => undef,
ora_ph_type => undef,
ora_ph_csform => undef,
ora_parse_error_offset => undef,
@@ -363,17 +363,18 @@
ora_verbose => undef,
ora_oci_success_warn => undef,
ora_objects => undef,
- ora_ncs_buff_mtpl => undef,
- ora_drcp => undef,
- ora_drcp_class => undef,
- ora_drcp_min => undef,
- ora_drcp_max => undef,
- ora_drcp_incr => undef,
- ora_oratab_orahome => undef,
- ora_module_name => undef,
+ ora_ncs_buff_mtpl => undef,
+ ora_drcp => undef,
+ ora_drcp_class => undef,
+ ora_drcp_min => undef,
+ ora_drcp_max => undef,
+ ora_drcp_incr => undef,
+ ora_oratab_orahome => undef,
+ ora_module_name => undef,
ora_driver_name => undef,
ora_client_info => undef,
- ora_session_user => undef,
+ ora_client_identifier => undef,
+ ora_action => undef,
};
}
@@ -977,7 +978,8 @@
return $dbh->{ora_can_unicode};
}
-
+
+
} # end of package DBD::Oracle::db
@@ -1654,8 +1656,11 @@
package. This can be used to identify the application to the DBA for
monitoring and performance tuning purposes. For example:
- DBI->connect($dsn, $user, $passwd, { ora_module_name => $0 });
-
+ my $dbh = DBI->connect($dsn, $user, $passwd, { ora_module_name => $0 });
+
+ $dbh{ora_module_name} = $y;
+
+
=item ora_driver_name
For 11g and later you can now set the name of the driver layer using OCI.
@@ -1666,26 +1671,42 @@
GV$SESSION_CONNECT_INFO
- DBI->connect($dsn, $user, $passwd, { ora_driver_name => 'ModPerl_1' });
+ my $dbh = DBI->connect($dsn, $user, $passwd, { ora_driver_name => 'ModPerl_1' });
+ $dbh{ora_driver_name} = $q;
+
=item ora_client_info
When passed in on the connection attribues it can specify any info you want
onto the session up t0 64 bytes. This value can be
retrieved on the server side using V$SESSION view.
- DBI->connect($dsn, $user, $passwd, { ora_client_info => 'BigQuerry2' });
+ my $dbh = DBI->connect($dsn, $user, $passwd, { ora_client_info => 'Remote2' });
+ $dbh{ora_client_info} = "Remote2";
+
=item ora_client_identifier
When passed in on the connection attribues it specifies the user identifier
in the session handle. Most useful for web app as it can pass in the seesion
user name which might be different than the connection user name. Can be up
to 64 bytes long do not to include the password for security reasons and the
-first character of the identifier should not be ':'.
+first character of the identifier should not be ':'. This value can be
+retrieved on the server side using V$SESSION view.
+
+ my $dbh = DBI->connect($dsn, $user, $passwd, { ora_client_identifier => $some_web_user });
- DBI->connect($dsn, $user, $passwd, { ora_client_identifier => $some_web_user });
+ $dbh{ora_client_identifier} = $local_user;
+=item ora_action
+
+You can set this value to anything you want up to 32byes.This value can be
+retrieved on the server side using V$SESSION view.
+
+ my $dbh = DBI->connect($dsn, $user, $passwd, { ora_action => "Login"});
+
+ $dbh{ora_action} = "New Long Query 22"
+ ;
=item ora_dbh_share
Needs at least Perl 5.8.0 compiled with ithreads. Allows to share database
@@ -1881,12 +1902,6 @@
2 (old V7), 7 (V7), and 8 (V8).
All other values have the same effect as 1.
-=item ora_exe_action
-
-You can set the name of the current execution action to anything you want up to 32byes.
-This value is reset to NULL after an exectue action is called.
-
-
=item ora_auto_lob
If true (the default), fetching retrieves the contents of the CLOB or
@@ -3097,13 +3112,16 @@
The valid orientation constant and fetch offset values combination are detailed below
- OCI_FETCH_CURRENT, fetches the current row, the fetch offset value is ignored.
- OCI_FETCH_NEXT, fetches the next row from the current position, the fetch offset value is ignored.
- OCI_FETCH_FIRST, fetches the first row, the fetch offset value is ignored.
- OCI_FETCH_LAST, fetches the last row, the fetch offset value is ignored.
- OCI_FETCH_PRIOR, fetches the previous row from the current position, the fetch offset value is ignored.
+ OCI_FETCH_CURRENT, fetches the current row, the fetch offset value is ignored.
+ OCI_FETCH_NEXT, fetches the next row from the current position, the fetch offset value
+ is ignored.
+ OCI_FETCH_FIRST, fetches the first row, the fetch offset value is ignored.
+ OCI_FETCH_LAST, fetches the last row, the fetch offset value is ignored.
+ OCI_FETCH_PRIOR, fetches the previous row from the current position, the fetch offset
+ value is ignored.
OCI_FETCH_ABSOLUTE, fetches the row that is specified by the fetch offset value.
- OCI_FETCH_RELATIVE, fetches the row relative from the current position as specified by the fetch offset value.
+ OCI_FETCH_RELATIVE, fetches the row relative from the current position as specified by the
+ fetch offset value.
OCI_FETCH_ABSOLUTE, and a fetch offset value of 1 is equivalent to a OCI_FETCH_FIRST.
OCI_FETCH_ABSOLUTE, and a fetch offset value of 0 is equivalent to a OCI_FETCH_CURRENT.
@@ -3115,30 +3133,47 @@
The effect that a ora_fetch_scroll method call has on the current_positon attribute is detailed below.
OCI_FETCH_CURRENT, has no effect on the current_positon attribute.
- OCI_FETCH_NEXT, increments current_positon attribute by 1
- OCI_FETCH_NEXT, when at the last row in the record set does not change current_positon attribute, it is equivalent to a OCI_FETCH_CURRENT
- OCI_FETCH_FIRST, sets the current_positon attribute to 1.
- OCI_FETCH_LAST, sets the current_positon attribute to the total number of rows in the record set.
- OCI_FETCH_PRIOR, decrements current_positon attribute by 1.
- OCI_FETCH_PRIOR, when at the first row in the record set does not change current_positon attribute, it is equivalent to a OCI_FETCH_CURRENT.
+ OCI_FETCH_NEXT, increments current_positon attribute by 1
+ OCI_FETCH_NEXT, when at the last row in the record set does not change current_positon
+ attribute, it is equivalent to a OCI_FETCH_CURRENT
+ OCI_FETCH_FIRST, sets the current_positon attribute to 1.
+ OCI_FETCH_LAST, sets the current_positon attribute to the total number of rows in the
+ record set.
+ OCI_FETCH_PRIOR, decrements current_positon attribute by 1.
+ OCI_FETCH_PRIOR, when at the first row in the record set does not change current_positon
+ attribute, it is equivalent to a OCI_FETCH_CURRENT.
+
OCI_FETCH_ABSOLUTE, sets the current_positon attribute to the fetch offset value.
- OCI_FETCH_ABSOLUTE, and a fetch offset value that is less than 1 does not change current_positon attribute, it is equivalent to a OCI_FETCH_CURRENT.
- OCI_FETCH_ABSOLUTE, and a fetch offset value that is greater than the number of records in the record set, does not change current_positon attribute, it is equivalent to a OCI_FETCH_CURRENT.
- OCI_FETCH_RELATIVE, sets the current_positon attribute to (current_positon attribute + fetch offset value).
- OCI_FETCH_RELATIVE, and a fetch offset value that makes the current position less than 1, does not change fetch offset value so it is equivalent to a OCI_FETCH_CURRENT.
- OCI_FETCH_RELATIVE, and a fetch offset value that makes it greater than the number of records in the record set, does not change fetch offset value so it is equivalent to a OCI_FETCH_CURRENT.
+ OCI_FETCH_ABSOLUTE, and a fetch offset value that is less than 1 does not change
+ current_positon attribute, it is equivalent to a OCI_FETCH_CURRENT.
+ OCI_FETCH_ABSOLUTE, and a fetch offset value that is greater than the number of records in
+ the record set, does not change current_positon attribute, it is
+ equivalent to a OCI_FETCH_CURRENT.
+ OCI_FETCH_RELATIVE, sets the current_positon attribute to (current_positon attribute +
+ fetch offset value).
+ OCI_FETCH_RELATIVE, and a fetch offset value that makes the current position less than 1,
+ does not change fetch offset value so it is equivalent to a OCI_FETCH_CURRENT.
+ OCI_FETCH_RELATIVE, and a fetch offset value that makes it greater than the number of records
+ in the record set, does not change fetch offset value so it is equivalent
+ to a OCI_FETCH_CURRENT.
The effects of the differing orientation constants on the first fetch (current_postion attribute at 0) are as follows.
OCI_FETCH_CURRENT, dose not fetch a row or change the current_positon attribute.
- OCI_FETCH_FIRST, fetches row 1 and sets the current_positon attribute to 1.
- OCI_FETCH_LAST, fetches the last row in the record set and sets the current_positon attribute to the total number of rows in the record set.
- OCI_FETCH_NEXT, equivalent to a OCI_FETCH_FIRST.
- OCI_FETCH_PRIOR, equivalent to a OCI_FETCH_CURRENT.
- OCI_FETCH_ABSOLUTE, and a fetch offset value that is less than 1 is equivalent to a OCI_FETCH_CURRENT.
- OCI_FETCH_ABSOLUTE, and a fetch offset value that is greater than the number of records in the record set is equivalent to a OCI_FETCH_CURRENT.
- OCI_FETCH_RELATIVE, and a fetch offset value that is less than 1 is equivalent to a OCI_FETCH_CURRENT.
- OCI_FETCH_RELATIVE, and a fetch offset value that makes it greater than the number of records in the record set, is equivalent to a OCI_FETCH_CURRENT.
+ OCI_FETCH_FIRST, fetches row 1 and sets the current_positon attribute to 1.
+ OCI_FETCH_LAST, fetches the last row in the record set and sets the current_positon
+ attribute to the total number of rows in the record set.
+ OCI_FETCH_NEXT, equivalent to a OCI_FETCH_FIRST.
+ OCI_FETCH_PRIOR, equivalent to a OCI_FETCH_CURRENT.
+
+ OCI_FETCH_ABSOLUTE, and a fetch offset value that is less than 1 is equivalent to a
+ OCI_FETCH_CURRENT.
+ OCI_FETCH_ABSOLUTE, and a fetch offset value that is greater than the number of
+ records in the record set is equivalent to a OCI_FETCH_CURRENT.
+ OCI_FETCH_RELATIVE, and a fetch offset value that is less than 1 is equivalent
+ to a OCI_FETCH_CURRENT.
+ OCI_FETCH_RELATIVE, and a fetch offset value that makes it greater than the number
+ of records in the record set, is equivalent to a OCI_FETCH_CURRENT.
=back
@@ -3385,7 +3420,8 @@
You can tune this value by setting ora_oci_success_warn which will display the following
- OCILobRead field 2 of 3 SUCCESS: csform 1 (SQLCS_IMPLICIT), LOBlen 10240(characters), LongReadLen 20(characters), BufLen 80(characters), Got 28(characters)
+ OCILobRead field 2 of 3 SUCCESS: csform 1 (SQLCS_IMPLICIT), LOBlen 10240(characters), LongReadLen
+ 20(characters), BufLen 80(characters), Got 28(characters)
In the case above the query Got 28 characters (well really only 20 characters of 28 bytes) so we could use ora_ncs_buff_mtpl=>2 (20*2=40) thus saving 40bytes of memory.
Modified: dbd-oracle/trunk/Oracle.xs
==============================================================================
--- dbd-oracle/trunk/Oracle.xs (original)
+++ dbd-oracle/trunk/Oracle.xs Mon Jan 31 12:43:15 2011
@@ -221,11 +221,11 @@
void
ora_execute_array(sth, tuples, exe_count, tuples_status, cols=&PL_sv_undef)
- SV * sth
- SV * tuples
- IV exe_count
- SV * tuples_status
- SV * cols
+ SV * sth
+ SV * tuples
+ IV exe_count
+ SV * tuples_status
+ SV * cols
PREINIT:
D_imp_sth(sth);
int retval;
@@ -500,9 +500,11 @@
ST(0) = sv_2mortal(newSVuv(is_init));
}
+
+
void
ora_lob_length(dbh, locator)
- SV *dbh
+ SV *dbh
OCILobLocator *locator
PREINIT:
D_imp_dbh(dbh);
Modified: dbd-oracle/trunk/dbdimp.c
==============================================================================
--- dbd-oracle/trunk/dbdimp.c (original)
+++ dbd-oracle/trunk/dbdimp.c Mon Jan 31 12:43:15 2011
@@ -436,39 +436,59 @@
if (DBD_ATTRIB_TRUE(attr,"ora_drcp_max",12,svp))
DBD_ATTRIB_GET_IV( attr, "ora_drcp_max", 12, svp, imp_dbh->pool_max);
if (DBD_ATTRIB_TRUE(attr,"ora_drcp_incr",13,svp))
- DBD_ATTRIB_GET_IV( attr, "ora_drcp_incr", 13, svp, imp_dbh->pool_incr);
+ DBD_ATTRIB_GET_IV( attr, "ora_drcp_incr", 13, svp, imp_dbh->pool_incr);
if ((svp=DBD_ATTRIB_GET_SVP(attr, "ora_driver_name", 15)) && SvOK(*svp)) {
STRLEN svp_len;
if (!SvPOK(*svp))
croak("ora_driver_name is not a string");
- imp_dbh->driver_name = (text *) SvPV (*svp, svp_len );
+ imp_dbh->driver_name = (char *) SvPV (*svp, svp_len );
imp_dbh->driver_namel= (ub4) svp_len;
+ OCIAttrSet_log_stat(,imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->driver_name,imp_dbh->driver_namel,OCI_ATTR_DRIVER_NAME,imp_dbh->errhp, status);
}
+ else {
+ OCIAttrSet_log_stat(,imp_dbh->seshp,OCI_HTYPE_SESSION,(text*)"DBDO1.28",7,OCI_ATTR_DRIVER_NAME,imp_dbh->errhp, status);
+ }
#endif /*ORA_OCI_112*/
+ if ((svp=DBD_ATTRIB_GET_SVP(attr, "ora_action", 10)) && SvOK(*svp)) {
+ STRLEN svp_len;
+ if (!SvPOK(*svp))
+ croak("ora_action is not a string");
+ imp_dbh->action = (char *) SvPV (*svp, svp_len );
+ imp_dbh->actionl= (ub4) svp_len;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->action,imp_dbh->actionl,OCI_ATTR_ACTION,imp_dbh->errhp, status);
+ }
+
if ((svp=DBD_ATTRIB_GET_SVP(attr, "ora_module_name", 15)) && SvOK(*svp)) {
STRLEN svp_len;
if (!SvPOK(*svp))
croak("ora_module_name is not a string");
- imp_dbh->module_name = (text *) SvPV (*svp, svp_len );
+ imp_dbh->module_name = (char *) SvPV (*svp, svp_len );
imp_dbh->module_namel= (ub4) svp_len;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->module_name,imp_dbh->module_namel,OCI_ATTR_MODULE,imp_dbh->errhp, status);
+
}
if ((svp=DBD_ATTRIB_GET_SVP(attr, "ora_client_identifier", 21)) && SvOK(*svp)) {
STRLEN svp_len;
if (!SvPOK(*svp))
croak("ora_client_identifier is not a string");
- imp_dbh->client_identifier = (text *) SvPV (*svp, svp_len );
+ imp_dbh->client_identifier = (char *) SvPV (*svp, svp_len );
imp_dbh->client_identifierl= (ub4) svp_len;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->client_identifier,imp_dbh->client_identifierl,OCI_ATTR_CLIENT_IDENTIFIER,imp_dbh->errhp, status);
+
}
if ((svp=DBD_ATTRIB_GET_SVP(attr, "ora_client_info", 15)) && SvOK(*svp)) {
STRLEN svp_len;
if (!SvPOK(*svp))
croak("ora_client_info is not a string");
- imp_dbh->client_info = (text *) SvPV (*svp, svp_len );
+ imp_dbh->client_info = (char *) SvPV (*svp, svp_len );
imp_dbh->client_infol= (ub4) svp_len;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->client_info,imp_dbh->client_infol,OCI_ATTR_CLIENT_INFO,imp_dbh->errhp, status);
+
}
+
imp_dbh->server_version = 0;
/* check to see if DBD_verbose or ora_verbose is set*/
if (DBD_ATTRIB_TRUE(attr,"dbd_verbose",11,svp))
@@ -981,34 +1001,8 @@
OCIAttrSet_log_stat(imp_dbh->svchp, (ub4) OCI_HTYPE_SVCCTX,
imp_dbh->seshp, (ub4) 0,(ub4) OCI_ATTR_SESSION, imp_dbh->errhp, status);
-#ifdef ORA_OCI_112
-
-if (imp_dbh->driver_name){
-
- OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION,imp_dbh->driver_name,imp_dbh->driver_namel,OCI_ATTR_DRIVER_NAME,imp_dbh->errhp, status);
-}
-#endif
-
-
-if (imp_dbh->client_identifier){
-
- OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION,imp_dbh->client_identifier,imp_dbh->client_identifierl,OCI_ATTR_CLIENT_IDENTIFIER,imp_dbh->errhp, status);
-
-}
-
-if (imp_dbh->module_name){
-
- OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION,imp_dbh->client_info,imp_dbh->client_infol,OCI_ATTR_CLIENT_INFO,imp_dbh->errhp, status);
-
-}
-if (imp_dbh->module_name){
-
- OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION,imp_dbh->module_name,imp_dbh->module_namel,OCI_ATTR_MODULE,imp_dbh->errhp, status);
-
-}
}
-
#if defined(CAN_USE_PRO_C)
} /* use_proc_connection */
#endif
@@ -1233,6 +1227,8 @@
{
dTHX;
STRLEN kl;
+ STRLEN vl;
+ sword status;
char *key = SvPV(keysv,kl);
int on = SvTRUE(valuesv);
int cacheit = 1;
@@ -1242,9 +1238,9 @@
}
#ifdef ORA_OCI_112
else if (kl==15 && strEQ(key, "ora_driver_name") ) {
- STRLEN vl;
- imp_dbh->driver_name = (text *) SvPV (valuesv, vl );
+ imp_dbh->driver_name = (char *) SvPV (valuesv, vl );
imp_dbh->driver_namel= (ub4) vl;
+ OCIAttrSet_log_stat(,imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->driver_name,imp_dbh->driver_namel,OCI_ATTR_DRIVER_NAME,imp_dbh->errhp, status);
}
else if (kl==8 && strEQ(key, "ora_drcp") ) {
imp_dbh->using_drcp = 1;
@@ -1264,20 +1260,28 @@
imp_dbh->pool_incr = SvIV (valuesv);
}
#endif
+ else if (kl==10 && strEQ(key, "ora_action") ) {
+ imp_dbh->action = (char *) SvPV (valuesv, vl );
+ imp_dbh->actionl= (ub4) vl;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->action,imp_dbh->actionl,OCI_ATTR_ACTION,imp_dbh->errhp, status);
+
+ }
else if (kl==21 && strEQ(key, "ora_client_identifier") ) {
- STRLEN vl;
- imp_dbh->client_identifier = (text *) SvPV (valuesv, vl );
+ imp_dbh->client_identifier = (char *) SvPV (valuesv, vl );
imp_dbh->client_identifierl= (ub4) vl;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->client_identifier,imp_dbh->client_identifierl,OCI_ATTR_CLIENT_IDENTIFIER,imp_dbh->errhp, status);
+
}
else if (kl==15 && strEQ(key, "ora_client_info") ) {
- STRLEN vl;
- imp_dbh->client_info = (text *) SvPV (valuesv, vl );
+ imp_dbh->client_info = (char *) SvPV (valuesv, vl );
imp_dbh->client_infol= (ub4) vl;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->client_info,imp_dbh->client_infol,OCI_ATTR_CLIENT_INFO,imp_dbh->errhp, status);
}
else if (kl==15 && strEQ(key, "ora_module_name") ) {
- STRLEN vl;
- imp_dbh->module_name = (text *) SvPV (valuesv, vl );
+ imp_dbh->module_name = (char *) SvPV (valuesv, vl );
imp_dbh->module_namel= (ub4) vl;
+ OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION, imp_dbh->module_name,imp_dbh->module_namel,OCI_ATTR_MODULE,imp_dbh->errhp, status);
+
}
else if (kl==20 && strEQ(key, "ora_oci_success_warn") ) {
oci_warn = SvIV (valuesv);
@@ -1360,6 +1364,9 @@
retsv = newSViv(imp_dbh->pool_incr);
}
#endif
+ else if (kl==10 && strEQ(key, "ora_action")) {
+ retsv = newSVpv((char *)imp_dbh->action,0);
+ }
else if (kl==21 && strEQ(key, "ora_client_identifier")) {
retsv = newSVpv((char *)imp_dbh->client_identifier,0);
}
Modified: dbd-oracle/trunk/dbdimp.h
==============================================================================
--- dbd-oracle/trunk/dbdimp.h (original)
+++ dbd-oracle/trunk/dbdimp.h Mon Jan 31 12:43:15 2011
@@ -50,15 +50,17 @@
ub4 pool_min;
ub4 pool_max;
ub4 pool_incr;
- text *driver_name;/*driver name user defined*/
+ char *driver_name;/*driver name user defined*/
ub4 driver_namel;
#endif
- text *client_info; /*user defined*/
+ char *client_info; /*user defined*/
ub4 client_infol;
- text *module_name; /*module user defined */
+ char *module_name; /*module user defined */
ub4 module_namel;
- text *client_identifier; /*user defined*/
+ char *client_identifier; /*user defined*/
ub4 client_identifierl;
+ char *action; /*user defined*/
+ ub4 actionl;
int proc_handles; /* If true, srvhp, svchp, and authp handles
are owned by ProC and must not be freed. */
int RowCacheSize; /* both of these are defined by DBI spec*/
@@ -313,6 +315,7 @@
void dbd_fbh_dump(imp_fbh_t *fbh, int i, int aidx);
void ora_free_fbh_contents _((imp_fbh_t *fbh));
void ora_free_templob _((SV *sth, imp_sth_t *imp_sth, OCILobLocator *lobloc));
+
int ora_dbtype_is_long _((int dbtype));
fb_ary_t *fb_ary_alloc _((ub4 bufl, int size));
fb_ary_t *fb_ary_cb_alloc _((ub4 piece_size,ub4 max_len, int size));
Modified: dbd-oracle/trunk/oci8.c
==============================================================================
--- dbd-oracle/trunk/oci8.c (original)
+++ dbd-oracle/trunk/oci8.c Mon Jan 31 12:43:15 2011
@@ -474,6 +474,29 @@
dTHX;
SV *sv;
switch (attr) {
+ case OCI_ATTR_MODULE: return "OCI_ATTR_MODULE"; /* module for tracing */
+ case OCI_ATTR_ACTION: return "OCI_ATTR_ACTION"; /* action for tracing */
+ case OCI_ATTR_CLIENT_INFO: return "OCI_ATTR_CLIENT_INFO"; /* client info */
+ case OCI_ATTR_COLLECT_CALL_TIME: return "OCI_ATTR_COLLECT_CALL_TIME"; /* collect call time */
+ case OCI_ATTR_CALL_TIME: return "OCI_ATTR_CALL_TIME"; /* extract call time */
+ case OCI_ATTR_ECONTEXT_ID: return "OCI_ATTR_ECONTEXT_ID"; /* execution-id context */
+ case OCI_ATTR_ECONTEXT_SEQ: return "OCI_ATTR_ECONTEXT_SEQ"; /*execution-id sequence num */
+
+
+ /*------------------------------ Session attributes -------------------------*/
+ case OCI_ATTR_SESSION_STATE: return "OCI_ATTR_SESSION_STATE"; /* session state */
+
+ case OCI_ATTR_SESSION_STATETYPE: return "OCI_ATTR_SESSION_STATETYPE"; /* session state type */
+ case OCI_SESSION_STATELESS_DEF: return "OCI_SESSION_STATELESS_DEF"; /* valid state types */
+
+ case OCI_ATTR_SESSION_STATE_CLEARED: return "OCI_ATTR_SESSION_STATE_CLEARED"; /* session state cleared*/
+ case OCI_ATTR_SESSION_MIGRATED: return "OCI_ATTR_SESSION_MIGRATED"; /* did session migrate*/
+ case OCI_ATTR_SESSION_PRESERVE_STATE: return "OCI_ATTR_SESSION_PRESERVE_STATE"; /* preserve session state */
+#ifdef ORA_OCI_112
+ case OCI_ATTR_DRIVER_NAME: return "OCI_ATTR_DRIVER_NAME"; /* Driver Name */
+#endif
+ case OCI_ATTR_CLIENT_IDENTIFIER: return "OCI_ATTR_CLIENT_IDENTIFIER"; /* value of client id to set*/
+
/*=============================Attribute Types===============================*/
#ifdef ORA_OCI_112
case OCI_ATTR_PURITY: return "OCI_ATTR_PURITY"; /* for DRCP session purity */
@@ -947,7 +970,6 @@
ub4 oparse_lng = 1; /* auto v6 or v7 as suits db connected to */
int ora_check_sql = 1; /* to force a describe to check SQL */
IV ora_placeholders = 1; /* find and handle placeholders */
- oratext * exe_action = "";
/* XXX we set ora_check_sql on for now to force setup of the */
/* row cache. Change later to set up row cache using just a */
/* a memory size, perhaps also default $RowCacheSize to a */
@@ -980,9 +1002,6 @@
if (attribs) {
SV **svp;
IV ora_auto_lob = 1;
- if (svp= DBD_ATTRIB_GET_SVP(attribs, "ora_exe_action", 14)){;
- exe_action = (oratext*)SvPV_nolen(*svp);
- }
DBD_ATTRIB_GET_IV( attribs, "ora_parse_lang", 14, svp, oparse_lng);
DBD_ATTRIB_GET_IV( attribs, "ora_placeholders", 16, svp, ora_placeholders);
DBD_ATTRIB_GET_IV( attribs, "ora_auto_lob", 12, svp, ora_auto_lob);
@@ -1033,13 +1052,6 @@
default: oparse_lng = OCI_NTV_SYNTAX; break;
}
-
- if (exe_action){
- OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION,exe_action,(ub4)strlen(exe_action),OCI_ATTR_ACTION,imp_dbh->errhp, status);
- }
- else {
- OCIAttrSet_log_stat(imp_dbh->seshp,OCI_HTYPE_SESSION,NULL,0,OCI_ATTR_ACTION,imp_dbh->errhp, status);
- }
OCIHandleAlloc_ok(imp_dbh->envhp, &imp_sth->stmhp, OCI_HTYPE_STMT, status);
OCIStmtPrepare_log_stat(imp_sth->stmhp, imp_sth->errhp,
(text*)imp_sth->statement, (ub4)strlen(imp_sth->statement),