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

geo: fix nan handling in bounding box comparison #105789

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

rharding6373
Copy link
Collaborator

@rharding6373 rharding6373 commented Jun 28, 2023

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.

@rharding6373 rharding6373 requested a review from a team June 28, 2023 23:58
@rharding6373 rharding6373 requested a review from a team as a code owner June 28, 2023 23:58
@rharding6373 rharding6373 requested a review from cucaroach June 28, 2023 23:58
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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.
@rharding6373 rharding6373 force-pushed the 20230628_st_expand_93541 branch from 173b402 to 5292ef7 Compare June 29, 2023 03:28
@rharding6373 rharding6373 added backport-22.2.x backport-23.1.x Flags PRs that need to be backported to 23.1 labels Jun 29, 2023
@rharding6373
Copy link
Collaborator Author

TFTR! Added backport labels.

bors r=otan

@craig
Copy link
Contributor

craig bot commented Jun 29, 2023

Build succeeded:

@blathers-crl
Copy link

blathers-crl bot commented Jun 29, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

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.

@mgartner
Copy link
Collaborator

Nice find! Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: inconsistent ASC/DESC ordering of BOX2D roachtest: sql: st_expand with equal returns incorrect result?
4 participants