DB2 - Problem description
Problem IC85422 | Status: Closed |
QUERY WITH A UNION AND TWO CORRELATED BRANCHES MIGHT RETURN INCORRECT RESULTS IN PARTITIONED DATABASE ENVIRONMENTS | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
If you are using the partitioned database environment and your query satisfies the following conditions, then the results returned might be incorrect 1. there is a table, T1, that is hash distributed across two or more database partitions; 2. T1 is correlated to multiple branches below a UNION; 3. each branch of the UNION is correlated to at least one different column in T1; 4. one of the branches is correlated to the hash distribution key of T1; 5. the columns in the select list of each UNION branch includes the correlation column. The following is an example of a query that satisfies the above conditions, where T1 is hash distributed on column X: SELECT * FROM T1, TABLE(SELECT X FROM T2 WHERE X = T1.X UNION ALL SELECT Y FROM T3 WHERE Y = T1.Y); | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * All users of database partitioning feature. * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 version 9.7.0.7. * **************************************************************** | |
Local Fix: | |
You can avoid the problem by rewriting the query to remove the correlation below the UNION. | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows | |
Solution | |
The problem is first fixed in DB2 version 9.7.0.7. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 19.07.2012 18.10.2012 07.12.2012 |
Problem solved at the following versions (IBM BugInfos) | |
9.7.0.7 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.7 |