Description
The following interval arithmetic works incorrectly
select TIMESTAMP WITH LOCAL TIME ZONE '2021-01-01 00:00:00' + INTERVAL 1 MONTH -- result 2021-01-01 00:00:00.001 select TIMESTAMP WITH LOCAL TIME ZONE '2021-01-01 00:00:00' + INTERVAL 1 YEAR -- result 2021-01-01 00:00:00.012
Looks like the main issue is near StandardConvertletTable#convertPlus (selecting wrong execution branch)
switch (rex.getType().getSqlTypeName()) { case DATE: case TIME: case TIMESTAMP: // *_WITH_LOCAL_TIME_ZONE types missed
and probably in DatetimeArithmeticImplementor#implementSafe
default: final BuiltInMethod method = operand0.getType().getSqlTypeName() == SqlTypeName.TIMESTAMP ? BuiltInMethod.ADD_MONTHS : BuiltInMethod.ADD_MONTHS_INT; return Expressions.call(method.method, trop0, trop1);
Attachments
Issue Links
- is caused by
-
IGNITE-21551 Sql. Enable TIMESTAMP_WITH_LOCAL_TIME_ZONE data type
- Resolved