Fix oversight in backpatch of 6cae9d2c10
authorAlexander Korotkov
Thu, 19 Sep 2019 20:36:01 +0000 (23:36 +0300)
committerAlexander Korotkov
Thu, 19 Sep 2019 20:36:01 +0000 (23:36 +0300)
During backpatch of 6cae9d2c10 Float8GetDatum() was accidentally removed.  This
commit turns it back.

Reported-by: Erik Rijkers
Discussion: https://postgr.es/m/6d51305e1159241cabee132f7efc7eff%40xs4all.nl
Author: Tom Lane
Backpatch-through: from 11 to 9.5

src/backend/access/gist/gistget.c

index 0760269c06a1e70da2f6c0b568aa5d13f8202592..ae38d711f63ce8f61b3d2bc73be1137be5662048 100644 (file)
@@ -580,7 +580,7 @@ getNextNearest(IndexScanDesc scan)
                    if (!scan->xs_orderbynulls[i])
                        pfree(DatumGetPointer(scan->xs_orderbyvals[i]));
 #endif
-                   scan->xs_orderbyvals[i] = item->distances[i].value;
+                   scan->xs_orderbyvals[i] = Float8GetDatum(item->distances[i].value);
                    scan->xs_orderbynulls[i] = item->distances[i].isnull;
                }
                else if (so->orderByTypes[i] == FLOAT4OID)