home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Neueste VersionenFixList
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
Haben Sie Probleme? - Kontaktieren Sie uns.
Kostenlos registrieren anmeldung-x26
Kontaktformular kontakt-x26

DB2 - Problembeschreibung

Problem IC71704 Status: Geschlossen

DATE PREDICATES INCORRECTLY OPTIMIZED IN QUERY REWRITE.

Produkt:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problembeschreibung:
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-Zusammenfassung:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All users In V97                                             * 
**************************************************************** 
* 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.                                                   * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* We recomend applying FP4. It might be possible to rewrite    * 
* the query to avoid the issue                                 * 
****************************************************************
Local-Fix:
Rewriting the query by placing all constant terms on one side of 
the predicate might avoid the problem.
verfügbare FixPacks:
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Lösung
Problem fixed first in FP4
Workaround
keiner bekannt / siehe Local-Fix
Bug-Verfolgung
Vorgänger  : APAR is sysrouted TO one or more of the following: IC71959 IC71961 
Nachfolger : 
Weitere Daten
Datum - Problem gemeldet    :
Datum - Problem geschlossen :
Datum - der letzten Änderung:
05.10.2010
19.05.2011
19.05.2011
Problem behoben ab folgender Versionen (IBM BugInfos)
Problem behoben lt. FixList in der Version
9.7.0.4 FixList