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 IC71959 Status: Closed

DATE PREDICATES INCORRECTLY OPTIMIZED IN QUERY REWRITE.

product:
DB2 FOR LUW / DB2FORLUW / 910 - DB2
Problem description:
During query rewrite a date predicate is rewritten incorrectly. 
The Date arithmetic is not properly applied and the resulting 
optimized statement is not syntactically equivalent to the 
original query. 
 
For an example: 
 
Original Statement: 
------------------ 
select f02date 
from datetbl 
where (f02date + 2 month) = '2004-02-29' 
 
 
Optimized Statement: 
------------------- 
SELECT Q1.F02DATE AS "F02DATE" 
FROM MYSCHEMA.DATETBL AS Q1 
WHERE (Q1.F02DATE = '12/29/2003') 
 
As a result the return set will not contain rows that match the 
predicate.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* Date predicates are rewritten incorrectly.                   * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Apply FP10                                                   * 
****************************************************************
Local Fix:
Rewriting the query by placing all constant terms on one side of 
the predicate might avoid the problem.
available fix packs:
DB2 Version 9.1 Fix Pack 10  for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 11  for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 12  for Linux, UNIX and Windows

Solution
First fixed in FP10
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
15.10.2010
16.06.2011
16.06.2011
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
9.1.0.10 FixList