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-4001) Sequence comparison with "ALL" does not yield correct results
Date Fri, 27 Mar 2009 13:38:51 GMT

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

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

Same problem exists for NOT IN queries when both sides are not nullable (they get rewritten
to NOT EXISTS in that case).

ij> create table t(x int);
0 rows inserted/updated/deleted
ij> insert into t values 1,2,3;
3 rows inserted/updated/deleted
ij> select * from t where x not in (select x from t where 1<>1); -- ok, not rewritten
because x is nullable
X          
-----------
1          
2          
3          

3 rows selected
ij> alter table t alter column x not null;
0 rows inserted/updated/deleted
ij> select * from t where x not in (select x from t where 1<>1); -- wrong result,
query rewritten to NOT EXISTS because x is not nullable
X          
-----------

0 rows selected

> Sequence comparison with "ALL" does not yield correct results
> -------------------------------------------------------------
>
>                 Key: DERBY-4001
>                 URL: https://issues.apache.org/jira/browse/DERBY-4001
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.2.1
>         Environment: Windows
>            Reporter: Venkateswaran Iyer
>            Priority: Minor
>             Fix For: 10.4.2.0
>
>
> A query involving "< ALL" does not yield the right results for decimal datatype. "<
ANY" works, though.
> To reproduce the issue:
> % create table t1(col1 decimal(10,5));
> % insert into t1 values (-21483.64800);
> % insert into t1 values (74837.00000);
> % select col1 from t1 where col1 < ALL (select 0.0 from t1);
> The above yields no results whereas it should return the first row.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message