提交 64cbb6b2 编写于 作者: H Heikki Linnakangas

Don't access relcache entry after closing it.

This is essentially a use-after-free bug. Found by running regression
tests with CLOBBER_CACHE_ALWAYS and RELCACHE_FORCE_RELEASE.
上级 d291b456
......@@ -579,13 +579,15 @@ nextval_internal(Oid relid)
if (is_overflow)
{
char *relname = pstrdup(RelationGetRelationName(seqrel));
relation_close(seqrel, NoLock);
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("nextval: reached %s value of sequence \"%s\" (" INT64_FORMAT ")",
elm->increment>0 ? "maximum":"minimum",
RelationGetRelationName(seqrel), elm->last)));
relname, elm->last)));
}
else
elm->last_valid = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册