Hash join cannot match records using some TIME ZONE / DECFLOAT keys
-------------------------------------------------------------------

                 Key: CORE-6534
                 URL: http://tracker.firebirdsql.org/browse/CORE-6534
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 4.0 RC 1, 4.0 Beta 2
            Reporter: Dmitry Yemanov


Test case:

select 1 from rdb$database where timestamp '01.01.2021 13:00:00 +03:00' = 
timestamp '01.01.2021 12:00:00 +02:00';
-- Values are surely equal:

    CONSTANT 
============ 
           1 

select 1 from (select timestamp '01.01.2021 13:00:00 +03:00' as ts from 
rdb$database) natural join (select timestamp '01.01.2021 12:00:00 +02:00' as ts 
from rdb$database);
-- OOPS! No record is returned!

select 1 from rdb$database where cast(10 as decfloat) = cast(10.000 as 
decfloat);
-- Values are surely equal:

    CONSTANT 
============ 
           1 

select 1 from (select cast(10 as decfloat) as df from rdb$database) natural 
join (select cast(10.000 as decfloat) as df from rdb$database);
-- OOPS! No record is returned!

select 1 from rdb$database where cast('+0' as decfloat) = cast('-0' as 
decfloat);
-- Values are surely equal:

    CONSTANT 
============ 
           1 

select 1 from (select cast('+0' as decfloat) as df from rdb$database) natural 
join (select cast('-0' as decfloat) as df from rdb$database);
-- OOPS! No record is returned!

And also another case with approximate zeros (similar to CORE-3547):

select 1 from rdb$database where cast('+0' as float) = cast('-0' as float);
-- Values are surely equal:

    CONSTANT 
============ 
           1 

select 1 from (select cast('+0' as float) as f from rdb$database) natural join 
(select cast('-0' as float) as f from rdb$database);
-- OOPS! No record is returned!

select 1 from rdb$database where cast('+0' as double precision) = cast('-0' as 
double precision);
-- Values are surely equal:

    CONSTANT 
============ 
           1 

select 1 from (select cast('+0' as double precision) as d from rdb$database) 
natural join (select cast('-0' as double precision) as d from rdb$database);
-- OOPS! No record is returned!


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to