aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeMaterial.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-09-24 00:25:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-09-24 00:25:33 +0000
commite812458b273be00bde34fb74991ab4a99c24ab30 (patch)
treee7460ae5c0344782f6f6068399f6f7eab5be96f6 /src/backend/executor/nodeMaterial.c
parentad791c1d140af97d93ee98883e2c45413d6f9836 (diff)
downloadpostgresql-e812458b273be00bde34fb74991ab4a99c24ab30.tar.gz
postgresql-e812458b273be00bde34fb74991ab4a99c24ab30.zip
Several changes here, not very related but touching some of the same files.
* Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
Diffstat (limited to 'src/backend/executor/nodeMaterial.c')
-rw-r--r--src/backend/executor/nodeMaterial.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/backend/executor/nodeMaterial.c b/src/backend/executor/nodeMaterial.c
index 783dbc7b328..24232617cf6 100644
--- a/src/backend/executor/nodeMaterial.c
+++ b/src/backend/executor/nodeMaterial.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.25 1999/07/16 04:58:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.26 1999/09/24 00:24:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,7 +31,7 @@
* ExecMaterial
*
* The first time this is called, ExecMaterial retrieves tuples
- * this node's outer subplan and inserts them into a temporary
+ * from this node's outer subplan and inserts them into a temporary
* relation. After this is done, a flag is set indicating that
* the subplan has been materialized. Once the relation is
* materialized, the first tuple is then returned. Successive
@@ -41,7 +41,7 @@
* Initial State:
*
* ExecMaterial assumes the temporary relation has been
- * created and openend by ExecInitMaterial during the prior
+ * created and opened by ExecInitMaterial during the prior
* InitPlan() phase.
*
* ----------------------------------------------------------------
@@ -116,18 +116,7 @@ ExecMaterial(Material *node)
if (TupIsNull(slot))
break;
- /*
- * heap_insert changes something...
- */
- if (slot->ttc_buffer != InvalidBuffer)
- heapTuple = heap_copytuple(slot->val);
- else
- heapTuple = slot->val;
-
- heap_insert(tempRelation, heapTuple);
-
- if (slot->ttc_buffer != InvalidBuffer)
- pfree(heapTuple);
+ heap_insert(tempRelation, slot->val);
ExecClearTuple(slot);
}
@@ -164,7 +153,7 @@ ExecMaterial(Material *node)
/* ----------------
* at this point we know we have a sorted relation so
- * we preform a simple scan on it with amgetnext()..
+ * we perform a simple scan on it with amgetnext()..
* ----------------
*/
currentScanDesc = matstate->csstate.css_currentScanDesc;