DB2 - Problembeschreibung
Problem IC74797 | Status: Geschlossen |
CREATION OF MQT WITH DISTINCT TYPE MAY SUCCEED UNEXPECTEDLY IN NUMBER OR ORA COMPATIBILITY MODE | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
With the number_compat database configuration parameter set to ON, creation of a refresh immediate MQT that references a distinct type as a group by column may succeed unexpectedly, while subsequent updates on the base table of the MQT may result in SQL0901N. SQL20058N rc 6 should have been returned during table creation. CREATE DISTINCT TYPE MONEY AS DECIMAL(8,2) WITH COMPARISONS; CREATE FUNCTION COUNT(MONEY) RETURNS INTEGER SOURCE COUNT(DECIMAL()); CREATE FUNCTION SUM(MONEY) RETURNS MONEY SOURCE SUM(DECIMAL()); create table t1(m1 money, m2 money); create table t2(m1, sum_m2, count_m2, count_all) as (select m1, sum(m2), count(m2), count(*) from t1 where m2 >= money(100.00) group by m1) data initially deferred refresh immediate disable query optimization; | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * User using NUMBER/ORA compatibility feature * **************************************************************** * PROBLEM DESCRIPTION: * * With the number_compat database configuration parameter set * * to ON, creation of a refresh immediate MQT that references a * * distinct type as a group by column may succeed unexpectedly, * * while subsequent updates on the base table of the MQT may * * result in SQL0901N. SQL20058N rc 6 should have been returned * * during table creation. * * * * CREATE DISTINCT TYPE MONEY AS DECIMAL(8,2) WITH COMPARISONS; * * CREATE FUNCTION COUNT(MONEY) RETURNS INTEGER SOURCE * * COUNT(DECIMAL()); * * CREATE FUNCTION SUM(MONEY) RETURNS MONEY SOURCE * * SUM(DECIMAL()); * * * * create table t1(m1 money, m2 money); * * * * create table t2(m1, sum_m2, count_m2, count_all) as * * (select m1, sum(m2), count(m2), count(*) from t1 where m2 * * >= money(100.00) * * group by m1) * * data initially deferred refresh immediate disable query * * optimization; * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 9.7 Fix Pack 4 or above. * **************************************************************** | |
Local-Fix: | |
Drop the MQT | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows | |
Lösung | |
The fix to properly return SQL20058N first appeared in DB2 9.7 Fix Pack 4. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 02.03.2011 28.04.2011 28.04.2011 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7., 9.7.FP4 | |
Problem behoben lt. FixList in der Version | |
9.7.0.4 |