See RT http://rt.cpan.org/Public/Bug/Display.html?id=63550 which started this 
off.

DBD::ODBC optimises calls to the do method when no parameters are involved. 
Normally do is just a shortcut for prepare/execute except it should only be for 
non-result-set generating statements and hence does not return a statement 
handle. ODBC can optimise the do method to simply call SQLExecDirect instead of 
the normal SQLPrepare/SQLExecute (one round trip and other advantages). 
DBD::ODBC has been this way for years.

However, the person reporting this issue is attempting to use the handle passed 
to an error handler when do fails to obtain the Statement attribute. The handle 
DBD::ODBC passes in to the error handler is the connection handle as DBD::ODBC 
never created a DBI statement handle and hence there is no Statement attribute 
to access.

Is DBD::ODBC breaking the rules here with this optimisation?

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Reply via email to