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 IT18820 Status: Closed

WHEN RUNNING THE DYNAMIC SQL IN A PACKAGE, THE WRONG STATEMENT COULD BE
PICKED UP, RESULTING IN WRONG RESULT.

product:
DB2 FOR LUW / DB2FORLUW / B10 - DB2
Problem description:
This problem surfaces when running a jdbc or sqc package with 
dynamic SQL with 2 or more dynamic SQL statements in the 
package. And these consequite sql statements are identical in 
everything but literal values concatenated into sql through a 
separate variable. The second prepared statement in package can 
be mapped to the previously prepared statement in the package 
cache.  This leads the newly prepared statement to be executed 
as the previous statement in the package and thus leading to 
wrong results.  The problem surfaces when we have NULL bytes 
in a literal for the SQL statements. 
 
Here is snip of example code in Java for reference. 
----- 
        : 
 
    String key1 = new String('AAAAA'); 
    String key2 = new String('BBBBB'); 
 
    byte [] r1 = { (byte)0x00, (byte)0x00, (byte)0x00, 
        (byte)0x00, (byte)0x00 }; 
    byte [] r2 = { (byte)0xff, (byte)0xff, (byte)0xff, 
        (byte)0xff, (byte)0xff }; 
 
    String range1 = new String( r1 ); 
    String range2 = new String( r2 ); 
 
        : 
 
    PreparedStatement pstmt1 = con.prepareStatement("SELECT * 
      FROM T1 WHERE C1 BETWEEN '" + range1 + "' 
      AND '" + range2 + "' AND C2 = '" + key1 + "'"); 
 
        : 
 
    PreparedStatement pstmt2 = con.prepareStatement("SELECT * 
      FROM T1 WHERE C1 BETWEEN '" + range1 + "' 
      AND '" + range2 + "' AND C2 = '" + key2 + "'"); 
        : 
----- 
Even if key1 differs to key2, second query returns the same 
results as same as the first select statement.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* DB2 UDB Version 11.1                                         * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to Version 11.1 Mod Pack 1 Fix Pack 2.               * 
****************************************************************
Local Fix:
No workaround available.
available fix packs:
DB2 Version 11.1 Mod 2 Fix Pack 2 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod2 Fix Pack2 iFix001 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod2 Fix Pack2 iFix002 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod 3 Fix Pack 3 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod3 Fix Pack3 iFix001 for Linux, UNIX, and Windows
Db2 Version 11.1 Mod3 Fix Pack3 iFix002 for Linux, UNIX, and Windows

Solution
Problem was first fixed in DB2 UDB Version 11.1 Mod Pack 1 Fix 
Pack 2.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
13.01.2017
23.06.2017
23.06.2017
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)