-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
geo: fix nan handling in bounding box comparison #105789
geo: fix nan handling in bounding box comparison #105789
Conversation
Go always returns false when comparing float NaNs, but SQL expects NaNs to be less than any other float value. Before this change, the geo package's `CartesianBoundingBox` did not have special handling for NaNs, so it implemented the go behavior, which is incorrect for our use case. This change adds correct NaN comparison behavior to bounding boxes. Epic: None Fixes: cockroachdb#93541 Fixes: cockroachdb#102661 Release note (bug fix): Fixes a bug in the geospatial cartesian bounding box type that had incorrect behavior when comparing boxes with NaN values.
173b402
to
5292ef7
Compare
TFTR! Added backport labels. bors r=otan |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error setting reviewers, but backport branch blathers/backport-release-22.2-105789 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/105829/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. [] Backport to branch 22.2.x failed. See errors above. error setting reviewers, but backport branch blathers/backport-release-23.1-105789 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/105830/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. [] Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Nice find! Thanks for fixing this! |
Go always returns false when comparing float NaNs, but SQL expects NaNs to be less than any other float value. Before this change, the geo package's
CartesianBoundingBox
did not have special handling for NaNs, so it implemented the go behavior, which is incorrect for our use case.This change adds correct NaN comparison behavior to bounding boxes.
Epic: None
Fixes: #93541
Fixes: #102661
Release note (bug fix): Fixes a bug in the geospatial cartesian bounding box type that had incorrect behavior when comparing boxes with NaN values.