Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#433 Timestamp.toString changed by getTimestamp/getString order

closed
5
2014-07-09
2005-08-18
Evan Schnell
No

Affects Version 1.1 with the patch listed in bug 1235845.

The patch fixed a similar issue with the date but there
appears to still be an issue with times.

The toString() value for the java.sql.Timestamp
returned by getTimestamp() is different depending upon
whether getString() before getTimestamp() on the same
column in a ResultSet.

In the attached TestCase, testTimestampAsString() and
testTimestampAsTimestamp() yet testBoth() will fail
because in the call to rs.getString() alters the value
somehow.

Discussion

  • Evan Schnell
    Evan Schnell
    2005-08-18

    JUnit Test Case

     
    Attachments
  • Evan Schnell
    Evan Schnell
    2005-08-18

    Logged In: YES
    user_id=1320476

    DDL for Test Case:

    drop table ttable;
    create table ttable (tcol DATETIME);

     
  • Logged In: YES
    user_id=641437

    Unfortunately the original patch contained a subtle error
    that causes the problem you report. Alin spotted the error
    and fixed it in the version of the patch that was committed
    to the CVS. I strongly recommend that you download the
    latest source from the CVS and build a new version of the
    driver. If you wish you can just replace the relevant class
    by downloading DateTime.java from the CVS using the web
    interface and combining it with the source distribution.

     
  • Alin Sinpalean
    Alin Sinpalean
    2005-09-16

    Logged In: YES
    user_id=564978

    Closing bug, already fixed in CVS.