On Sun, Mar 31, 2002 at 08:55:19PM -0800, Jeff Zucker wrote:
> Tim Bunce wrote:
> >
> > Replacing the "bootstrap DBI;" line in DBI.pm with "require DBI::PurePerl;"
> > and running "make test" may be a good way to play with it.
>
> Another way which makes it easy to go back and forth between real and PP
> DBI is to replace "bootstrap DBI;" in DBI.pm with
>
> if (defined $ENV{DBIPP}) {
> require "$full_path/PurePerl.pm";
> }
> else {
> bootstrap DBI;
> }
>
> And then set $ENV{DBIPP} in the shell or in a script with
> BEGIN{$ENV{DBIPP}=1} when you want to test the pure perl version.
My plan for the next DBI release is along those lines...
DBI_PUREPERL=1 enable DBI::PurePerl as a fallback
DBI_PUREPERL=2 force use of DBI::PurePerl
(I don't want DBI::PurePerl to kick in unless someone has explicitly
agreed to it by setting the env var. At least, not for the time being.)
> > p.s. Jeff, this is the verson I sent you but with the NUM_OF_FIELDS bug fixed.
>
> And here are my latest patches (onto that version).
>
> I've made a number of improvements and recieved these results from
> Jochen's extensive DBD::CSV/t/*.t:
>
> Failed 1/14 test scripts, 92.86% okay. 5/244 subtests failed, 97.95%
> okay.
>
> All 5 of the subtest failures are related to bind_columns which I
> haven't really touched yet so that is looking pretty good.
>
> Tests with DBI-1.21/t/*.t aren't as good. There are lots of failures
> related to DBI::hash() but I haven't looked into them yet.
Just hash errors for now (though it shouldn't be too hard to emulate it).
The other errors will be more intresting :)
> > my $trace = 0;
Make that use $ENV{DBI_TRACE}
> 135c135,148
> < &$sub($h,@_);
> ---
> > #
> > # do proper symref for func()
> > #
> > $sub = $imp->can($sub)
> > or croak "Can't find $method_name method for $h";
> > my @ret;
> > (wantarray) ? (@ret = &$sub($h,@_)) : (@ret = scalar &$sub($h,@_));
> > if ($h->{err}) {
> > my $msg = sprintf "$method failed: $h->{errstr}";
> > carp $msg if $h->{"PrintError"};
> > croak $msg if $h->{"RaiseError"};
> > }
> > printf TFH " < $method_name(@_)\n" if $trace;
> > return (wantarray) ? @ret : $ret[0];
Umm, looks like a patch against your original version rather than mine,
since mine added all the can/wantarray/err stuff.
Tim.