Skip to content

Commit a2e8e15

Browse files
committed
localbuf.c must be able to do blind writes.
1 parent 993b145 commit a2e8e15

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
Relation bufrel = 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy