Project

General

Profile

Bug #5476

Bug in Java UDF addinterval(date, ...)

Added by Igor Skornyakov almost 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/18/2021
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

History

#1 Updated by Igor Skornyakov almost 3 years ago

The statement select public.addinterval(date '1999-01-08', 1, 'months') works fine, while select public.addinterval(date '1999-01-08', 1, 'weeks') fails:

SQL Error [XX000]: ERROR: java.lang.ClassCastException: com.goldencode.p2j.util.date cannot be cast to com.goldencode.p2j.util.datetime

The "trivial" fix with replacing new date with new datetime as the first argument of the DateOps.addInterval() call helps to get rid of the exception but the returned result is still incorrect for unit == "minutes" or less.

Also available in: Atom PDF