DB2 - Problem description
| Problem IC69875 | Status: Closed |
INCORRECTLY BLANK PADDED OR CASE INSENSITIVE RESULTS ARE RETURNE DWHEN COMPARING COLUMNS OF CERTAIN DATATYPES | |
| product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
| Problem description: | |
The problem occurs when performing string comparisons between
two columns and referencing any one or
both of these columns in the output column list. Column
can be of datatypes char, varchar, graphic, vargraphic and any
user defined
types.
eg. To demonstrate the incorrect results:
1. Blank padded results
CREATE TABLE EMPLOYEE ("PER_ID1" CHAR(12) NOT NULL );
CREATE TABLE PERSON ("PER_ID2" CHAR(12) NOT NULL );
insert into employee values '1117592';
insert into person values '1117592 ';
SELECT EMPLOYEE.PER_ID1 || '$' AS "EMPLOYEE.PER_ID1" ,
PERSON.PER_ID2 || '$' AS "PERSON.PER_ID2"
FROM EMPLOYEE
LEFT OUTER JOIN PERSON
ON EMPLOYEE.PER_ID1 = PERSON.PER_ID2
WHERE PERSON.PER_ID2 = '1117592' ;
EMPLOYEE.PER_ID1 PERSON.PER_ID2
---------------- --------------
1117592$ 1117592$
1 record(s) selected.
Note that the second output column PERSON.PER_ID2 should be
'1117592 $' (with a blank character before $.)
2. Case insensitive results
create db testdb COLLATE USING UCA500R1_LEN_S2;
create table tab1(i varchar(5));
create table tab2(j varchar(5));
insert into tab1 values('case'),('CASE');
insert into tab2 values('case'),('CASE');
SELECT i, j FROM (
SELECT ROW_NUMBER() OVER() AS RN, i, j FROM
tab1,tab2
WHERE i = j )
where RN != 0;
I J
----- -----
case case
CASE CASE
case case
CASE CASE
Expected results are:
I J
----- -----
case case
CASE case
case CASE
CASE CASE | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Users doing string comparison may be vulnerable. * **************************************************************** * PROBLEM DESCRIPTION: * * Incorrectly Blank Padded or Case Insensitive results * * arereturn during string comparison for data types * * char,varchar, graphic, vargraphic and anyuser defined * **************************************************************** * RECOMMENDATION: * * NONE * **************************************************************** | |
| Local Fix: | |
| available fix packs: | |
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows | |
| Solution | |
Issue first fixed in V9.7 Fixpack 3 | |
| Workaround | |
not known / see Local fix | |
| BUG-Tracking | |
forerunner : APAR is sysrouted TO one or more of the following: IC70000 IC70090 follow-up : | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 13.07.2010 30.09.2010 30.09.2010 |
| Problem solved at the following versions (IBM BugInfos) | |
9.7.FP3 | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 9.7.0.3 |
|
| 9.7.0.3 |
|