aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execAmi.c6
-rw-r--r--src/backend/executor/nodeHash.c29
-rw-r--r--src/backend/executor/nodeTee.c59
-rw-r--r--src/backend/executor/spi.c52
4 files changed, 17 insertions, 129 deletions
diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index e8c9bec3123..6711fa5f70d 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.25 1998/09/01 04:28:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.26 1998/12/14 05:18:49 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -518,10 +518,6 @@ ExecCreatR(TupleDesc tupType,
* from the range table.. -cim 10/12/89)
* ----------------
*/
-/*
- sprintf(tempname, "temp_%d.%d", getpid(), tmpcnt++);
- EU1_printf("ExecCreatR: attempting to create %s\n", tempname);
-*/
/*
* heap_create creates a name if the argument to heap_create is
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 63a9a83bcac..e03a33b62b2 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.24 1998/11/27 19:52:02 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.25 1998/12/14 05:18:50 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -341,7 +341,8 @@ ExecHashTableCreate(Hash *node)
if (nbatch == 0)
nbuckets = totalbuckets;
#ifdef HJDEBUG
- printf("nbatch = %d, totalbuckets = %d, nbuckets = %d\n", nbatch, totalbuckets, nbuckets);
+ printf("nbatch = %d, totalbuckets = %d, nbuckets = %d\n",
+ nbatch, totalbuckets, nbuckets);
#endif
/* ----------------
@@ -617,32 +618,14 @@ ExecHashOverflowInsert(HashJoinTable hashtable,
+ heapTuple->t_len + HEAPTUPLESIZE);
if (newend > hashtable->bottom)
{
-#if 0
- elog(DEBUG, "hash table out of memory. expanding.");
- /* ------------------
- * XXX this is a temporary hack
- * eventually, recursive hash partitioning will be
- * implemented
- * ------------------
- */
- hashtable->readbuf = hashtable->bottom = 2 * hashtable->bottom;
- hashtable =
- (HashJoinTable) repalloc(hashtable, hashtable->bottom + BLCKSZ);
- if (hashtable == NULL)
- {
- perror("repalloc");
- elog(ERROR, "can't expand hashtable.");
- }
-#else
/* ------------------
* XXX the temporary hack above doesn't work because things
* above us don't know that we've moved the hash table!
* - Chris Dunlop, <chris@onthe.net.au>
* ------------------
*/
- elog(ERROR, "hash table out of memory. Use -B parameter to increase buffers.");
-#endif
-
+ elog(ERROR,
+ "hash table out of memory. Use -B parameter to increase buffers.");
}
/* ----------------
@@ -897,7 +880,7 @@ static int hjtmpcnt = 0;
static void
mk_hj_temp(char *tempname)
{
- sprintf(tempname, "HJ%d.%d", (int) MyProcPid, hjtmpcnt);
+ snprintf(tempname, strlen(tempname), "HJ%d.%d", (int) MyProcPid, hjtmpcnt);
hjtmpcnt = (hjtmpcnt + 1) % 1000;
}
diff --git a/src/backend/executor/nodeTee.c b/src/backend/executor/nodeTee.c
index 7b0f7f1755e..741a4f077f1 100644
--- a/src/backend/executor/nodeTee.c
+++ b/src/backend/executor/nodeTee.c
@@ -15,7 +15,7 @@
* ExecEndTee
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.25 1998/11/27 19:52:03 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.26 1998/12/14 05:18:51 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,12 +47,12 @@
bool
ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
{
- TeeState *teeState;
- Plan *outerPlan;
- int len;
+ TeeState *teeState;
+ Plan *outerPlan;
+ int len;
Relation bufferRel;
TupleDesc tupType;
- EState *estate;
+ EState *estate;
/*
* it is possible that the Tee has already been initialized since it
@@ -144,8 +144,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
tupType = ExecGetResultType(&(teeState->cstate));
len = ExecTargetListLength(((Plan *) node)->targetlist);
-/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID_); */
-
/*
* create a catalogued relation even though this is a temporary
* relation
@@ -176,7 +174,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
sprintf(teeState->tee_bufferRelname,
"ttemp_%d", /* 'ttemp' for 'tee' temporary */
newoid());
-/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
bufferRel = heap_open(
heap_create_with_catalog(teeState->tee_bufferRelname,
tupType, RELKIND_RELATION));
@@ -429,52 +426,6 @@ ExecTee(Tee *node, Plan *parent)
return result;
}
-#ifdef NOT_USED
-/* ----------------------------------------------------------------
- * ExecTeeReScan(node)
- *
- * Rescans the relation.
- * ----------------------------------------------------------------
- */
-void
-ExecTeeReScan(Tee *node, ExprContext *exprCtxt, Plan *parent)
-{
-
- EState *estate;
- TeeState *teeState;
- ScanDirection dir;
-
- estate = ((Plan *) node)->state;
- teeState = node->teestate;
-
- dir = estate->es_direction;
-
- /* XXX doesn't handle backwards direction yet */
-
- if (parent == node->leftParent)
- {
- if (teeState->tee_leftScanDesc)
- {
- heap_rescan(teeState->tee_leftScanDesc,
- ScanDirectionIsBackward(dir),
- NULL);
- teeState->tee_leftPlace = 0;
- }
- }
- else
- {
- if (teeState->tee_rightScanDesc)
- {
- heap_rescan(teeState->tee_leftScanDesc,
- ScanDirectionIsBackward(dir),
- NULL);
- teeState->tee_rightPlace = 0;
- }
- }
-}
-#endif
-
-
/* ---------------------------------------------------------------------
* ExecEndTee
*
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 0d3022dce70..125a36241ad 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -3,6 +3,8 @@
* spi.c--
* Server Programming Interface
*
+ * $Id: spi.c,v 1.29 1998/12/14 05:18:51 scrappy Exp $
+ *
*-------------------------------------------------------------------------
*/
#include "executor/spi.h"
@@ -43,10 +45,6 @@ typedef struct
static int _SPI_execute(char *src, int tcount, _SPI_plan *plan);
static int _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount);
-#if 0
-static void _SPI_fetch(FetchStmt *stmt);
-
-#endif
static int _SPI_execute_plan(_SPI_plan *plan,
Datum *Values, char *Nulls, int tcount);
@@ -74,8 +72,8 @@ extern void ShowUsage(void);
int
SPI_connect()
{
- char pname[64];
- PortalVariableMemory pvmem;
+ char pname[64];
+ PortalVariableMemory pvmem;
/*
* It's possible on startup and after commit/abort. In future we'll
@@ -128,7 +126,7 @@ SPI_connect()
_SPI_current->tuptable = NULL;
/* Create Portal for this procedure ... */
- sprintf(pname, "<SPI %d>", _SPI_connected);
+ snprintf(pname, 64, "<SPI %d>", _SPI_connected);
_SPI_current->portal = CreatePortal(pname);
if (!PortalIsValid(_SPI_current->portal))
elog(FATAL, "SPI_connect: initialization failed");
@@ -876,46 +874,6 @@ _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount)
}
-#if 0
-static void
-_SPI_fetch(FetchStmt *stmt)
-{
- char *name = stmt->portalname;
- int feature = (stmt->direction == FORWARD) ? EXEC_FOR : EXEC_BACK;
- int count = stmt->howMany;
- Portal portal;
- QueryDesc *queryDesc;
- EState *state;
- MemoryContext context;
-
- if (name == NULL)
- elog(FATAL, "SPI_fetch from blank portal unsupported");
-
- portal = GetPortalByName(name);
- if (!PortalIsValid(portal))
- elog(FATAL, "SPI_fetch: portal \"%s\" not found", name);
-
- context = MemoryContextSwitchTo((MemoryContext) PortalGetHeapMemory(portal));
-
- queryDesc = PortalGetQueryDesc(portal);
- state = PortalGetState(portal);
-
- ExecutorRun(queryDesc, state, feature, count);
-
- MemoryContextSwitchTo(context); /* switch to the normal Executor
- * context */
-
- _SPI_current->processed = state->es_processed;
- if (_SPI_checktuples())
- elog(FATAL, "SPI_fetch: # of processed tuples check failed");
-
- SPI_processed = _SPI_current->processed;
- SPI_tuptable = _SPI_current->tuptable;
-
-}
-
-#endif
-
static MemoryContext
_SPI_execmem()
{