Date: | Sat, 06 Dec 2003 12:02:04 +0100 |
From: | Max Maischein <corion [...] corion.net> |
To: | bug-DBD-SQLite [...] rt.cpan.org |
Subject: | Test suite (t/t50*.t) is order dependent / bug in t/lib.pl? |
t/t50chopblanks.t crashes on my build of Perl 5.8.2, which causes a
subsequent failure in t/t50commit.t . Running t/t50commit.t alone passes
that test without problems.
The problem seems to be that FindNewTable() does return C<testaa> as a
"new" table name even though SQLite thinks the table already exists as
it was left over by the previous test file.
Looking at the implementation of FindNewTable, it seems to me that
ListTables() returns an array reference where the code treats it as a list :
} elsif (defined(&ListTables)) {
@tables = &ListTables($dbh);
use Data::Dumper;
warn Dumper($_) for @tables;
# prints:
# $VAR1 = []
Still, the result is the same, C<testaa> should be a valid table name.
Using a different/additional test in FindNewTable() fixes/circumvents
the problem of existing tables:
foreach $table (@tables) {
if ($table eq $testtable) {
$testtable++;
$foundtesttable = 1;
} else {
# potential candidate for a new table
# check whether it really exists:
my $st = sprintf 'SELECT COUNT(*) FROM %s',
$testtable;
my $res;
$res = $dbh->do($st);
if (! $dbh->err) {
$testtable++;
$foundtesttable = 1
};
};
}
This is not really critical, as my main error is currently with the test
crashing my build of Perl 5.8.2 under Win32 ;-)
-max