strange datediff behaviour
Posted: Mon 12 Apr 2021 20:19
using oracle 12.2, unidac 8.3.2, c++ builder 10.3.2, VCL win32.
select {fn DATEDIFF(DAY,SYSDATE+5, SYSDATE+6)} from dual
=>Expected 1, but answer is 11: floor (sysdate+6-sysdate+5).
select {fn DATEDIFF(DAY,(SYSDATE+5),(SYSDATE+6))} from dual
returns the right value.
I think unidac should add parentheses automatically.
select {fn DATEDIFF(DAY,SYSDATE+5, SYSDATE+6)} from dual
=>Expected 1, but answer is 11: floor (sysdate+6-sysdate+5).
select {fn DATEDIFF(DAY,(SYSDATE+5),(SYSDATE+6))} from dual
returns the right value.
I think unidac should add parentheses automatically.