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

Pavel Pereslegin updated IGNITE-24984:
--------------------------------------
    Description: 
Example:
{code:sql}
SELECT TIMESTAMP '1234567-12-31 23:59:59'
{code}

Returns
{noformat}
4567-12-31T23:59:59
{noformat}

This affects {{TIMESTAMP}} and {{TIMESTAMP WITH LOCAL TIME ZONE}} literals

Looks like this applies only to year of ts type, some examples that works 
correctly
{code:sql}
SELECT TIMESTAMP '0000-12-31 23:59:59'; --- Illegal TIMESTAMP literal 
'0000-12-31 23:59:59': not in format 'yyyy-MM-dd HH:mm:ss'
SELECT TIMESTAMP '1234-13-31 24:59:59'; --- Illegal TIMESTAMP literal 
'1234-13-31 23:59:59': not in format 'yyyy-MM-dd HH:mm:ss'
SELECT DATE '12345-12-31'  --- Year out of range: [12345]
{code}

*Note*
Default value validation should be also fixed
{code:sql}
CREATE TABLE tx1(id int primary key, ts TIMESTAMP DEFAULT '10002-01-01 17:59:59'
{code}
Currently creates default as '0002-01-01 17:59:59'




  was:
Example:
{code:sql}
SELECT TIMESTAMP '1234567-12-31 23:59:59'
{code}

Returns
{noformat}
4567-12-31 23:59:59
{noformat}

This affects {{TIMESTAMP}} and {{TIMESTAMP WITH LOCAL TIME ZONE}} literals

Looks like this applies only to year of ts type, some examples that works 
correctly
{code:sql}
SELECT TIMESTAMP '0000-12-31 23:59:59'; --- Illegal TIMESTAMP literal 
'0000-12-31 23:59:59': not in format 'yyyy-MM-dd HH:mm:ss'
SELECT TIMESTAMP '1234-13-31 24:59:59'; --- Illegal TIMESTAMP literal 
'1234-13-31 23:59:59': not in format 'yyyy-MM-dd HH:mm:ss'
SELECT DATE '12345-12-31'  --- Year out of range: [12345]
{code}

*Note*
Default value validation should be also fixed
{code:sql}
CREATE TABLE tx1(id int primary key, ts TIMESTAMP DEFAULT '10002-01-01 17:59:59'
{code}
Currently creates default as '0002-01-01 17:59:59'





> Sql. An invalid YEAR field value can be specified in a timestamp literal
> ------------------------------------------------------------------------
>
>                 Key: IGNITE-24984
>                 URL: https://issues.apache.org/jira/browse/IGNITE-24984
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 3.0
>            Reporter: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>
> Example:
> {code:sql}
> SELECT TIMESTAMP '1234567-12-31 23:59:59'
> {code}
> Returns
> {noformat}
> 4567-12-31T23:59:59
> {noformat}
> This affects {{TIMESTAMP}} and {{TIMESTAMP WITH LOCAL TIME ZONE}} literals
> Looks like this applies only to year of ts type, some examples that works 
> correctly
> {code:sql}
> SELECT TIMESTAMP '0000-12-31 23:59:59'; --- Illegal TIMESTAMP literal 
> '0000-12-31 23:59:59': not in format 'yyyy-MM-dd HH:mm:ss'
> SELECT TIMESTAMP '1234-13-31 24:59:59'; --- Illegal TIMESTAMP literal 
> '1234-13-31 23:59:59': not in format 'yyyy-MM-dd HH:mm:ss'
> SELECT DATE '12345-12-31'  --- Year out of range: [12345]
> {code}
> *Note*
> Default value validation should be also fixed
> {code:sql}
> CREATE TABLE tx1(id int primary key, ts TIMESTAMP DEFAULT '10002-01-01 
> 17:59:59'
> {code}
> Currently creates default as '0002-01-01 17:59:59'



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

Reply via email to