Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f4563f

Browse files
committed
Use IEEE infinity, not 1e10, for null-and-not-null case in gistpenalty().
Use of a randomly chosen large value was never exactly graceful, andnow 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 somethingless.
1 parentc66e4f1 commit9f4563f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/access/gist/gistutil.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include"access/reloptions.h"
2020
#include"storage/indexfsm.h"
2121
#include"storage/lmgr.h"
22+
#include"utils/builtins.h"
2223

2324
/*
2425
* static *S used for temrorary storage (saves stack and palloc() call)
@@ -538,8 +539,10 @@ gistpenalty(GISTSTATE *giststate, int attno,
538539
elseif (isNullOrig&&isNullAdd)
539540
penalty=0.0;
540541
else
541-
penalty=1e10;/* try to prevent mixing null and non-null
542-
* values */
542+
{
543+
/* try to prevent mixing null and non-null values */
544+
penalty=get_float4_infinity();
545+
}
543546

544547
returnpenalty;
545548
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp