Author: timbo
Date: Wed Oct 6 06:39:50 2004
New Revision: 480
Modified:
dbi/trunk/Changes
dbi/trunk/DBI.pm
dbi/trunk/DBI.xs
dbi/trunk/META.yml
dbi/trunk/ToDo
dbi/trunk/lib/DBI/DBD.pm
Log:
Fixed DBI::DBD code for drivers broken in 1.44.
Fixed "Free to wrong pool"/"Attempt to free unreferenced scalar" in FETCH.
Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes (original)
+++ dbi/trunk/Changes Wed Oct 6 06:39:50 2004
@@ -4,6 +4,11 @@
=cut
+=head2 Changes in DBI 1.45 (svn rev 480), 6th October 2004
+
+ Fixed DBI::DBD code for drivers broken in 1.44.
+ Fixed "Free to wrong pool"/"Attempt to free unreferenced scalar" in FETCH.
+
=head2 Changes in DBI 1.44 (svn rev 478), 5th October 2004
Fixed build issues on VMS thanks to Jakob Snoer.
Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm (original)
+++ dbi/trunk/DBI.pm Wed Oct 6 06:39:50 2004
@@ -9,7 +9,7 @@
require 5.006_00;
BEGIN {
-$DBI::VERSION = "1.44"; # ==> ALSO update the version in the pod text below!
+$DBI::VERSION = "1.45"; # ==> ALSO update the version in the pod text below!
}
=head1 NAME
@@ -118,7 +118,7 @@
=head2 NOTES
-This is the DBI specification that corresponds to the DBI version 1.44.
+This is the DBI specification that corresponds to the DBI version 1.45.
The DBI is evolving at a steady pace, so it's good to check that
you have the latest copy.
@@ -149,8 +149,6 @@
package DBI;
-my $Revision = substr(q$Revision: 11.43 $, 10);
-
use Carp();
use DynaLoader ();
use Exporter ();
@@ -1321,7 +1319,12 @@
my $key = join "~~", $dsn, $user||'', $auth||'',
$attr ? (@attr_keys,@[EMAIL PROTECTED]) : ();
my $dbh = $cache->{$key};
- return $dbh if $dbh && $dbh->FETCH('Active') && eval { $dbh->ping };
+ if ($dbh && $dbh->FETCH('Active') && eval { $dbh->ping }) {
+ # XXX warn if BegunWork?
+ # XXX warn if $dbh->FETCH('AutoCommit') != $attr->{AutoCommit} ?
+ # but that's just one (bad) case of a more general issue.
+ return $dbh;
+ }
$dbh = $drh->connect(@_);
$cache->{$key} = $dbh; # replace prev entry, even if connect failed
return $dbh;
Modified: dbi/trunk/DBI.xs
==============================================================================
--- dbi/trunk/DBI.xs (original)
+++ dbi/trunk/DBI.xs Wed Oct 6 06:39:50 2004
@@ -1656,10 +1656,10 @@
av_store(av, i, sv);
else {
hv_store(hv, name, SvCUR(sv), newSViv(i), 0);
- sv_2mortal(sv);
+ sv_free(sv);
}
}
- valuesv = newRV(sv_2mortal( (av ? (SV*)av : (SV*)hv) ));
+ valuesv = newRV_noinc( (av ? (SV*)av : (SV*)hv) );
cacheit = TRUE; /* can't change */
}
}
@@ -1862,10 +1862,7 @@
}
if (cacheit) {
- svp = hv_fetch((HV*)SvRV(h), key, keylen, TRUE);
- sv = *svp;
- *svp = SvREFCNT_inc(valuesv);
- sv_free(sv);
+ hv_store((HV*)SvRV(h), key, keylen, newSVsv(valuesv), 0);
}
if (DBIS_TRACE_LEVEL >= 3)
PerlIO_printf(DBILOGFP," .. FETCH %s %s = %s%s\n", neatsvpv(h,0),
Modified: dbi/trunk/META.yml
==============================================================================
--- dbi/trunk/META.yml (original)
+++ dbi/trunk/META.yml Wed Oct 6 06:39:50 2004
@@ -1,11 +1,11 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: DBI
-version: 1.44
+version: 1.45
version_from: DBI.pm
installdirs: site
requires:
- Test::Simple: 0.4
+ Test::Simple: 0.4
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
Modified: dbi/trunk/ToDo
==============================================================================
--- dbi/trunk/ToDo (original)
+++ dbi/trunk/ToDo Wed Oct 6 06:39:50 2004
@@ -134,6 +134,10 @@
valid-looking utf8. To be used (perhaps via OnFetch hook) where
utf8 data is being stored in a non-utf8 aware database.
+Add DBIS->carp(varargs) to simplify access to Carp::carp so warnings
+like "execute called with 1 bind variables when 0 are needed" fr do()
+get reported against caller's file and line number and not a line in DBI.pm
+
pre and post call hooks via ima structure?
Remove _not_impl. Alias debug to trace in DBI::(dr/db/st) and remove
Modified: dbi/trunk/lib/DBI/DBD.pm
==============================================================================
--- dbi/trunk/lib/DBI/DBD.pm (original)
+++ dbi/trunk/lib/DBI/DBD.pm Wed Oct 6 06:39:50 2004
@@ -1,4 +1,5 @@
package DBI::DBD;
+# vim:ts=8:sw=4
use vars qw($VERSION); # set $VERSION early so we don't confuse PAUSE/CPAN etc
@@ -3613,12 +3614,18 @@
$is_dbi
);
-BEGIN { if ($^O eq 'VMS') {
- require vmsish;
- import vmsish;
- require VMS::Filespec;
- import VMS::Filespec;
-}}
+BEGIN {
+ if ($^O eq 'VMS') {
+ require vmsish;
+ import vmsish;
+ require VMS::Filespec;
+ import VMS::Filespec;
+ }
+ else {
+ *vmsify = sub { return $_[0] };
+ *unixify = sub { return $_[0] };
+ }
+}
@ISA = qw(Exporter);