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 "Kathey Marsden (JIRA)" <ji...@apache.org> on 2013/07/03 17:38:20 UTC

[jira] [Updated] (DERBY-6080) Cast to same type changes result with IN subquery

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

Kathey Marsden updated DERBY-6080:
----------------------------------

    Issue & fix info: High Value Fix,Repro attached  (was: Repro attached)
    
> Cast to same type changes result with IN subquery
> -------------------------------------------------
>
>                 Key: DERBY-6080
>                 URL: https://issues.apache.org/jira/browse/DERBY-6080
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1, 10.8.1.2, 10.8.2.2, 10.8.3.0, 10.9.1.0, 10.10.1.1
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>              Labels: derby_triage10_11
>
> Given these tables
> ij> create table t4 (b bigint);
> 0 rows inserted/updated/deleted
> ij> insert into t4 values 9223372036854775806, 9223372036854775807;
> 2 rows inserted/updated/deleted
> ij> create table t5 (d double);
> 0 rows inserted/updated/deleted
> ij> insert into t5 values 9.223372036854776E18;
> 1 row inserted/updated/deleted
> the following two SELECT queries return different results:
> ij> select * from t4 where b in (select d from t5);
> B                   
> --------------------
> 9223372036854775807 
> 1 row selected
> ij> select * from t4 where b in (select cast(d as double) from t5);
> B                   
> --------------------
> 9223372036854775806 
> 9223372036854775807 
> 2 rows selected
> Since the only difference is D vs CAST(D AS DOUBLE), and the type of D is already DOUBLE, I'd expect the two queries to be equivalent.

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