diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-12 02:37:39 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-12 02:37:39 +0000 |
| commit | badce86a2c327b40c6146242526d1523455d64a6 (patch) | |
| tree | 6e0cb658889a2688e76d9ac19a56555c5eb0e738 /src/backend/nodes | |
| parent | 46fb9c29e2990ba470bb741ff6dd60f2ae218e64 (diff) | |
| download | postgresql-badce86a2c327b40c6146242526d1523455d64a6.tar.gz | |
First stage of reclaiming memory in executor by resetting short-term
memory contexts. Currently, only leaks in expressions executed as
quals or projections are handled. Clean up some old dead cruft in
executor while at it --- unused fields in state nodes, that sort of thing.
Diffstat (limited to 'src/backend/nodes')
| -rw-r--r-- | src/backend/nodes/copyfuncs.c | 4 | ||||
| -rw-r--r-- | src/backend/nodes/equalfuncs.c | 6 | ||||
| -rw-r--r-- | src/backend/nodes/outfuncs.c | 21 | ||||
| -rw-r--r-- | src/backend/nodes/readfuncs.c | 4 |
4 files changed, 14 insertions, 21 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 605fe70e6c..bc305382df 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -19,7 +19,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.115 2000/06/29 07:35:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.116 2000/07/12 02:37:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -578,7 +578,7 @@ _copySubPlan(SubPlan *from) Node_Copy(from, newnode, sublink); /* do not copy execution state */ - newnode->shutdown = false; + newnode->needShutdown = false; newnode->curTuple = NULL; return newnode; diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 308f4d90e8..b881478618 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -24,7 +24,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.67 2000/06/29 07:35:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.68 2000/07/12 02:37:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -184,8 +184,8 @@ _equalConst(Const *a, Const *b) */ if (a->constisnull) return true; - return (datumIsEqual(a->constvalue, b->constvalue, - a->consttype, a->constbyval, a->constlen)); + return datumIsEqual(a->constvalue, b->constvalue, + a->constbyval, a->constlen); } static bool diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index b9830edc22..2999c4263b 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.120 2000/06/18 22:44:05 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.121 2000/07/12 02:37:06 tgl Exp $ * * NOTES * Every (plan) node in POSTGRES has an associated "out" routine which @@ -1155,10 +1155,10 @@ _outJoinInfo(StringInfo str, JoinInfo *node) static void _outDatum(StringInfo str, Datum value, Oid type) { - char *s; - Size length, - typeLength; bool byValue; + int typeLength; + Size length; + char *s; int i; /* @@ -1167,12 +1167,12 @@ _outDatum(StringInfo str, Datum value, Oid type) */ byValue = get_typbyval(type); typeLength = get_typlen(type); - length = datumGetSize(value, type, byValue, typeLength); + length = datumGetSize(value, byValue, typeLength); if (byValue) { s = (char *) (&value); - appendStringInfo(str, " %d [ ", length); + appendStringInfo(str, " %u [ ", (unsigned int) length); for (i = 0; i < (int) sizeof(Datum); i++) appendStringInfo(str, "%d ", (int) (s[i])); appendStringInfo(str, "] "); @@ -1184,14 +1184,7 @@ _outDatum(StringInfo str, Datum value, Oid type) appendStringInfo(str, " 0 [ ] "); else { - - /* - * length is unsigned - very bad to do < comparison to -1 - * without casting it to int first!! -mer 8 Jan 1991 - */ - if (((int) length) <= -1) - length = VARSIZE(s); - appendStringInfo(str, " %d [ ", length); + appendStringInfo(str, " %u [ ", (unsigned int) length); for (i = 0; i < (int) length; i++) appendStringInfo(str, "%d ", (int) (s[i])); appendStringInfo(str, "] "); diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index f872d952d0..4754cbc327 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.91 2000/06/18 22:44:05 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.92 2000/07/12 02:37:06 tgl Exp $ * * NOTES * Most of the read functions for plan nodes are tested. (In fact, they @@ -608,7 +608,7 @@ _readHash() _getPlan((Plan *) local_node); token = lsptok(NULL, &length); /* eat :hashkey */ - local_node->hashkey = (Var *) nodeRead(true); + local_node->hashkey = nodeRead(true); return local_node; } |
