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-5965) TimeHandlingTest.testCurrentTimestamp() failed: CURRENT TIME after end of statement
Date Mon, 15 Apr 2013 12:10:15 GMT

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

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

Actually, the current timestamp being one hour off isn't what's making the test fail. The
test inserts the current timestamp into a row in a table and reads it back out again. Since
Derby stores timestamps without the timezone, 2012-10-28 02:30:00 CET and 2012-10-28 02:30:00
CEST will be stored as the same value, 2012-10-28 02:30:00, so it doesn't influence the result
which of the two values CURRENT_TIMESTAMP returns. When reading the ambiguous timestamp back
from the table, Derby cannot tell whether the stored timestamp should be in CET or CEST, and
arbitrarily picks CET (actually, it's java.util.Calendar that picks standard/winter time when
an ambiguous time has been specified). Since we have no way of knowing the original timezone
of the timestamp once it has been stored in the database, this behaviour sounds reasonable
enough to me, and we should update the test to accept the returned timestamp in this scenario.
(We may do better when timestamp with timezone is implemented, DERBY-4611.)
                
> 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.1.1
>            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

Mime
View raw message