diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-09-12 00:24:46 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-09-12 00:24:46 +0000 |
commit | eb5bf513725d7a51a4a467202b6bb9dbf8417c80 (patch) | |
tree | 5d4ce97f114b75b3848996de8db554917261d4cd /contrib/intarray/_int.c | |
parent | b3f52320f6cb8374f3db5397e63b82f595c90681 (diff) | |
download | postgresql-eb5bf513725d7a51a4a467202b6bb9dbf8417c80.tar.gz postgresql-eb5bf513725d7a51a4a467202b6bb9dbf8417c80.zip |
> intarray and ltree both seem to be mapping their own declarations onto
> arrays using largely-similar code. But while intarray fails its
> regression test, I find ltree still passes. So I'm confused about what
> that code is really doing and don't want to touch it.
Please, apply attached patch, it solves the problem.
Teodor Sigaev
Diffstat (limited to 'contrib/intarray/_int.c')
-rw-r--r-- | contrib/intarray/_int.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/intarray/_int.c b/contrib/intarray/_int.c index f4fc63d1c18..65693a89f32 100644 --- a/contrib/intarray/_int.c +++ b/contrib/intarray/_int.c @@ -14,6 +14,7 @@ #include <float.h> +#include "catalog/pg_type.h" #include "access/gist.h" #include "access/itup.h" #include "access/rtree.h" @@ -919,8 +920,10 @@ new_intArrayType(int num) r = (ArrayType *) palloc(nbytes); MemSet(r, 0, nbytes); - r->size = nbytes; - r->ndim = NDIM; + + ARR_SIZE(r) = nbytes; + ARR_NDIM(r) = NDIM; + ARR_ELEMTYPE(r) = INT4OID; r->flags &= ~LEAFKEY; *((int *) ARR_DIMS(r)) = num; *((int *) ARR_LBOUND(r)) = 1; |