Hi Manu,
Thanks for the matrix.
> Most of what is left is ordering: the index scan fails with
> "inconsistent point values"
computeDistance() assumes low <= high and a query point without NaN.
So this doesn't need NaN rows. On a table with only finite values,
ORDER BY v <-> point '(1,NaN)' fails for all four GiST opclasses.
v6-0004 gives distance 0 to keys and query points with a NaN, as 0002
already does for internal keys. A box_ops leaf must be exact, and
index-only scans can't recheck, so it calls the operator instead.
With your script, GiST has 9 mismatches left on master, all point <@
polygon with a NaN vertex. GiST indexes built by unpatched master give
the same.
0001 to 0003 are v5. 0003 is Kirill's polygon and circle patch after
pgindent.
> palloc_object(), which 18 does not have
18 has it. The conflict comes from 1b105f9472b, which changed those
lines in 19.
> I have not checked whether the patch there covers NaN too.
It doesn't. The v2 there leaves NaN on the same error on purpose.
Regards,
Shihao