That's probably the best thing, but there are probably more places... After 
reviewing the
code, I think I don't like the duplication of the henv -- but the short term 
patch is
whenever you see a SQLFreeEnv, also set the imp_dbh->henv to SQL_NULL_ENV.   
Sorry I
haven't looked at better than that, but that resolves it for me.  

I've patched my svn copy and committed.  I've also patched my t\05meth.t to add 
your
tests.  Can you use the svn source to test?

Thanks,

Jeff

> -----Original Message-----
> From: Steffen Goeldner [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 07, 2005 5:02 AM
> Cc: Martin J. Evans; [EMAIL PROTECTED]; dbi-dev@perl.org
> Subject: Re: DBD::ODBC: crash in ping (after disconnect)
> 
> 
> Steffen Goeldner wrote:
> 
> > O.k., attached. Looks like SQLError receives a freed SQL_HANDLE_ENV.
> 
> Not sure, but I think I fixed the problem.
> In dbd_db_login6, I found:
> 
>     imp_dbh->henv = imp_drh->henv;    /* needed for dbd_error */
> 
> In dbd_db_disconnect, I found:
> 
>        imp_drh->henv = SQL_NULL_HENV;
> 
> and added
> 
>        imp_dbh->henv = SQL_NULL_HENV;
> 
> At least my test script no longer crashes.
> 
> 
> Steffen
> 

Reply via email to