[
https://issues.apache.org/jira/browse/DERBY-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Knut Anders Hatlen updated DERBY-2447:
--------------------------------------
Component/s: SQL
Derby Info: (was: [Patch Available])
Issue Type: Improvement (was: Bug)
Good point about adding a comment about the JVM bug, Bryan. And the more I
think about it, the more I think your suggestion about just changing (v ==
0.0f) to (v == -0.0f) is better (simpler and just as clear) than the extra
helper method. So I'll post a new patch.
As to testing, it should be easy enough to write a test that fails reliably on
a JVM with this bug. For instance, we could prepare the statement "VALUES
-CAST(? AS REAL)", set the parameter to 0 and execute it 10000 times. After
about 5000-6000 executions it should stop returning 0.0 and start returning
-0.0. I can add a test case doing that in the next patch (unless someone thinks
it's a bad idea to add a regression test for something that's arguably a JVM
bug).
Changing issue type from bug to improvement, since this is not a Derby bug and
we just add a workaround that happens to make the intention of the code clearer.
> ejbql and floattypes in
> org.apache.derbyTesting.functionTests.tests.lang.LangScripts intermittently
> fails with 'expected:<[0.0 ] > but was:<[-0.0] '
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2447
> URL: https://issues.apache.org/jira/browse/DERBY-2447
> Project: Derby
> Issue Type: Improvement
> Components: Regression Test Failure, SQL
> Affects Versions: 10.3.1.4
> Environment: OS: Red Hat Enterprise Linux AS release 4 (Nahant Update
> 3) 64bits - Linux 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 GNU/Linux
> JVM: Sun Microsystems Inc. 1.5.0_07-b03
> OS: Solaris 10 6/06 s10s_u2wos_09a SPARC 64bits - SunOS 5.10 Generic_118833-17
> JVM: Sun Microsystems Inc. - 1.5.0_07-b03
> Reporter: Ole Solberg
> Assignee: Knut Anders Hatlen
> Priority: Minor
> Attachments: negative-zero.diff, Normalize.java
>
>
> Seen intermittently on Linux since 2007-02-27.
> Seen on Solaris 2007-03-12.
> <signature>
> ejbql(org.apache.derbyTesting.functionTests.tests.lang.LangScripts)junit.framework.ComparisonFailure:
> Output at line 454 expected:<[0.0 ] > but was:<[-0.0] >
> at
> org.apache.derbyTesting.functionTests.util.CanonTestCase.compareCanon(CanonTestCase.java:100)
> at
> org.apache.derbyTesting.functionTests.util.ScriptTestCase.runTest(ScriptTestCase.java:124)
> at
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:80)
> 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)
> </signature>
> <signature>
> floattypes(org.apache.derbyTesting.functionTests.tests.lang.LangScripts)junit.framework.ComparisonFailure:
> Output at line 1823 expected:<[0.0 ] > but was:<[-0.0] >
> at
> org.apache.derbyTesting.functionTests.util.CanonTestCase.compareCanon(CanonTestCase.java:100)
> at
> org.apache.derbyTesting.functionTests.util.ScriptTestCase.runTest(ScriptTestCase.java:124)
> at
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:80)
> 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)
> </signature>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.