[freetds] Query Time Out

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Tue Aug 8 08:57:43 EDT 2006


> Sorry, looks like my former post is missing:
> 
>  
> 
> Hi,
> 
>             When using the ODBC driver of FreeTDS, the query will time
> out if the query was sent by a statement used before. The 
> code was like:
> 
...
> 
>             It looks to me the tds->query_start_time inside the hstmt
> was not cleaned up correctly. (Actually the value is the old time for
> the first query) This data member looks like a new one to me. (I am
> still using the a FreeTDS version from 2004 and only recently 
> updated to
> the 0.64 stable)
> 
..

I got it
http://freetds.cvs.sourceforge.net/freetds/freetds/src/odbc/unittests/ti
meout2.c?view=markup

$ ./timeout2
odbctest
--------

connection parameters:
server:   'XXX'
user:     'test'
password: '????'
database: 'test'
use test
create table #timeout(i int)
insert into #timeout values(1)
Loop 0
Sleep 15 seconds to test if timeout occurs
Loop 1
timeout2.c:42 SQLExecute
SQL error S1T00 -- [FreeTDS][SQL Server]Timeout expired


The problem is in src/tds/query.c that do not set query_start_time for
tds_submit_execute. Perhaps the better solution is to set it in
src/tds/util.c but perhaps is better to make this change for next
version and change query.c for 0.64.

Thanks for report!

bye
  freddy77




More information about the FreeTDS mailing list