mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Avoid possible divide-by-zero in gincostestimate.
Per report from Jeff Janes.
This commit is contained in:
parent
a0e8df527e
commit
92647fc4b9
@ -6458,6 +6458,10 @@ gincostestimate(PG_FUNCTION_ARGS)
|
||||
numDataPages = Min(numDataPages, numPages - numEntryPages);
|
||||
}
|
||||
|
||||
/* In an empty index, numEntries could be zero. Avoid divide-by-zero */
|
||||
if (numEntries < 1)
|
||||
numEntries = 1;
|
||||
|
||||
/*
|
||||
* Include predicate in selectivityQuals (should match
|
||||
* genericcostestimate)
|
||||
|
Loading…
Reference in New Issue
Block a user