[freetds] FreeTDS and Ubuntu, iodbc

James K. Lowden jklowden at freetds.org
Tue Apr 24 00:42:09 EDT 2007


Dan Mohn wrote:
> Since I don't see a constant for
> Query Timeout in RealBasic and you reference SQLSetStmtAttr, I am
> assuming that it won't to the trick.  Especially since I tried it and it
> doesn't seem to work.  Does that sound correct based on your experience
> (not the realbasic stuff the connectattr vs. stmtattr)?

I have no relevant experience.  Perhaps someone else can help there.  

> >> 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. <<
> 
> I would like to do this to see if the timeout works in conjunction with
> Realbasic.  So I've done a bit of homework, and I just want confirmation
> that I am on the right track.  In odbc.c, line 1370 I see
> stmt->attr.query_timeout = 0, I should just be able to set this to 20,
> for 20 seconds.   Then rebuild TDS 0.65 nightly I downloaded?

Yes, you're on the right track.  You might want to just apply Frediano's
patch, posted at 11:07 AM Monday.  But if you want to just hack the code,
I think are two critical places:

  File      Function               Line
4 odbc.c    _SQLAllocStmt          1441 stmt->attr.query_timeout = 0;  
5 odbc.c    _SQLExecute            3032 tds->query_timeout = 0;

(Joys of cscope.)  

HTH.  

--jkl


More information about the FreeTDS mailing list