On Thursday, July 24, 2003, at 07:18 PM, David Wheeler wrote:
On Thursday, July 24, 2003, at 05:11 PM, Juan Diego Bullos San Román wrote:
(....) ok 44 ok 45 not ok 46 not ok 47 not ok 48 ok 49 (....) ok 68 FAILED tests 46-48 Failed 3/68 tests, 95.59% okay
Doesn't tell you much, does it? You can problaby install DBD::mysql and not have any problems, but you should send this output to the DBD::mysql maintainer to make sure.
Those tests are around line 500 of the test file:
# So many people have problems using the ListFields method,
# so we finally provide a simple example.
$sth_query = $dbh->query("select * from $firsttable");
$sth_listf = $dbh->listfields($firsttable);
$i = 43;
for $method (qw/name table length type is_not_null is_pri_key/) {
for (0..$sth_query->numfields -1) {
# whatever we do to the one statementhandle, the other one has
# to behave exactly the same way
if ($sth_query->$method()->[$_] eq $sth_listf->$method()->[$_]) {
print "ok $i\n" ;
} else {
print "not ok $i\n";
}
$i++;
}
}
My personal gripe with this code is that it should really look something like this:
use Test;
$sth_query = $dbh->query("select * from $firsttable");
$sth_listf = $dbh->listfields($firsttable);
for $method (qw/name table length type is_not_null is_pri_key/) {
for (0..$sth_query->numfields -1) {
# whatever we do to the one statementhandle, the other one has
# to behave exactly the same way
ok $sth_query->$method()->[$_], $sth_listf->$method()->[$_],
"$method() with field $_";
}
}
Then at least you'd have some idea *why* it's failing.
In any case, if you don't plan to use listfields() with the name() method, you should be fine.
-Ken