Bug #19823 SQLGetConnectAttr with SQL_ATTR_CONNECTION_TIMEOUT works incorrectly
Submitted: 15 May 2006 19:31 Modified: 9 Mar 2007 12:36
Reporter: Bogdan Degtyariov
Status: Closed
Category:Connector/ODBC Severity:S3 (Non-critical)
Version:3.51.12 OS:
Assigned to: Georg Richter Target Version:

[15 May 2006 19: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 19:33] Bogdan Degtyariov
test case

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

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