From e6af7b367cf46fc385307efcef5a1fece0e5fef3 Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Sun, 8 Sep 2019 21:13:40 +0300 Subject: Fix handling of NULL distances in KNN-GiST In order to implement NULL LAST semantic GiST previously assumed distance to the NULL value to be Inf. However, our distance functions can return Inf and NaN for non-null values. In such cases, NULL LAST semantic appears to be broken. This commit fixes that by introducing separate array of null flags for distances. Backpatch to all supported versions. Discussion: https://postgr.es/m/CAPpHfdsNvNdA0DBS%2BwMpFrgwT6C3-q50sFVGLSiuWnV3FqOJuQ%40mail.gmail.com Author: Alexander Korotkov Backpatch-through: 9.4 --- src/test/regress/expected/create_index.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/regress/expected/create_index.out b/src/test/regress/expected/create_index.out index c53c802bf86..e71920dc0ea 100644 --- a/src/test/regress/expected/create_index.out +++ b/src/test/regress/expected/create_index.out @@ -531,8 +531,8 @@ SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; (-5,-12) (5.1,34.5) (1e+300,Infinity) - (NaN,NaN) + (10 rows) EXPLAIN (COSTS OFF) -- cgit v1.2.3