diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-26 17:54:02 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-26 17:54:02 +0000 |
| commit | 5cabcfccce4b8b826c9b30828f3012b7926a6946 (patch) | |
| tree | 3e14c0710a45b4195734dd3189eb89eac4969073 /src/backend/nodes/equalfuncs.c | |
| parent | 8009c275925dda90f1275ba70f5c2a63abaa520b (diff) | |
| download | postgresql-5cabcfccce4b8b826c9b30828f3012b7926a6946.tar.gz | |
Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements
the same way normal tuple access operations do --- viz, using the
tupmacs.h macros att_addlength and att_align. This makes the world
safe for arrays of cstrings or intervals, and should make it much
easier to write array-type-polymorphic functions; as examples see
the cleanups of array_out and contrib/array_iterator. By Joe Conway
and Tom Lane.
Diffstat (limited to 'src/backend/nodes/equalfuncs.c')
| -rw-r--r-- | src/backend/nodes/equalfuncs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 9990a04622..c96389f1e8 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -20,7 +20,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.153 2002/08/19 15:08:46 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.154 2002/08/26 17:53:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -258,7 +258,7 @@ _equalSubLink(SubLink *a, SubLink *b) static bool _equalArrayRef(ArrayRef *a, ArrayRef *b) { - if (a->refelemtype != b->refelemtype) + if (a->refrestype != b->refrestype) return false; if (a->refattrlength != b->refattrlength) return false; @@ -266,13 +266,17 @@ _equalArrayRef(ArrayRef *a, ArrayRef *b) return false; if (a->refelembyval != b->refelembyval) return false; + if (a->refelemalign != b->refelemalign) + return false; if (!equal(a->refupperindexpr, b->refupperindexpr)) return false; if (!equal(a->reflowerindexpr, b->reflowerindexpr)) return false; if (!equal(a->refexpr, b->refexpr)) return false; - return equal(a->refassgnexpr, b->refassgnexpr); + if (!equal(a->refassgnexpr, b->refassgnexpr)) + return false; + return true; } static bool |
