Skip to content

Commit 750549d

Browse files
committed
Add Assert() to check for trying to heap_close a relation when the
relcache entry's reference count is zero.
1 parent 1e091ad commit 750549d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/include/utils/rel.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: rel.h,v 1.34 2000/01/31 04:35:57 tgl Exp $
10+
* $Id: rel.h,v 1.35 2000/02/27 07:31:00 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -149,7 +149,9 @@ typedef Relation *RelationPtr;
149149
* RelationDecrementReferenceCount
150150
* Decrements relation reference count.
151151
*/
152-
#define RelationDecrementReferenceCount(relation) ((relation)->rd_refcnt -= 1)
152+
#define RelationDecrementReferenceCount(relation) \
153+
(AssertMacro((relation)->rd_refcnt > 0), \
154+
(relation)->rd_refcnt -= 1)
153155

154156
/*
155157
* RelationGetForm

0 commit comments

Comments
 (0)