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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/04/21 12:58:51 UTC

[jira] Created: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

TIMESTAMP function doesn't accept nanoseconds
---------------------------------------------

                 Key: DERBY-4625
                 URL: https://issues.apache.org/jira/browse/DERBY-4625
             Project: Derby
          Issue Type: Bug
    Affects Versions: 10.5.3.0
            Reporter: Knut Anders Hatlen
            Priority: Minor


The TIMESTAMP function fails if the string argument specifies the number of nanoseconds. It works if the argument is limited to nanosecond 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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "C.S. Nirmal J. Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12905365#action_12905365 ] 

C.S. Nirmal J. Fernando commented on DERBY-4625:
------------------------------------------------

Hi,

I have attached a patch to DERBY-4614 which is intended to address this issue as well.
Since both issues are co-related to some extent, it's difficult to provide a separate patch.

Thanks.

> 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.


[jira] Updated: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4625:
--------------------------------------

    Description: 
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.

  was:
The TIMESTAMP function fails if the string argument specifies the number of nanoseconds. It works if the argument is limited to nanosecond 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.


> 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
>            Priority: Minor
>
> 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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "C.S. Nirmal J. Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12905167#action_12905167 ] 

C.S. Nirmal J. Fernando commented on DERBY-4625:
------------------------------------------------

Hi Knut,

Thanks for reviewing the patch.

>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.) 

Without changing 1000 to 1 we can't get the expected result. I am wondering whether there are test cases which is addressed this setValue(..) function. If so since I did not find any regression failures regarding that, can't we conclude that the calculations of SQLChar are still correct?

Thanks.

> 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.


[jira] Updated: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4625:
--------------------------------------

    Component/s: SQL

> 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
>            Priority: Minor
>
> The TIMESTAMP function fails if the string argument specifies the number of nanoseconds. It works if the argument is limited to nanosecond 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.


[jira] Updated: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "C.S. Nirmal J. Fernando (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

C.S. Nirmal J. Fernando updated DERBY-4625:
-------------------------------------------

    Attachment: derby_4625-2.diff

> 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, derby_4625-2.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.


[jira] Assigned: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "C.S. Nirmal J. Fernando (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

C.S. Nirmal J. Fernando reassigned DERBY-4625:
----------------------------------------------

    Assignee: C.S. Nirmal J. Fernando

> 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
>
> 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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860824#action_12860824 ] 

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

Hi Thiwanka,

At compile time, calls to the TIMESTAMP function are represented by the TimestampOperatorNode class. At run time, the parsing of the timestamp string is performed by SQLTimestamp.parseTimestamp().

> 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
>            Priority: Minor
>
> 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.


[jira] Closed: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-4625.
-------------------------------------

    Fix Version/s: 10.7.0.0
       Resolution: Fixed

All the regression tests ran cleanly.
Committed revision 999479.

> 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
>             Fix For: 10.7.0.0
>
>         Attachments: derby-4625-1.diff, derby_4625-2.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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913005#action_12913005 ] 

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

Thanks, Nirmal!

The patch looks good to me. The new test case in DateTimeTest was commented out. I've commented it back in and started the regression tests suites. I'll commit the fix if the tests pass.

> 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, derby_4625-2.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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "C.S. Nirmal J. Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910549#action_12910549 ] 

C.S. Nirmal J. Fernando commented on DERBY-4625:
------------------------------------------------

Patch #2 is addressing Knut's latest comment!
Hope this issue is solved now!

Thanks.

> 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, derby_4625-2.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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "A.S.Thiwanka Somasiri (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860562#action_12860562 ] 

A.S.Thiwanka Somasiri commented on DERBY-4625:
----------------------------------------------

Hi Knut,
                 What are the classes that are used to call the timestamp functions?I referred mechanisms in UnaryDateTimestampOperatorNode.java class to some extent.

Thanks.

> 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
>            Priority: Minor
>
> The TIMESTAMP function fails if the string argument specifies the number of nanoseconds. It works if the argument is limited to nanosecond 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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12905434#action_12905434 ] 

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

> I am wondering whether there are test cases which is addressed this
> setValue(..) function. If so since I did not find any regression
> failures regarding that, can't we conclude that the calculations of
> SQLChar are still correct?

It seems that the calculation in SQLChar changed, but in a way that
fixed DERBY-4626. So that's actually a good thing! :)

However, the change also makes the code in SQLChar a bit
confusing. Take for instance this fragment:

    int micros = 
        (theValue.getNanos() + SQLTimestamp.FRACTION_TO_NANO/2) / 
            SQLTimestamp.FRACTION_TO_NANO;

After the patch, the micros variable will actually hold the nanosecond
value, so we should change its name to nanos. Also, since the above
code now transforms nanoseconds to nanoseconds (that is, it doesn't do
anything), we should probably simplify it to:

    int nanos = theValue.getNanos();

> 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.


[jira] Commented: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (DERBY-4625) TIMESTAMP function doesn't accept nanoseconds

Posted by "C.S. Nirmal J. Fernando (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

C.S. Nirmal J. Fernando updated DERBY-4625:
-------------------------------------------

    Attachment: derby-4625-1.diff

Hi,

I'm attaching a patch which solves this issue. 
This will probably break some tests since some properties have changed.
I'm running tests now, and will attach a patch which will address updates
to those tests soon.

Thanks.

> 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.