diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2019-09-08 21:13:40 +0300 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2019-09-08 22:08:12 +0300 |
commit | 02f90879e75b3d4ccdba1ec7c3cad6af08dff77d (patch) | |
tree | 9fc6dd6fdc3aba51027f5e02db15a0a271471882 /src/include/access/genam.h | |
parent | e5d8f3596100da0d38a38513c69e803b7fe7041a (diff) |
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
Diffstat (limited to 'src/include/access/genam.h')
-rw-r--r-- | src/include/access/genam.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/access/genam.h b/src/include/access/genam.h index 8c053be2caf..6c56717ba77 100644 --- a/src/include/access/genam.h +++ b/src/include/access/genam.h @@ -178,7 +178,9 @@ extern RegProcedure index_getprocid(Relation irel, AttrNumber attnum, extern FmgrInfo *index_getprocinfo(Relation irel, AttrNumber attnum, uint16 procnum); extern void index_store_float8_orderby_distances(IndexScanDesc scan, - Oid *orderByTypes, double *distances, + Oid *orderByTypes, + double *distanceValues, + bool *distanceNulls, bool recheckOrderBy); /* |