On Wed, Feb 13, 2002 at 03:46:36PM -0800, Jeffrey W. Baker wrote: > A bug in DBD::Pg can cause it to loop infinitely or crash when ping() is > called on a disconnected database handle. In the disconnect() method, > DBD::Pg calls PQfinish() which closes the connection and *frees the > memory for the handle*. Later, if I call ping() on the disconnected > dbh, DBD::Pg passes the freed memory to PQexec(), which does any of a > number of undesirable things. > > What is the canonical solution here? It seems that perhaps DBD::Pg > should set its cconnection to NULL upon disconnect and check for NULL > before executing anything on the handle. Or, it seems as though DBI > should not allow the ping() method to reach the DBD implementation when > Active is false.
The Driver code should do-the-right-thing. The DBI doesn't want to be involved in that kind of detail. The driver should check relevant preconditions. Tim.