mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Avoid possible divide-by-zero in gincostestimate.
Per report from Jeff Janes.
This commit is contained in:
@ -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)
|
||||||
|
Reference in New Issue
Block a user