29.05.2020 22:43, Mark Rotteveel wrote:
I was just testing some claims in the Firebird Language Reference against
Firebird 3 and 4, and ran into the following oddity:
The result of `null in (non-empty list or query)` and `null = any (non-empty query)` should be `null` (see SQL:2016-2, 8.4 <in
predicate> and 8.9 <quantified comparison predicate>).
This is the case for
select (null in ('a')) from RDB$DATABASE
However, it is not the case for:
select (null in (select 'a' from RDB$DATABASE)) from RDB$DATABASE
select (null = any (select 'a' from RDB$DATABASE)) from RDB$DATABASE
These both, incorrectly, return false
Try
select not (null in (select 'a' from RDB$DATABASE)) from RDB$DATABASE
select not (null = any (select 'a' from RDB$DATABASE)) from RDB$DATABASE
and they also returns FALSE.
I didn't check details yet, but guess that expression result is NULL
but its descriptor is not marked as NULL'able, thus client shows FALSE
instead of NULL.
Regards,
Vlad
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel