DB2 - Problembeschreibung
Problem IT28782 | Status: Geschlossen |
ALTER TABLE DROP CONSTRAINT DOES NOT INVALIDATE THE DEPENDENT PACKAGE AND CAUSES WRONG RESULTS TO BE RETURNED | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / B10 - DB2 | |
Problembeschreibung: | |
When there is a constraint defined on a table and a query makes use of the constraint for data partition elimination, a dependency on the constraint should be recorded for the query package. Db2 failed to record the dependency. The result is that a row inserted after dropping the constraint, that would have violated this constraint, may not be returned by the query. For example: CREATE TABLE T ( C1 INT NOT NULL, C2 INT NOT NULL ) PARTITION BY RANGE(C2) (PART "P01" STARTING(1) ENDING(10), PART "P02" STARTING(11) ENDING(20) ); CREATE INDEX I ON T ( C2 ASC, C1 ASC) PARTITIONED; ALTER TABLE T ADD CONSTRAINT C CHECK (C2 BETWEEN 1 AND 10) ENFORCED ENABLE QUERY OPTIMIZATION; -- Returns 0 rows as expected since table is empty. Query -- package is stored in the dynamic package cache SELECT * FROM T WHERE C1 = 99; C1 C2 ----------- ----------- 0 record(s) selected. -- Drop constraint, this should invalidate dynamic package ALTER TABLE T DROP CONSTRAINT C; -- Insert value outside of dropped constraint; INSERT INTO T VALUES ( 99, 11); -- Same query as before, now it should return the newly -- inserted row, but does not because Db2 failed to -- record dependency on the constraint SELECT * FROM T WHERE C1 = 99; C1 C2 ----------- ----------- 0 record(s) selected. | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 11.1 Mod 4 Fixpack 5 or higher * **************************************************************** | |
Local-Fix: | |
For static queries (e.g. embedded C or SQL procedures), manually rebind the corresponding package(s). For dynamic queries, either flush the dynamic package cache (FLUSH PACKAGE CACHE DYNAMIC), or close and re-establish database connection. | |
Lösung | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 12.04.2019 16.01.2020 16.01.2020 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
Problem behoben lt. FixList in der Version |