|
9 | 9 | *
|
10 | 10 | *
|
11 | 11 | * 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 $ |
13 | 13 | *
|
14 | 14 | *-------------------------------------------------------------------------
|
15 | 15 | */
|
@@ -90,19 +90,24 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
|
90 | 90 | {
|
91 | 91 | Relationbufrel=RelationNodeCacheGetRelation(bufHdr->tag.rnode);
|
92 | 92 |
|
93 |
| -/* |
94 |
| - * The relcache is not supposed to throw away temp rels, so this |
95 |
| - * should always succeed. |
96 |
| - */ |
97 |
| -Assert(bufrel!=NULL); |
98 |
| - |
99 | 93 | /* 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 | +} |
103 | 109 |
|
104 |
| -/* drop refcount incremented by RelationNodeCacheGetRelation */ |
105 |
| -RelationDecrementReferenceCount(bufrel); |
| 110 | +LocalBufferFlushCount++; |
106 | 111 | }
|
107 | 112 |
|
108 | 113 | /*
|
|