Tim Bunce wrote:
On Wed, May 14, 2008 at 03:12:27PM -0700, Dean Arnold wrote:
(DBI 1.604, DBD::ODBC 1.15, WinXP, AS 5.8.8)
I'm trying to test cancel of long running queries
via DBD::ODBC (using psqlodbc driver). I've written
a small proxy which injects 10+ second delays in
delivery of queries from client to server. And I've
managed to get SIGINT signals delivered to my app.
But it appears that DBD::ODBC doesn't appear to
believe the stmt handle is active when I cancel it.
I hacked DBD::ODBC's dbdimp.c:odbc_cancel() to
add printf's on entry, if no stmt is active,
or if SQLCancel fails. When I run the test and
hit ctrl-C, odbc_cancel() does get called, *but*
it reports no active statement.
So I commented out the Active test in odbc_cancel(),
and then everything works as expected.
Is this a known sequencing problem ? Is Active not getting
set until the rows start returning ? If so, shouldn't it get
set immediately upon calling SQLExecute ?
I don't think it should be checking the Active flag at all.
Active (which is poorly named) wouldn't be set for an UPDATE
statement, for example, but you'd still want to be able to cancel it.
Tim.
Thanks for that - as Tim says it is a bug, cancel is not just for select
statements and I've now fixed it by removing the active test. I might
have guessed someone would find something literally hours after I did a
new release :-(
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com