DB2 - Problem description
Problem IC95380 | Status: Closed |
DB2 MIGHT PRODUCE INCORRECT RESULT WHEN EXECUTING A QUERY WITH DATETIME PREDICATES | |
product: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
Problem description: | |
DB2 might produce incorrect result when executing a query with datetime predicates. The incorrect result will only happen if the table has a timestamp of the form 'YYYY-DD-MM:HH:MM:SS:24.00.00.000000' db2 "create table tablexyz (ts TIMESTAMP DEFAULT '2999-12-31-24.00.00.000000')" db2 "insert into tablexyz values ('2999-12-31-24.00.00.000000')" db2 "select * from tablexyz" TS -------------------------- 2999-12-31-24.00.00.000000 1 record(s) selected. Example 1: db2 "select * from tablexyz where date(ts) = '2999-12-31'" ts -------------------------- 0 record(s) selected. Example 2: db2 "select * from tablexyz where year(ts) = 2999" TS -------------------------- 0 record(s) selected. Example 3: db2 "select * from tablexyz where year(ts) = 2999 and month(ts) = 12" TS -------------------------- 0 record(s) selected. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 10.5 and Fix Pack 3 * **************************************************************** | |
Local Fix: | |
Workaround: Manually rewrite the predicate from date/year to timestamp format. Example1. select * from tablexyz where ts >= '2999-12-31-00.00.00.000000' and ts <= '2999-12-31-24.00.00.000000' example 2. select * from tablexyz where ts >= '2999-01-01-00.00.00.000000' and ts <= '2999-12-31-24.00.00.000000' select * from tablexyz where ts >= '2999-12-01-00.00.00.000000' and ts <= '2999-12-31-24.00.00.000000' | |
available fix packs: | |
DB2 Version 10.5 Fix Pack 3 for Linux, UNIX, and Windows | |
Solution | |
Problem was first fixed in DB2 Version 10.5 and Fix Pack 3 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 27.08.2013 27.02.2014 27.02.2014 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.5.0.3 | |
10.5.0.3 |