git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c66e4f1)
Use IEEE infinity, not 1e10, for null-and-not-null case in gistpenalty().
2011年11月27日 22:12:54 +0000 (17:12 -0500)
2011年11月27日 22:12:54 +0000 (17:12 -0500)
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.


diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
index d91025dbe7ff18ae0edd4c573eb3bc5676b77796..8e57d907f86e413dced9d99998412aecb1f9de31 100644 (file)
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -19,6 +19,7 @@
#include "access/reloptions.h"
#include "storage/indexfsm.h"
#include "storage/lmgr.h"
+#include "utils/builtins.h"
/*
* static *S used for temrorary storage (saves stack and palloc() call)
@@ -538,8 +539,10 @@ gistpenalty(GISTSTATE *giststate, int attno,
else if (isNullOrig && isNullAdd)
penalty = 0.0;
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;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /