Author: timbo
Date: Tue Jul 29 04:53:04 2008
New Revision: 11609
Modified:
dbi/trunk/Changes
dbi/trunk/lib/DBI/DBD.pm
Log:
Fixed DBD_ATTRIB_DELETE macro for driver authors
and updated DBI::DBD docs thanks to Martin J. Evans.
Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes (original)
+++ dbi/trunk/Changes Tue Jul 29 04:53:04 2008
@@ -54,6 +54,11 @@
Add high-res time for windows - via Time::HiRes glob replace dbi_time().
+=head2 Changes in DBI 1.608 (svn rXXX)
+
+ Fixed DBD_ATTRIB_DELETE macro for driver authors
+ and updated DBI::DBD docs thanks to Martin J. Evans.
+
=head2 Changes in DBI 1.607 (svn r11571) 22nd July 2008
NOTE: Perl 5.8.1 is now the minimum supported version.
Modified: dbi/trunk/lib/DBI/DBD.pm
==============================================================================
--- dbi/trunk/lib/DBI/DBD.pm (original)
+++ dbi/trunk/lib/DBI/DBD.pm Tue Jul 29 04:53:04 2008
@@ -2041,11 +2041,23 @@
if ( (svp = DBD_ATTRIB_GET_SVP(attr, "drv_hostname", 12)) && SvTRUE(*svp)) {
hostname = SvPV(*svp, len);
- DBD__ATTRIB_DELETE(attr, "drv_hostname", 12); /* avoid later STORE */
+ DBD_ATTRIB_DELETE(attr, "drv_hostname", 12); /* avoid later STORE */
} else {
hostname = "localhost";
}
+If you handle any driver specific attributes in the dbd_db_login6
+method you probably want to delete them from C<attr> (as above with
+DBD_ATTRIB_DELETE). If you don't delete your handled attributes DBI
+will call C<STORE> for each attribute after the connect/login and this
+is at best redundant for attributes you have already processed.
+
+B<Note: Until revision 11605 (post DBI 1.607), there was a problem with
+DBD_ATRRIBUTE_DELETE so unless you require a DBI version after 1.607
+you need to replace each DBD_ATTRIBUTE_DELETE call with:>
+
+ hv_delete((HV*)SvRV(attr), key, key_len, G_DISCARD)
+
Note that you can also obtain standard attributes such as I<AutoCommit> and
I<ChopBlanks> from the attributes parameter, using C<DBD_ATTRIB_GET_IV> for
integer attributes.