Subject: | Intermittent bug with DBD::File, detected by t/51dbm_file.t |
t/51dbm_file.t test 12 attempts to use dbm_tables to reconnect. If the
dbm_tables hash entry from %$attr is processed before the f_dir hash
entry, it will attempt to open the database from the current directory
instead of the specified director.
I've verified this bug afflicts perl versions 5.8.1 to 5.12.2. However,
it looks like it would afflict all of them.
One can cause this bug to always trigger by adding dbm_tables to the
$two_phased_init initial foreach loop (before f_dir if you've already
applied my patch).
My fix is to simply include f_dir in the %$attr keys to process first.
This was from DBI-1.616, downloaded from CPAN last night.
Perl versions 5.8.1, 5.8.2, 5.8.3, 5.8.4, 5.8.5, 5.8.6, 5.8.7, 5.8.8,
5.8.9, 5.10.0, 5.10.1, 5.12.0, 5.12.1, 5.12.2
Linux dhcppc0 2.6.33.7-eg #4 PREEMPT Sat Oct 30 14:14:41 EDT 2010 i686
i686 i386 GNU/Linux
% /home/perl5/12.2/bin/perl -Iblib/lib t/51dbm_file.t
ok 1 - drop table
ok 2 - FRED.dir exists
ok 3 - fred.dir exists
ok 4 - fred.pag exists
ok 5 - insert into mixed case table
ok 6 - insert into uppercase table
ok 7 - rows found via cloned mixed case table
ok 8 - drop table
ok 9 - rows found via mixed case table
ok 10 # skip quoted identifiers aren't supported by DBI::SQL::Nano
ok 11 - disconnect
DBD::DBM::db selectall_arrayref failed: Cannot open
/home/perl5/.cpan/build/DBI-1.616/fred.lck: No such file or directory
(2) at blib/lib/DBD/File.pm line 730 at blib/lib/DBI/DBD/SqlEngine.pm
line 796
[for Statement "select * from Fred"] at t/51dbm_file.t line 122.
Can't use an undefined value as an ARRAY reference at t/51dbm_file.t
line 123.
# Tests were run but no plan was declared and done_testing() was not seen.
%
Subject: | SqlEngine.diff |
--- lib/DBI/DBD/SqlEngine.pm 2010-12-21 18:00:15.000000000 -0500
+++ blib/lib/DBI/DBD/SqlEngine.pm 2011-08-21 16:53:28.630637110 -0400
@@ -174,7 +174,7 @@
if ($two_phased_init)
{
- foreach $a (qw(Profile RaiseError PrintError AutoCommit))
+ foreach $a (qw(Profile RaiseError PrintError AutoCommit f_dir))
{ # do these first
exists $attr->{$a} or next;
eval {