Description
It seems like EXISTS on a SELECT returning zero rows returns false (as
expected), but EXISTS on INTERSECT of two disjunct sets returns true,
e.g EXISTS (values 1 intersect values 2).
Yip Ng wrote on derby-dev:
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.
Attachments
Attachments
Issue Links
- is duplicated by
-
DERBY-3951 Derby SQL Result Using 'Not Exists' & 'Except' Together Seem Incorrect
- Closed
- is part of
-
DERBY-2034 Tracking of bugs that lead to incorrect results being stored or returned to the client
- Closed