You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Volodymyr Vysotskyi (JIRA)" <ji...@apache.org> on 2017/11/16 11:07:00 UTC

[jira] [Updated] (CALCITE-2055) Check year, month, day, hour, minute and second ranges for date and time literals

     [ https://issues.apache.org/jira/browse/CALCITE-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Volodymyr Vysotskyi updated CALCITE-2055:
-----------------------------------------
    Summary: Check year, month, day, hour, minute and second ranges for date and time literals  (was: Add check for year/month/day range)

> Check year, month, day, hour, minute and second ranges for date and time literals
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-2055
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2055
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Volodymyr Vysotskyi
>            Assignee: Julian Hyde
>
> Currently, if the year that is passed into {{DateString}} constructor has five digits, the first digit is trimmed. This trimming happens in the {{DateTimeStringUtils.int4()}} method:
> {code:sql}
>   private static void int4(StringBuilder buf, int i) {
>     buf.append((char) ('0' + (i / 1000) % 10));
>     buf.append((char) ('0' + (i / 100) % 10));
>     buf.append((char) ('0' + (i / 10) % 10));
>     buf.append((char) ('0' + i % 10));
>   }
> {code}
> The same problem with month and day values.
> Instead of trimming the value, the correct behaviour is to throw an exception if any of the values are outside the expected range.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)