summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2002-09-12 00:24:46 +0000
committerBruce Momjian2002-09-12 00:24:46 +0000
commit44ac3482e8b46a064d14e5ca7abb04dd56c76abc (patch)
treea01483d1923ff6676f09b56fe822b2e07a1f6e1c
parentb9f52c2d76e3d58b6e146476e0c0b73d4b257d71 (diff)
> 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
-rw-r--r--contrib/intarray/_int.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/intarray/_int.c b/contrib/intarray/_int.c
index f4fc63d1c1..65693a89f3 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;