You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2013/02/26 22:54:13 UTC

[jira] [Reopened] (DERBY-6017) IN lists with mixed types may return wrong results

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

Knut Anders Hatlen reopened DERBY-6017:
---------------------------------------


The test for this issue is failing on weme. For example here: http://people.apache.org/~myrnavl/derby_test_results/main/windows/testlog/weme6.2/1450000-suites.All_diff.txt

There was 1 failure:
1) testMixedTypes(org.apache.derbyTesting.functionTests.tests.lang.InPredicateTest)junit.framework.AssertionFailedError: Column value mismatch @ column 'R1', row 1:
    Expected: >2.14748365E9<
    Found:    >2.1474836E9<

It looks like doubles are formatted differently on that platform. I'll see if I can make the test more robust against formatting differences.
                
> IN lists with mixed types may return wrong results
> --------------------------------------------------
>
>                 Key: DERBY-6017
>                 URL: https://issues.apache.org/jira/browse/DERBY-6017
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.9.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.10.0.0
>
>         Attachments: d6017-1a-duplicates.diff, d6017-2a-cast-if-needed.diff
>
>
> Given this table:
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> create table t(x bigint);
> 0 rows inserted/updated/deleted
> ij> insert into t values 9223372036854775805, 9223372036854775806, 9223372036854775807;
> 3 rows inserted/updated/deleted
> A query that uses an IN list that contains all the three values actually stored in the table, returns all three rows as expected:
> ij> select * from t where x in (9223372036854775805, 9223372036854775806, 9223372036854775807);
> X                   
> --------------------
> 9223372036854775805 
> 9223372036854775806 
> 9223372036854775807 
> 3 rows selected
> However, if we add a value whose type precedence is higher, like a DOUBLE value, and that value happens to be equal to the approximation of the other values in the IN list when they are cast from BIGINT to DOUBLE, only one row is returned:
> ij> select * from t where x in (9223372036854775805, 9223372036854775806, 9223372036854775807, 9.223372036854776E18);
> X                   
> --------------------
> 9223372036854775805 
> 1 row selected
> I believe this query should return all three rows too.

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