Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash join cannot match records using some TIME ZONE / DECFLOAT keys [CORE6534] #6761

Closed
firebird-automations opened this issue Apr 6, 2021 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dyemanov

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 CORE3547):

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!

Commits: b6ef39d

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0.0 [ 10931 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment