db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds
Date Mon, 30 Aug 2010 15:26:53 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904225#action_12904225
] 

Knut Anders Hatlen commented on DERBY-4625:
-------------------------------------------

Thanks, Nirmal.

Perhaps the change in DataTypeUtilities is better to leave out for now to make the impact
on the tests smaller. If I understand correctly, it doesn't seem to be strictly necessary
for getting the TIMESTAMP function to accept nanoseconds, it helps IJ display the entire value.
Maybe that change could be made as part of DERBY-4614 instead?

The patch seems to make an unintended change to the license header in SQLTimestamp.java.

The constant SQLTimestamp.FRACTION_TO_NANO is used in SQLChar.setValue(Timestamp,Calendar).
I think changing it from 1000 to 1 may make the calculations in SQLChar become wrong. (If
we fix DERBY-4626 that code will probably go away, though.)

It would also be good to have a test case (for example in DateTimeTest) that verifies that
the function now accepts nanosecond resolution.

> TIMESTAMP function doesn't accept nanoseconds
> ---------------------------------------------
>
>                 Key: DERBY-4625
>                 URL: https://issues.apache.org/jira/browse/DERBY-4625
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: C.S. Nirmal J. Fernando
>            Priority: Minor
>         Attachments: derby-4625-1.diff
>
>
> The TIMESTAMP function fails if the string argument specifies the number of nanoseconds.
It works if the argument is limited to microsecond resolution.
> ij> values timestamp('2010-04-21 12:00:00.123456');
> 1                         
> --------------------------
> 2010-04-21 12:00:00.123456
> 1 row selected
> ij> values timestamp('2010-04-21 12:00:00.123456789');
> ERROR 22008: '2010-04-21 12:00:00.123456789' is an invalid argument to the timestamp
function.
> Since Derby (and JDBC) supports nanosecond resolution, the TIMESTAMP function should
also support it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message