A fix is available
APAR status
Closed as program error.
Error 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.
Local fix
No workaround available.
Problem summary
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 10.1 Fix Pack 6 * ****************************************************************
Problem conclusion
First fixed in DB2 10.1 Fix Pack 6
Temporary fix
Comments
APAR Information
APAR number
IT18818
Reported component name
DB2 FOR LUW
Reported component ID
DB2FORLUW
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
YesHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2017-01-13
Closed date
2017-03-02
Last modified date
2017-03-02
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
DB2 FOR LUW
Fixed component ID
DB2FORLUW
Applicable component levels
RA10 PSN UP
FIX
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"10.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Document Information
Modified date:
02 March 2017