You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Pereslegin (Jira)" <ji...@apache.org> on 2025/03/27 16:18:00 UTC

[jira] [Updated] (IGNITE-24947) Sql. Add validation for cast VARCHAR::DATE/TIMESTAMP with zero DAY value

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

Pavel Pereslegin updated IGNITE-24947:
--------------------------------------
    Description: 
{code:sql}
SELECT '0001-00-01'::DATE   -- Throws: Value of MONTH field is out of range in '0001-00-01' (correct)
SELECT '0001-01-00'::DATE   -- produces invalid result [0000-12-31]
{code}

This affects TIMESTAMP/TIMESTAMP_WITH_LOCAL_TIME_ZONE also.

For literal value exception is thrown.
{code:sql}
SELECT date '0001-01-00'   -- Illegal DATE literal '0001-01-00': not in format 'yyyy-MM-dd'
{code}
Not exact, but looks acceptable.

  was:
{code:sql}
SELECT '0001-00-01'::DATE   -- Throws: Value of MONTH field is out of range in '0001-00-01'
SELECT '0001-01-00'::DATE   -- produces invalid result [0000-12-31]
{code}

This affects TIMESTAMP/TIMESTAMP_WITH_LOCAL_TIME_ZONE also.

For literal value exception is thrown.
{code:sql}
SELECT date '0001-01-00'   -- Illegal DATE literal '0001-01-00': not in format 'yyyy-MM-dd'
{code}
Not exact, but looks acceptable.


> Sql. Add validation for cast VARCHAR::DATE/TIMESTAMP with zero DAY value
> ------------------------------------------------------------------------
>
>                 Key: IGNITE-24947
>                 URL: https://issues.apache.org/jira/browse/IGNITE-24947
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>
> {code:sql}
> SELECT '0001-00-01'::DATE   -- Throws: Value of MONTH field is out of range in '0001-00-01' (correct)
> SELECT '0001-01-00'::DATE   -- produces invalid result [0000-12-31]
> {code}
> This affects TIMESTAMP/TIMESTAMP_WITH_LOCAL_TIME_ZONE also.
> For literal value exception is thrown.
> {code:sql}
> SELECT date '0001-01-00'   -- Illegal DATE literal '0001-01-00': not in format 'yyyy-MM-dd'
> {code}
> Not exact, but looks acceptable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)