Alexander Korotkov <aekorot...@gmail.com> writes: > PostGIS spotted that picksplit algorithm freezes in infinite loop when > dealing with nan values. I discovered same bug is present in core > opclasses. Attached patch fixes this issue interpreting nan as value > greater than infinity like btree comparison function does.
Hm. Good point, but it seems like some of these hunks are only taking care of a subset of the possible combinations of input NaNs. If you're certain the other combinations are impossible, there should be code comments explaining why. BTW, as a stylistic matter, I think it sucks to write !float8_cmp_internal(x,y) when what you mean is float8_cmp_internal(x,y) == 0 The "!" syntax should pretty much only be used for boolean tests IMO. I do recognize that there's a tradition of writing "!ptr" rather than "ptr == NULL", which I think is all right in most contexts, mainly because returning a null pointer has an element of boolean yes-or-no-ness to it. When you're doing arithmetic comparisons, though, it's just confusing. I wrote another rant about this years ago in the context of complaining about "!strcmp" tests; there was probably more detail in that, if you care to look in the archives. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers