[
https://issues.apache.org/jira/browse/CALCITE-6536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17875065#comment-17875065
]
Petr Masopust commented on CALCITE-6536:
----------------------------------------
Btw there is no year "0000" - it is either 1 AD or 1 BC - see
https://en.wikipedia.org/wiki/Year_zero
> Dates before BC cannot be used as arguments to date functions
> -------------------------------------------------------------
>
> Key: CALCITE-6536
> URL: https://issues.apache.org/jira/browse/CALCITE-6536
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.37.0
> Reporter: Caican Cai
> Priority: Major
> Fix For: 1.38.0
>
>
> {code:java}
> f.checkScalar("date_add(date '0001-01-01', interval '-367' day)",
> "000/-12-31",
> "DATE NOT NULL");
> {code}
> This test is correct, but when I use 000/-12-31 as the parameter to test it
> fails
> {code:java}
> f.checkScalar("date_add(date '000/-12-31', interval 5 day)",
> "000-12-31",
> "DATE NOT NULL");
> org.apache.calcite.runtime.CalciteContextException: From line 1, column 18 to
> line 1, column 34: Illegal DATE literal '000/-12-31': not in format
> 'yyyy-MM-dd'
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)