diff options
Diffstat (limited to 'src/backend/nodes/equalfuncs.c')
| -rw-r--r-- | src/backend/nodes/equalfuncs.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 96eec16ebc..e0b8bdcecb 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -22,7 +22,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.333 2008/10/06 17:39:26 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.334 2008/10/21 20:42:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -764,6 +764,27 @@ _equalFlattenedSubLink(FlattenedSubLink *a, FlattenedSubLink *b) } static bool +_equalPlaceHolderVar(PlaceHolderVar *a, PlaceHolderVar *b) +{ + /* + * We intentionally do not compare phexpr. Two PlaceHolderVars with the + * same ID and levelsup should be considered equal even if the contained + * expressions have managed to mutate to different states. One way in + * which that can happen is that initplan sublinks would get replaced by + * differently-numbered Params when sublink folding is done. (The end + * result of such a situation would be some unreferenced initplans, which + * is annoying but not really a problem.) + * + * COMPARE_NODE_FIELD(phexpr); + */ + COMPARE_BITMAPSET_FIELD(phrels); + COMPARE_SCALAR_FIELD(phid); + COMPARE_SCALAR_FIELD(phlevelsup); + + return true; +} + +static bool _equalSpecialJoinInfo(SpecialJoinInfo *a, SpecialJoinInfo *b) { COMPARE_BITMAPSET_FIELD(min_lefthand); @@ -792,6 +813,18 @@ _equalAppendRelInfo(AppendRelInfo *a, AppendRelInfo *b) return true; } +static bool +_equalPlaceHolderInfo(PlaceHolderInfo *a, PlaceHolderInfo *b) +{ + COMPARE_SCALAR_FIELD(phid); + COMPARE_NODE_FIELD(ph_var); + COMPARE_BITMAPSET_FIELD(ph_eval_at); + COMPARE_BITMAPSET_FIELD(ph_needed); + COMPARE_SCALAR_FIELD(ph_width); + + return true; +} + /* * Stuff from parsenodes.h @@ -2289,12 +2322,19 @@ equal(void *a, void *b) case T_FlattenedSubLink: retval = _equalFlattenedSubLink(a, b); break; + case T_PlaceHolderVar: + retval = _equalPlaceHolderVar(a, b); + break; case T_SpecialJoinInfo: retval = _equalSpecialJoinInfo(a, b); break; case T_AppendRelInfo: retval = _equalAppendRelInfo(a, b); break; + case T_PlaceHolderInfo: + retval = _equalPlaceHolderInfo(a, b); + break; + case T_List: case T_IntList: case T_OidList: |
