Today a long standing Easysoft customer upgraded from DBD::ODBC 1.13 to 1.21 and their scripts stopped working properly :-( It appears they use the ping method to detect whether the connection handle is connected to the database and since upgrading to 1.21 they are getting DBD::ODBC::db ping failed: Cannot allocate statement when disconnected from the database at ./xxx.pl line 11 when calling the ping method after a disconnect.
I finally tracked this down to a change in DBD::ODBC which now refuses to allocate a statement handle if the connection handle is not connected and ping tries to allocate a statement handle. The fix was fairly straight forward since the ping method is implemented in ODBC.pm so it only needed the call to allocate a statement handle wrapping in an eval. However, for some reason I don't know as yet, setting PrintError and RaiseError to 0 via local does not stop the error being printed or raised so until I work this out I've had to change the ping method to:
What I don't understand is why "local" is not working for PrintError and RaiseError in the eval. I posted this to dbi-dev here.