summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2019-09-08 21:07:30 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2019-09-08 21:17:31 +0300
commitbc67f4189a7a3381db76dbfeafca463187bfe87a (patch)
tree8e023cb835f36a9fd3eae8e4e8f2c2ba6167a120 /src/test
parentb6d72ddd5fbf3f6eb79597ab0c8ec3aaa7c16805 (diff)
Fix handling Inf and Nan values in GiST pairing heap comparator
Previously plain float comparison was used in GiST pairing heap. Such comparison doesn't provide proper ordering for value sets containing Inf and Nan values. This commit fixes that by usage of float8_cmp_internal(). Note, there is remaining problem with NULL distances, which are represented as Inf in pairing heap. It would be fixes in subsequent commit. Backpatch to all supported versions. Reported-by: Andrey Borodin Discussion: https://postgr.es/m/CAPpHfdsNvNdA0DBS%2BwMpFrgwT6C3-q50sFVGLSiuWnV3FqOJuQ%40mail.gmail.com Author: Alexander Korotkov Reviewed-by: Heikki Linnakangas Backpatch-through: 9.4
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/create_index.out10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/regress/expected/create_index.out b/src/test/regress/expected/create_index.out
index c8700f5c9c6..c53c802bf86 100644
--- a/src/test/regress/expected/create_index.out
+++ b/src/test/regress/expected/create_index.out
@@ -523,16 +523,16 @@ SELECT * FROM point_tbl ORDER BY f1 <-> '0,1';
SELECT * FROM point_tbl ORDER BY f1 <-> '0,1';
f1
-------------------
- (10,10)
- (NaN,NaN)
(0,0)
(1e-300,-1e-300)
(-3,4)
(-10,0)
+ (10,10)
(-5,-12)
(5.1,34.5)
-
(1e+300,Infinity)
+
+ (NaN,NaN)
(10 rows)
EXPLAIN (COSTS OFF)
@@ -561,15 +561,15 @@ SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1';
SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1';
f1
-------------------
- (10,10)
- (NaN,NaN)
(0,0)
(1e-300,-1e-300)
(-3,4)
(-10,0)
+ (10,10)
(-5,-12)
(5.1,34.5)
(1e+300,Infinity)
+ (NaN,NaN)
(9 rows)
EXPLAIN (COSTS OFF)