home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IT01197 Status: Closed

QUERY MIGHT HAVE OR PREDICATE WRONGLY REMOVED RESULTING IN EXTRA ROWS IN
THE RESULTS

product:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problem description:
A query might return additional rows when it has an OR predicate 
that meets the following conditions: 
- The query has an OR predicate, called orPrd, that is either 
present in a table inner join query block or simply applied to a 
single table scan. 
- The orPrd has an IN predicate, called inPrd. 
- The inPrd predicate has pattern of <simple_base_columnX> IN 
(<column_or_literal1>, <column_or_literal2>, ...), where one of 
the <column_or_literal> is <simple_base_columnX> itself. An 
example predicate is "col1 in (constant1, constant2, col1, 
col2)", where col1 is not only IN predicate column but also an 
INlist element. 
- The inPrd column,  <simple_base_columnX> as above for example, 
is defined as nullable. There is table rows whose columnX is the 
NULL value. 
- The query has no predicate other than orPrd that can reject 
the columnX Null value. For example, if query has relational 
comparison predicate such as columnX = columnY, columnX NULL 
values will be filtered out. 
 
To verify if the query hits this problem, use the db2exfmt or 
db2explin commands to generate db2exfmt a query explain plan. 
Search the query explain plan to verify if the original query's 
OR predicate is present in the section "Optimized Statement". 
 
This problem might cause the orPrd predicate to be incorrectly 
removed. This might result in the columX NULL value being 
incorrectly returned to the consumer query block. This error 
might make the final result inaccurate.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All users                                                    * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 version 10.1.0.4.                             * 
****************************************************************
Local Fix:
There are two workarounds for this issue: 
- Reduce query optimization to 0 or 1. A sample command is "db2 
set current query optimization 0". 
- Manually rewrite that OR predicate. Change it from 
"<simple_base_columnX> IN (<column_or_literal1>, 
<column_or_literal2>, ...)" to "<simple_base_columnX> IS NOT 
NULL".
available fix packs:
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 6 for Linux, UNIX, and Windows

Solution
The problem is first fixed in DB2 version 10.1.0.4.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
22.04.2014
08.05.2014
26.05.2014
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.1.0.4 FixList