DB2 - Problem description
Problem IT23261 | Status: Closed |
INCORRECT RESULTS WITH AGGREGATION ON OUTER JOINED TABLE WITH FOREIGN KEY ON NULL PRODUCING TABLE | |
product: | |
DB2 FOR LUW / DB2FORLUW / B10 - DB2 | |
Problem description: | |
Incorrect results might be observed from queries: 1. contain at least one of these aggregations: COUNT(*), COUNT_BIG(*), COUNT(CONSTANT), COUNT_BIG(CONSTANT), SUM(CONSTANT), MAX(CONSTANT) and MIN(CONSTANT) 2. the aggregations are on outer joined tables; 3. a foreign key on the NULL producing table of the outer join references the primary key on the table at the other side of the outer join; An example query: SELECT T1.X, COUNT (*) as c1 from TABLE_1 T1 left join TABLE_2 T2 on (T1.X = T2.Y) group by T1.X whereas TABLE_1.X is the primary key and TABLE_2.Y is a foreign key referencing the primary key TABLE_1.X | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * All Db2 users * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 11.1.3.3 or later. * **************************************************************** | |
Local Fix: | |
Set OPT level 1 by adding the following text after the problematic query: /* <OPTGUIDELINES> <QRYOPT VALUE='1'/> </OPTGUIDELINES> */ | |
available fix packs: | |
Db2 Version 11.1 Mod 3 Fix Pack 3 for Linux, UNIX, and Windows | |
Solution | |
First fixed in Db2 11.1.3.3 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 23.11.2017 15.03.2018 16.03.2018 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |