提交 bf347c60 编写于 作者: R Robert Haas

Fix crash in CREATE UNLOGGED TABLE.

The code that created the init fork neglected to make sure that the
relation was open at the smgr level before attempting to invoke smgr.
This didn't happen every time; only when the relcache entry was rebuilt
along the way.

Per report from Garick Hamlin.
上级 c573486c
...@@ -1295,6 +1295,7 @@ heap_create_with_catalog(const char *relname, ...@@ -1295,6 +1295,7 @@ heap_create_with_catalog(const char *relname,
{ {
Assert(relkind == RELKIND_RELATION || relkind == RELKIND_TOASTVALUE); Assert(relkind == RELKIND_RELATION || relkind == RELKIND_TOASTVALUE);
RelationOpenSmgr(new_rel_desc);
smgrcreate(new_rel_desc->rd_smgr, INIT_FORKNUM, false); smgrcreate(new_rel_desc->rd_smgr, INIT_FORKNUM, false);
if (XLogIsNeeded()) if (XLogIsNeeded())
log_smgrcreate(&new_rel_desc->rd_smgr->smgr_rnode.node, log_smgrcreate(&new_rel_desc->rd_smgr->smgr_rnode.node,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册