You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Bryan Pendleton (JIRA)" <ji...@apache.org> on 2008/10/28 20:53:44 UTC
[jira] Commented: (DERBY-2203) Not all documented TIMESTAMP formats
are properly recognized by TIMESTAMP() and CAST() functions
[ https://issues.apache.org/jira/browse/DERBY-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643321#action_12643321 ]
Bryan Pendleton commented on DERBY-2203:
----------------------------------------
I think that we should resolve this issue. As Andrew observed, we changed
the documentation as part of DERBY-234, and the current documentation
correctly describes that only the fractional seconds part is optional.
I propose to resolve this issue as a duplicate of DERBY-234.
> Not all documented TIMESTAMP formats are properly recognized by TIMESTAMP() and CAST() functions
> ------------------------------------------------------------------------------------------------
>
> Key: DERBY-2203
> URL: https://issues.apache.org/jira/browse/DERBY-2203
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.2.1.6
> Reporter: Oleksandr Alesinskyy
>
> Reference manual states
> "Derby supports the following formats for TIMESTAMP:
> yyyy-mm-dd hh[:mm[:ss[.nnnnnn]]]
> yyyy-mm-dd-hh[.mm[.ss[.nnnnnn]]]"
> There is following issue with this piece of documentation:
> 1.
> From this tatement follows that minutes, second and fractional seconds are optional.
> In reality it is not so. Only fractional seconds part is treated as optional, see below.
> Note that CAST and TIMESTAMP functions report different errors (SQL states), while, likely,
> they shall be the same.
> 1.1 Hours only
> values (TIMESTAMP('1969-10-01 00'));
> SQL State = 22008 SQL Code = -1 SQL Message = '1969-10-01 00' ist ein ungültiges Argument für die Funktion timestamp. Exception message = java.sql.SQLException: '1969-10-01 00' ist ein ungültiges Argument für die Funktion timestamp.
> values (CAST('1969-10-01 00' as timestamp));
> SQL State = 22007 SQL Code = -1 SQL Message = Die Syntax der Zeichenfolgendarstellung eines datetime-Wertes ist fehlerhaft. Exception message = java.sql.SQLException: Die Syntax der Zeichenfolgendarstellung eines datetime-Wertes ist fehlerhaft.
> 1.2. Hours and minutes
> values (TIMESTAMP('1969-10-01 00:00'));
> SQL State = 22008 SQL Code = -1 SQL Message = '1969-10-01 00:00' ist ein ungültiges Argument für die Funktion timestamp. Exception message = java.sql.SQLException: '1969-10-01 00:00' ist ein ungültiges Argument für die Funktion timestamp.
> values (CAST('1969-10-01 00:00' as timestamp));
> SQL State = 22007 SQL Code = -1 SQL Message = Die Syntax der Zeichenfolgendarstellung eines datetime-Wertes ist fehlerhaft. Exception message = java.sql.SQLException: Die Syntax der Zeichenfolgendarstellung eines datetime-Wertes ist fehlerhaft.
> 1.3 Hours, minutes and seconds - HU-R-R-A-H!
> values (TIMESTAMP('1969-10-01 00:00:00'));
> Run successful
> values (CAST('1969-10-01 00:00:00' as timestamp));
> Run successful
> 2. Second of above mentioned formats exhibits exactly the same behavior.
> I'm not sure if it is Derby bug or documentation bug, but, anyway, it shall be corrected here or there.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.