[freetds] FreeTDS and Ubuntu, iodbc

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Apr 23 11:07:33 EDT 2007


> Dan Mohn wrote:
> > 
> > For the 2nd test, I set the freetds.conf timeouts to 100, so they
> > wouldn't timeout at the WAITFOR, then after 20 seconds, 
> (even though it
> > wasn't timing out anyway, but just to be safe) I pull the 
> cable.  I did
> > this about an hour ago, but no response back. 
> 
> Hi Dan, 
> 
> Frediano just told me our ODBC driver doesn't honor the timeout in
> freetds.conf.  I didn't know that!  
> 
> According to the ODBC standard, it's up to the application to set a
> timeout via SQLSetStmtAttr(SQL_ATTR_QUERY_TIMEOUT).  AFAIK 
> the driver is
> allowed to have any default timeout it chooses.  FreeTDS's 
> default timeout
> is infinite; Microsoft's (AIUI) is shorter.  
> 
> What we can do is first add a timeout option to bsqlodbc, so 
> we can see if
> the timeout is working correctly or not.  And we can 
> (eventually) change
> the driver to respect the timeout in freetds.conf.  
> 
> Your original query had to do with RealBasic.  On the 
> evidence, it's not
> setting a timeout.  If we can demonstrate the ODBC driver 
> handles timeouts
> correctly, then the question becomes how to put one in effect when
> RealBasic is the "application".  I think you have these choices:
> 
> 1.  Wait for one of us to change the driver.  
> 2.  Change the driver yourself.
> 3.  Find the default timeout value (zero) in the ODBC driver, 
> set it to
> something you like, and rebuild.  I think this is the 
> simplest and easiest
> option if it meets your needs.  
> 

With this patch (attached) I got


$ time ./bsqlodbc -v -S$S -U$U -P$P -i timeout.sql
lt-bsqlodbc:265: Verbose operation enabled
lt-bsqlodbc:354: Query:
        print 'hello'
        select 1 as one
        WAITFOR DELAY '00:00:30'
        print 'goodbye'
        select 2 as two

lt-bsqlodbc: error -1: SQLExecute: SQL_ERROR: failed
"[FreeTDS][SQL Server]hello"
"[FreeTDS][SQL Server]Timeout expired"

real    0m10.165s
user    0m0.053s
sys     0m0.082s


which is ok !

freddy77

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vedi.diff
Type: application/octet-stream
Size: 5544 bytes
Desc: vedi.diff
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20070423/235522bd/attachment.obj 


More information about the FreeTDS mailing list