]> granicus.if.org Git - postgresql/commit
Fix lossy KNN GiST when ordering operator returns non-float8 value.
authorTeodor Sigaev <teodor@sigaev.ru>
Tue, 2 Feb 2016 12:21:03 +0000 (15:21 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Tue, 2 Feb 2016 12:21:03 +0000 (15:21 +0300)
commit62e0ade9aa89c8f88ce506e1cb4be6e3697ee2d0
tree665fc0ef0bbc90e74dd600c855af9febae4bdf29
parent829757c8a225e5b81a398823d77fa6c0809cf863
Fix lossy KNN GiST when ordering operator returns non-float8 value.

KNN GiST with recheck flag should return to executor the same type as ordering
operator, GiST detects this type by looking to return type of function which
implements ordering operator. But occasionally detecting code works after
replacing ordering operator function to distance support function.
Distance support function always returns float8, so, detecting code get float8
instead of actual return type of ordering operator.

Built-in opclasses don't have ordering operator which doesn't return
non-float8 value, so, tests are impossible here, at least now.

Backpatch to 9.5 where lozzy KNN was introduced.

Author: Alexander Korotkov
Report by: Artur Zakirov
src/backend/access/gist/gistscan.c