[freetds] 0.65 (or whatever) TODO

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Fri Apr 20 05:21:21 EDT 2007


> 
> ZIGLIO, Frediano, VF-IT wrote:
> > > 3- does odbc handle timeouts correctly? does it stop connection if
> > > cancel is not accepted?
> 
> AFAICT, no, it does not.  :-(
> 

Yes, you are right... test added (timeout4)

> > I have still to make a test... should be somthing like
> > - timeout
> > - send cancel
> > - still timeout
> > - close connection...
> 
> That's what I think should happen, too.  If you set you 
> query_timeout to
> X, you wait X for the query to complete, send a cancel, wait (up to) X
> again for a confirmation.  If none is received, close the 
> connection.  
> 
> That is, tdserror() will call the ODBC error handler (provided by the
> library; the client cannot install his own).  On timeout 1, 
> the handler
> returns TDS_INT_TIMOUT.  On timeout 2, the handler returns 
> TDS_INT_CANCEL.
>  The trick is to distinguish 1 from 2.  ;-)  
> 

Just check in_cancel !!

However... I fixed this case and even a small problem with SQLPrepare
(it didn't set timeout on connection leading to infinite timeout)

> BTW, I found this in the log, too, when running bsqlodbc:
> 
> util.c:110:logic error: cannot change query state from IDLE to PENDING
> 

Mmm... quite bad. The error is correct but probably the code isn't... It
something like expecting a reply without making a question! It can
happen however in cancellation... things are quite strange!

freddy77




More information about the FreeTDS mailing list