DB2 - Problem description
Problem IT34063 | Status: Closed |
BOOLEAN PREDICATES RETURN WRONG RESULT WITH NULL INPUT | |
product: | |
DB2 FOR LUW / DB2FORLUW / B10 - DB2 | |
Problem description: | |
The boolean predicates (IS TRUE, IS NOT FALSE etc.) are returning a NULL result with NULL input. Boolean predicates should never return a NULL result. When used in a where-clause, the problem may not be noticeable since a NULL (UNKNOWN) result in a where-clause returns 0 rows. However, the problem is apparent if the boolean predicate is preceded with NOT in the where-clause: create table T (B boolean) DB20000I The SQL command completed successfully. insert into T values (NULL) DB20000I The SQL command completed successfully. select * from T where not(B is false) B ------ | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 version 11.1 fix pack 6 * **************************************************************** | |
Local Fix: | |
Use the corresponding built-in functions instead: SYSIBM.ISTRUE, SYSIBM.ISNOTTRUE etc. | |
Solution | |
Workaround | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 version 11.1 fix pack 6 * **************************************************************** | |
Comment | |
First fixed in Db2 version 11.1 fix pack 6 | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 31.08.2020 17.03.2021 29.03.2021 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |