Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2e8e15

Browse files
committed
localbuf.c must be able to do blind writes.
1 parent993b145 commita2e8e15

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

‎src/backend/storage/buffer/localbuf.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.46 2002/09/04 20:31:25 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.47 2002/12/05 22:48:03 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -90,19 +90,24 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
9090
{
9191
Relationbufrel=RelationNodeCacheGetRelation(bufHdr->tag.rnode);
9292

93-
/*
94-
* The relcache is not supposed to throw away temp rels, so this
95-
* should always succeed.
96-
*/
97-
Assert(bufrel!=NULL);
98-
9993
/* flush this page */
100-
smgrwrite(DEFAULT_SMGR,bufrel,bufHdr->tag.blockNum,
101-
(char*)MAKE_PTR(bufHdr->data));
102-
LocalBufferFlushCount++;
94+
if (bufrel== (Relation)NULL)
95+
{
96+
smgrblindwrt(DEFAULT_SMGR,
97+
bufHdr->tag.rnode,
98+
bufHdr->tag.blockNum,
99+
(char*)MAKE_PTR(bufHdr->data));
100+
}
101+
else
102+
{
103+
smgrwrite(DEFAULT_SMGR,bufrel,
104+
bufHdr->tag.blockNum,
105+
(char*)MAKE_PTR(bufHdr->data));
106+
/* drop refcount incremented by RelationNodeCacheGetRelation */
107+
RelationDecrementReferenceCount(bufrel);
108+
}
103109

104-
/* drop refcount incremented by RelationNodeCacheGetRelation */
105-
RelationDecrementReferenceCount(bufrel);
110+
LocalBufferFlushCount++;
106111
}
107112

108113
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp