-
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
roachtest: sql: st_expand with equal returns incorrect result? #93541
Comments
roachtest.unoptimized-query-oracle/disable-rules=all/rand-tables failed with artifacts on master @ 94e03c016955dfd64d4e15358ea92226a8f362aa:
Parameters: |
I can't reproduce the first failure. |
Reduced reproduction of the second failure: CREATE TABLE t (d INT PRIMARY KEY, f FLOAT4);
INSERT INTO t VALUES (1, 1.0), (2, 'NaN');
SET testing_optimizer_disable_rule_probability = 1.000000;
SELECT count(*) FROM t
WHERE 'BOX(-10 -10,10 10)'::BOX2D IN (
SELECT st_expand('BOX(1 -1, 1 -1)'::BOX2D, t2.f) FROM t t2
);
RESET testing_optimizer_disable_rule_probability;
SELECT count(*) FROM t
WHERE 'BOX(-10 -10,10 10)'::BOX2D IN (
SELECT st_expand('BOX(1 -1, 1 -1)'::BOX2D, t2.f) FROM t t2
); The first The query plan of the first (good result) is:
And the query plan of the second (bad result) is:
The query plans look fine to me at a glance. Maybe there is a bug in how we evaluate |
I've confirmed the bug is present all the back in v20.2 when geo-spatial types were added. Removing the release-blocker label. |
I've reduced the difference down to:
On postgres:
This appears to be a comparison issue involving |
105789: geo: fix nan handling in bounding box comparison r=otan a=rharding6373 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. Co-authored-by: rharding6373 <[email protected]>
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.
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.
roachtest.unoptimized-query-oracle/disable-rules=all/rand-tables failed with artifacts on master @ a80652b2e4691ea76ea49e797b1b9e0998e1d61f:
Parameters:
ROACHTEST_cloud=gce
,ROACHTEST_cpu=4
,ROACHTEST_encrypted=false
,ROACHTEST_fs=ext4
,ROACHTEST_localSSD=true
,ROACHTEST_ssd=0
Help
See: roachtest README
See: How To Investigate (internal)
This test on roachdash | Improve this report!
Jira issue: CRDB-22388
The text was updated successfully, but these errors were encountered: