On Wed, Apr 10, 2002 at 04:42:27PM -0700, Jeff Zucker wrote:
> Tim Bunce wrote:
> >
> > Jeff, for the time being try just having set_err() also do
> > $DBI::err = $h->{err};
> > $DBI::errstr = $h->{errstr};
> > $DBI::state = $h->{state}; # might need some extra logic here
>
> Yes, that's the way it is. But that way by itself won't pass all of the
> Error handling tests in examp.t.
Since I don't have time to run the tests themselves you'll need to
quote the test code in your emails. Sorry.
> Here's the only way I can pass all of the error tests in examp.t
> (including your sneaky test that looks to see if the current or previous
> error message is being returned #151):
>
> 1. set $DBI::PurePerl::lasth = $h in _setup_handle()
> 2 set $DBI::PurePerl::lasth->{err} = $_[1] in DBI::var::STORE();
> 3. return $DBI::PurePerl::lasth->{err} from DBI::var::FETCH()
> 4. set $DBI::err = $h->{err} in _set_err()
>
> It seems odd that #4 is necessary but it seems to be.
I think we should try to ignore the lasth concept for DBI::PurePerl.
Try adding an unless($DBI::PurePerl){...} around all tests that refer to lasth.
Then go back to just having set_err() do as I suggested above.
That, plus install_method generating code that properly clears
$DBI::err etc unless IMA_KEEP_ERR applies, should so it.
If it doesn't then please quote the test code to me.
(And then I'll probably spot what I'm missing :)
> I haven't run into problems with lasth in DESTROY but I'm still testing.
You won't, because the existance of lasth will prevent DESTROY
being called (in some cases).
Tim.