diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
commit | ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2 (patch) | |
tree | 18ec8963fbd1d6dd62ad214bfe3552fc2e7d06eb /src/backend/executor/execJunk.c | |
parent | 0f3748a28c42d09d794ff00af3f1f992eaa5fd7c (diff) | |
download | postgresql-ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2.tar.gz postgresql-ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2.zip |
Merge Resdom nodes into TargetEntry nodes to simplify code and save a
few palloc's. I also chose to eliminate the restype and restypmod fields
entirely, since they are redundant with information stored in the node's
contained expression; re-examining the expression at need seems simpler
and more reliable than trying to keep restype/restypmod up to date.
initdb forced due to change in contents of stored rules.
Diffstat (limited to 'src/backend/executor/execJunk.c')
-rw-r--r-- | src/backend/executor/execJunk.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/backend/executor/execJunk.c b/src/backend/executor/execJunk.c index 2dfd90b51fa..1cf403f88dd 100644 --- a/src/backend/executor/execJunk.c +++ b/src/backend/executor/execJunk.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.48 2005/03/16 21:38:06 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.49 2005/04/06 16:34:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -31,8 +31,8 @@ * of some system attributes like "ctid" or rule locks. * * The general idea is the following: A target list consists of a list of - * Resdom nodes & expression pairs. Each Resdom node has an attribute - * called 'resjunk'. If the value of this attribute is true then the + * TargetEntry nodes containing expressions. Each TargetEntry has a field + * called 'resjunk'. If the value of this field is true then the * corresponding attribute is a "junk" attribute. * * When we initialize a plan we call 'ExecInitJunkFilter' to create @@ -101,11 +101,10 @@ ExecInitJunkFilter(List *targetList, bool hasoid, TupleTableSlot *slot) foreach(t, targetList) { TargetEntry *tle = lfirst(t); - Resdom *resdom = tle->resdom; - if (!resdom->resjunk) + if (!tle->resjunk) { - cleanMap[cleanResno - 1] = resdom->resno; + cleanMap[cleanResno - 1] = tle->resno; cleanResno++; } } @@ -177,12 +176,11 @@ ExecInitJunkFilterConversion(List *targetList, for (;;) { TargetEntry *tle = lfirst(t); - Resdom *resdom = tle->resdom; t = lnext(t); - if (!resdom->resjunk) + if (!tle->resjunk) { - cleanMap[i] = resdom->resno; + cleanMap[i] = tle->resno; break; } } @@ -228,13 +226,12 @@ ExecGetJunkAttribute(JunkFilter *junkfilter, foreach(t, junkfilter->jf_targetList) { TargetEntry *tle = lfirst(t); - Resdom *resdom = tle->resdom; - if (resdom->resjunk && resdom->resname && - (strcmp(resdom->resname, attrName) == 0)) + if (tle->resjunk && tle->resname && + (strcmp(tle->resname, attrName) == 0)) { /* We found it ! */ - *value = slot_getattr(slot, resdom->resno, isNull); + *value = slot_getattr(slot, tle->resno, isNull); return true; } } |