DB2 - Problem description
Problem IC83977 | Status: Closed |
WITH REOPT ENABLED, STATEMENTS CONTAINING ARRAY VARIABLES MIGHT PRODUCE INCORRECT OUTPUT | |
product: | |
DB2 FOR LUW / DB2FORLUW / 950 - DB2 | |
Problem description: | |
A statement that contains an array variable may produce incorrect output when run under REOPT ONCE or REOPT ALWAYS. The array variable will be treated as null in the statement. For this problem to occur, the statement must contain an array variable and one other variable that is not a LOB. For example: call sysproc.set_routine_opts('reopt always') Return Status = 0 create type myarray as integer array[10] DB20000I The SQL command completed successfully. create function foo () returns integer begin declare v1 myarray;-- declare index integer;-- declare returnVal integer default 0;-- set v1 = ARRAY[1, 3, 5];-- set index = 2;-- if v1[index] > index then set returnVal = 1;-- end if;-- return returnVal;-- end DB20000I The SQL command completed successfully. values foo() 1 ----------- 0 1 record(s) selected. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Apply v9.5 Fixpack 10 to the DB2 server. * **************************************************************** | |
Local Fix: | |
Do not run the statement using the REOPT option. | |
Solution | |
Problem was first fixed in v9.5 Fixpack 10. This is a DB2 server side fix. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 06.06.2012 21.08.2012 04.09.2012 |
Problem solved at the following versions (IBM BugInfos) | |
9.5.FP10 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.5.0.10 |