mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +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);
|
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
|
* Include predicate in selectivityQuals (should match
|
||||||
* genericcostestimate)
|
* genericcostestimate)
|
||||||
|
Loading…
Reference in New Issue
Block a user