提交 92647fc4 编写于 作者: T Tom Lane

Avoid possible divide-by-zero in gincostestimate.

Per report from Jeff Janes.
上级 a0e8df52
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册