home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC77650 Status: Closed

DB2CLI CRASHES WHEN ODBC IS ON AND SQLGETDIAGFIELD IS CALLED FOR
UN-ALLOCATED STATEMENT HANDLE ON WINDOWS.

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
DB2CLI CRASHES WHEN ODBC IS ON AND SQLGETDIAGFIELD IS CALLED FOR 
UN-ALLOCATED STATEMENT HANDLE ON WINDOWS. 
Steps to reproduce 
 
opt callerror on 
opt callodbc on 
configdsn tttt add 
SQLAllocHandle SQL_HANDLE_ENV 0 1 
SQLAllocHandle SQL_HANDLE_DBC 1 1 
SQLDriverConnect 1 0 "DSN=tttt" -3 255 SQL_DRIVER_NOPROMPT 
sqlgetdiagfield sql_handle_stmt 1 0 SQL_DIAG_OVERRIDE_SQLSTATE 
"12345" 
 
It crashes here.  If there is a allocstmt just before the last 
statement it would not crash.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* When ODBC is used on Windows.                                * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* DB2CLI CRASHES WHEN ODBC IS ON AND SQLGETDIAGFIELD IS CALLED * 
* FOR                                                          * 
* UN-ALLOCATED STATEMENT HANDLE ON WINDOWS.                    * 
*                                                              * 
* Steps to reproduce                                           * 
*                                                              * 
*                                                              * 
*                                                              * 
* opt callerror on                                             * 
*                                                              * 
* opt callodbc on                                              * 
*                                                              * 
* configdsn tttt add                                           * 
*                                                              * 
* SQLAllocHandle SQL_HANDLE_ENV 0 1                            * 
*                                                              * 
* SQLAllocHandle SQL_HANDLE_DBC 1 1                            * 
*                                                              * 
* SQLDriverConnect 1 0 "DSN=tttt" -3 255 SQL_DRIVER_NOPROMPT   * 
*                                                              * 
* sqlgetdiagfield sql_handle_stmt 1 0                          * 
* SQL_DIAG_OVERRIDE_SQLSTATE                                   * 
* "12345"                                                      * 
*                                                              * 
*                                                              * 
*                                                              * 
* It crashes here.  If there is a allocstmt just before the    * 
* last                                                         * 
* statement it would not crash.                                * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to db2_v97fp5 or later releases.                     * 
****************************************************************
Local Fix:
Do not call sqlgetdiagfield  for un-allocated statement handle.
available fix packs:
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Solution
db2_v97fp5 contains the fix of this issue. After fix, crash will 
not happen. user will get appropriate error.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
21.07.2011
12.12.2011
12.12.2011
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.5 FixList