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] Closed: (DERBY-4810) setTimestamp() methods don't agree on trailing zeros
Date Fri, 24 Sep 2010 11:25:32 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen closed DERBY-4810.
-------------------------------------

    Issue & fix info:   (was: [Patch Available])
       Fix Version/s: 10.7.0.0
          Resolution: Fixed

Committed revision 1000811.

> setTimestamp() methods don't agree on trailing zeros
> ----------------------------------------------------
>
>                 Key: DERBY-4810
>                 URL: https://issues.apache.org/jira/browse/DERBY-4810
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.7.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.7.0.0
>
>         Attachments: derby-4810-1a.diff, test.diff
>
>
> With the statement
>     VALUES CAST(? AS VARCHAR(29))
> PreparedStatement.setTimestamp(int,Timestamp) and PreparedStatement.setTimestamp(int,Timestamp,Calendar)
don't agree on what to do with trailing zeros in the nanosecond component. The method that
doesn't take a Calendar argument, removes trailing zeros. The method that takes a Calendar
object appends zeros so that the nanosecond component always has nine digits. (Both methods
have a special case when nanoseconds is zero, and they agree on adding just a single zero
after the decimal point in that case.)
> The format used by PreparedStatement.setTimestamp(int,Timestamp) matches what java.sql.Timestamp.toString()
returns (in fact, it uses Timestamp.toString() internally to produce the string representation),
and I think it would be reasonable to use that format for both the methods.

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