Bug #19823 SQLGetConnectAttr with SQL_ATTR_CONNECTION_TIMEOUT works incorrectly
Submitted: 15 May 2006 17:31 Modified: 9 Mar 2007 11:36
Reporter: Bogdan Degtyariov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.12 OS:
Assigned to: Georg Richter

[15 May 2006 17:31] Bogdan Degtyariov
Description:
SQL_ATTR_CONNECTION_TIMEOUT attribute doesn't have effect when used with SQLSetConnectAttr. If call SQLSetConnectAttr() and set the timeout then connect and SQLGetConnectAttr() it will 60*60*24*365 = 31536000 sec, but not the timeout set before.

How to repeat:
long timeout = 0;
int leng = 0;

SQLSetConnectAttr(hDbc, SQL_ATTR_CONNECTION_TIMEOUT, &timeout, sizeof(timeout) );
..........
res = SQLDriverConnect(hDbc, GetDesktopWindow(), connString, SQL_NTS, connOut, 255, &szConnOut, nPrompt);
..........
SQLGetConnectAttr(hDbc, SQL_ATTR_CONNECTION_TIMEOUT, &timeout, sizeof(timeout), &leng);

Test case will be uploaded below
[15 May 2006 17:33] Bogdan Degtyariov
test case

Attachment: test8073.c (text/x-csrc), 1.39 KiB.

[22 Feb 2007 4:43] Georg Richter
Fixed (Revision 211)
[22 Feb 2007 11:09] MC Brown
A note has been added to the 3.51.13 changelog.
[7 Mar 2007 6:46] Georg Richter
fixed (rev. 236)
[9 Mar 2007 11:36] MC Brown
The note has been moved to the 3.51.14 changelog.