summaryrefslogtreecommitdiff
path: root/src/backend/catalog/heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/catalog/heap.c')
-rw-r--r--src/backend/catalog/heap.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 6e9634aa95a..1fbe99331bf 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.1.1.1 1996/07/09 06:21:15 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.1.1.1.2.1 1996/10/24 07:37:31 scrappy Exp $
*
* INTERFACE ROUTINES
* heap_creatr() - Create an uncataloged heap relation
@@ -316,6 +316,13 @@ heap_creatr(char *name,
}
/* ----------------
+ * remember if this is a temp relation
+ * ----------------
+ */
+
+ rdesc->rd_istemp = isTemp;
+
+ /* ----------------
* have the storage manager create the relation.
* ----------------
*/
@@ -1306,6 +1313,9 @@ heap_destroy(char *relname)
* ----------------
*/
(void) smgrunlink(rdesc->rd_rel->relsmgr, rdesc);
+ if(rdesc->rd_istemp) {
+ rdesc->rd_tmpunlinked = TRUE;
+ }
heap_close(rdesc);
}
@@ -1320,6 +1330,9 @@ heap_destroyr(Relation rdesc)
{
ReleaseTmpRelBuffers(rdesc);
(void) smgrunlink(rdesc->rd_rel->relsmgr, rdesc);
+ if(rdesc->rd_istemp) {
+ rdesc->rd_tmpunlinked = TRUE;
+ }
heap_close(rdesc);
RemoveFromTempRelList(rdesc);
}
@@ -1357,7 +1370,7 @@ InitTempRelList()
tempRels = (TempRelList*)malloc(sizeof(TempRelList));
tempRels->size = TEMP_REL_LIST_SIZE;
tempRels->rels = (Relation*)malloc(sizeof(Relation) * tempRels->size);
- memset(tempRels->rels, sizeof(Relation) * tempRels->size , 0);
+ memset(tempRels->rels, 0, sizeof(Relation) * tempRels->size);
tempRels->num = 0;
}
@@ -1418,7 +1431,7 @@ DestroyTempRels()
for (i=0;i<tempRels->num;i++) {
rdesc = tempRels->rels[i];
/* rdesc may be NULL if it has been removed from the list already */
- if (rdesc)
+ if (rdesc)
heap_destroyr(rdesc);
}
free(tempRels->rels);