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

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

This may actually be a product bug and not a test issue. I changed the time on 
my computer to less than one hour before the switch from DST to standard time 
and executed the following code:

        Connection c = 
DriverManager.getConnection("jdbc:derby:memory:db;create=true");
        PreparedStatement ps = c.prepareStatement("values current timestamp");
        ResultSet rs = ps.executeQuery();
        rs.next();
        System.out.println(rs.getTimestamp(1).getTime() - 
System.currentTimeMillis());

I'd expect it to print a number close to 0, but instead it printed something 
close to 3600000. That is, VALUES CURRENT TIMESTAMP returned a timestamp 
representing the time one hour into the future.
                
> TimeHandlingTest.testCurrentTimestamp() failed: CURRENT TIME after end of 
> statement
> -----------------------------------------------------------------------------------
>
>                 Key: DERBY-5965
>                 URL: https://issues.apache.org/jira/browse/DERBY-5965
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.10.0.0
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>
> Saw these failures, happening around the time Europe switched from DST:
> http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/sles/1402814-suitesAll_diff.txt
> 1) 
> testCurrentTimestamp(org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest)junit.framework.AssertionFailedError:
>  CURRENT TIME after end of statement
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentTimestampValue(TimeHandlingTest.java:804)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentTimestampMultiple(TimeHandlingTest.java:571)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentMultiple(TimeHandlingTest.java:504)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentQuery(TimeHandlingTest.java:479)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.currentFunctionTests(TimeHandlingTest.java:291)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.testCurrentTimestamp(TimeHandlingTest.java:269)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 2) 
> testCurrentTimestamp(org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest)junit.framework.AssertionFailedError:
>  CURRENT TIME after end of statement
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentTimestampValue(TimeHandlingTest.java:804)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentTimestampMultiple(TimeHandlingTest.java:571)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentMultiple(TimeHandlingTest.java:504)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.checkCurrentQuery(TimeHandlingTest.java:479)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.currentFunctionTests(TimeHandlingTest.java:291)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest.testCurrentTimestamp(TimeHandlingTest.java:269)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
>       at 
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to