db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dyre.Tjeldv...@Sun.COM
Subject Re: Is this a bug in EXISTS?
Date Fri, 23 Feb 2007 09:20:04 GMT
Yip Ng <yipng168@gmail.com> writes:

>> On 2/22/07, Dyre.Tjeldvoll@sun.com <Dyre.Tjeldvoll@sun.com> wrote:
>>
>>
>>It looks like this could be related to the use of an AnyResultSet for
>>the predicate. When EXISTS is applied to a SELECT it seems like the
>>query is re-written as a join... (lots of guessing and hand-waving
>>here...).
>>
>
> I believe its probably got to do with the EXISTS subquery transforming
> the original RCL to
> a TRUE boolean value for the INTERSECT.  So during row comparison at
> execution time
> for INTERSECT processing since true == true(thus intersects), so it
> will always return 'BAD'.  Likewise,
>
> select * from ( values 'OK' ) as T where exists (values 1 except values 2);
>
> This supposedly should return 'OK' but because of the boolean
> transformation mentioned
> above for EXISTS subquery, it will return no rows for EXCEPT
> processing.  So a fix
> should be apply in this area.

Thanks Yip and Mamta for your help on this :) I've logged 

https://issues.apache.org/jira/browse/DERBY-2370

for this.

-- 
dt


Mime
View raw message