Commit 9f4563f7 authored by Tom Lane's avatar Tom Lane

Use IEEE infinity, not 1e10, for null-and-not-null case in gistpenalty().

Use of a randomly chosen large value was never exactly graceful, and
now that there are penalty functions that are intentionally using infinity,
it doesn't seem like a good idea for null-vs-not-null to be using something
less.
parent c66e4f13
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "access/reloptions.h" #include "access/reloptions.h"
#include "storage/indexfsm.h" #include "storage/indexfsm.h"
#include "storage/lmgr.h" #include "storage/lmgr.h"
#include "utils/builtins.h"
/* /*
* static *S used for temrorary storage (saves stack and palloc() call) * static *S used for temrorary storage (saves stack and palloc() call)
...@@ -538,8 +539,10 @@ gistpenalty(GISTSTATE *giststate, int attno, ...@@ -538,8 +539,10 @@ gistpenalty(GISTSTATE *giststate, int attno,
else if (isNullOrig && isNullAdd) else if (isNullOrig && isNullAdd)
penalty = 0.0; penalty = 0.0;
else else
penalty = 1e10; /* try to prevent mixing null and non-null {
* values */ /* try to prevent mixing null and non-null values */
penalty = get_float4_infinity();
}
return penalty; return penalty;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment