DB2 - Problem description
Problem IT35058 | Status: Closed |
SUBSTR IN COLUMN ORGANIZED COLUMN COMPARISON RETURN WRONG RESULTS | |
product: | |
DB2 FOR LUW / DB2FORLUW / B50 - DB2 | |
Problem description: | |
Comparing a column from a column-organized table with an expression including the SUBSTR function may return wrong results, e.g.: db2 "insert into T(c1) values('201803')" db2 "select C1 from T where substr(C1,1,6) = substr('2018-03',1,4)|| substr('2018-03',6,2)" The problem occurs when the column is defined with string length unit CODEUNITS32 and the SUBSTR expression has constant arguments. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 version 11.5.6.0 * **************************************************************** | |
Local Fix: | |
Replace the constant SUBSTR expression with a constant, e.g. replace SUBSTR('2018-03',1,4) with '2018' and replace SUBSTR('2018-03',6,2) with '03'. | |
Solution | |
Workaround | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 version 11.5.6.0 * **************************************************************** | |
Comment | |
First fixed in Db2 version 11.5.6.0 | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 25.11.2020 21.06.2021 21.06.2021 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |