[
https://issues.apache.org/jira/browse/DERBY-3856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626970#action_12626970
]
Dag H. Wanvik commented on DERBY-3856:
--------------------------------------
The SQL standard has these productions:
<timestamp literal> ::= TIMESTAMP <timestamp string>
<timestamp string> ::= <quote> <unquoted timestamp string> <quote>
<unquoted timestamp string> ::= <unquoted date string> <space> <unquoted time
string>
so DerbyNetClient seems the closest to the standard. Derby doesn't
accept the TIMESTAMP literal either, of course,
cf. http://wiki.apache.org/db-derby/SQLvsDerbyFeatures, but uses a
built-in function. Still, it would be nice if the syntax for the
<timestamp string> was compliant, or at least lenient to accept the
standard form:
ij> values timestamp('2003-03-05 17.05.43.111111');
ERROR 22008: '2003-03-05 17.05.43.111111' is an invalid argument to the
timestamp function.
java.sql.SQLDataException: '2003-03-05 17.05.43.111111' is an invalid argument
to the timestamp function.
ij> values timestamp('2003-03-05-17.05.43.111111');
1
--------------------------
2003-03-05 17:05:43.111111
1 row selected
> difference between Embedded vs DerbyNetClient in format of return from
> timestamp(cast(? as varchar(32)))
> --------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3856
> URL: https://issues.apache.org/jira/browse/DERBY-3856
> Project: Derby
> Issue Type: Bug
> Affects Versions: 10.3.3.1, 10.4.2.0, 10.5.0.0
> Reporter: Myrna van Lunteren
>
> There is a slight difference in how Embedded vs. DerbyNetClient return a
> specific cast.
> This showed up during conversion of the test lang/datetime.sql which before
> was only run with Embedded...
> The following sql:
> prepare dateTimePS as 'values( date(cast(? as integer)),timestamp(cast(? as
> varchar(32))))';
> execute dateTimePS using 'values(cast(1 as integer),
> ''2003-03-05-17.05.43.111111'')';
> gives:
> 1 |2
> -------------------------------------
> Embedded: 1970-01-01|2003-03-05-17.05.43.111111
> DerbyNetClient: 1970-01-01|2003-03-05 17:05:43.111111
> (in Embedded there's a '-' between date and time part, with DerbyNetClient a
> space; with Embedded the separator between time elements is ., with
> DerbyNetClient :. Embedded reflects the data as passed in, with
> DerbyNetClient it seems to be the default timestamp format).
> I am not sure which is correct at this point, but I confirmed the behavior is
> like this in latest builds of trunk and 10.3 and 10.4 branches.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.