Skip to content

Commit

Permalink
A user asserts that certain 'output' parameters
Browse files Browse the repository at this point in the history
                      to SQLGetData must be initialized. While I have
                      never seen the failure he reports, initializing
      them appears to be Mostly Harmless, so do so. (Bug [0dda7dbb73])
  • Loading branch information
kennykb committed Jul 13, 2012
1 parent 5948b86 commit 4ac7e87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tdbcodbc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2012-07-13 Kevin B. Kenny <[email protected]>

* generic/tdbcodbc.c: A user asserts that certain 'output' parameters
to SQLGetData must be initialized. While I have
never seen the failure he reports, initializing
them appears to be Mostly Harmless, so do so.
(Bug [0dda7dbb73]).

2012-07-10 Kevin B. Kenny <[email protected]>

* generic/tdbcodbc.c: Fixed a non-static table argument to
Expand Down
3 changes: 3 additions & 0 deletions tdbcodbc/generic/tdbcodbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4143,6 +4143,7 @@ GetCell(
case SQL_BIGINT:
convertWide:
/* A wide integer */
colLen = sizeof(colWide); colWide = 0;
rc = SQLGetData(rdata->hStmt, i+1, SQL_C_SBIGINT,
(SQLPOINTER) &colWide, sizeof(colWide), &colLen);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
Expand All @@ -4162,6 +4163,7 @@ GetCell(
case SQL_TINYINT:
convertLong:
/* An integer no larger than 'long' */
colLen = sizeof(colLong); colLong = 0;
rc = SQLGetData(rdata->hStmt, i+1, SQL_C_SLONG,
(SQLPOINTER) &colLong, sizeof(colLong), &colLen);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
Expand Down Expand Up @@ -4194,6 +4196,7 @@ GetCell(
* A single- or double-precision floating point number.
* Reals are widened to doubles.
*/
colLen = sizeof(colDouble); colDouble = 0.0;
rc = SQLGetData(rdata->hStmt, i+1, SQL_C_DOUBLE,
(SQLPOINTER) &colDouble, sizeof(colDouble),
&colLen);
Expand Down

0 comments on commit 4ac7e87

Please sign in to comment.