DB2 - Problem description
Problem IC97852 | Status: Closed |
CLPPLUS DISPLAYS INCORRECT RESULT WHEN MORE THAN ONE LIKE CLAUSE IS SPECIFIED IN A SELECT STATEMENT | |
product: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
Problem description: | |
CLPPLus displays different result sets only when I change the predicate order within the where clause for character columns selected with LIKE '%1' or LIKE '%2'. SQL> create table test1 ( i int , text varchar(10) ) ; DB250000I: Der Befehl wurde erfolgreich ausgefチhrt. SQL> insert into test1 values (1, 'Text1'), (2, 'Text2') ; DB250000I: Der Befehl wurde erfolgreich ausgefチhrt. SQL> select * from test1 where i = 1 or i = 2 ; I TEXT ----------- ---------- 1 Text1 2 Text2 CORRECT RESULT ROWS! SQL> select * from test1 where text like '%1' or text like '%2' ; I TEXT ----------- ---------- INCORRECT RESULTSET!!! 1 Text1 => ONLY Row (1, ?Text1?) is returned and not (2, ?Text2?) -> Must also displayed in the result set SQL> select * from test1 where text like '%2' or text like '%1' ; I TEXT ----------- ---------- INCORRECT RESULTSET!!! 2 Text2 => ONLY Row (2, ?Text2?) is returned and not (1, ?Text1?) -> Must also displayed in the result set When the same SQLs are issued on the command line or Data Studio the results are correct! db2blu01@vmdb202:~> db2 "select * from test1 where i = 1 or i = 2 " I TEXT ----------- ---------- 1 Text1 2 Text2 2 record(s) selected. db2blu01@vmdb202:~> db2 "select * from test1 where text like '%1' or text like '%2' " I TEXT ----------- ---------- 1 Text1 2 Text2 2 record(s) selected. db2blu01@vmdb202:~> db2 "select * from test1 where text like '%2' or text like '%1' " I TEXT ----------- ---------- 1 Text1 2 Text2 2 record(s) selected. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Users using CLPPlus * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 10.5 Fix Pack 4. * **************************************************************** | |
Local Fix: | |
available fix packs: | |
DB2 Cancun Release 10.5.0.4 (also known as Fix Pack 4) for Linux, UNIX, and Windows | |
Solution | |
First fixed in DB2 Version 10.5 Fix Pack 4. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 21.11.2013 08.09.2014 08.09.2014 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.5.0.4 |