diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-17 22:14:56 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-17 22:14:56 +0000 |
commit | cecb6075594a407b7adcd9c9a0c243ca4b43c9a3 (patch) | |
tree | d3febb775476b082255aa6122b0ba80a8ba79b37 /src/backend/utils/adt/oid.c | |
parent | c859308aba7edef428994e6de90ff35f35a328c5 (diff) | |
download | postgresql-cecb6075594a407b7adcd9c9a0c243ca4b43c9a3.tar.gz postgresql-cecb6075594a407b7adcd9c9a0c243ca4b43c9a3.zip |
Make SQL arrays support null elements. This commit fixes the core array
functionality, but I still need to make another pass looking at places
that incidentally use arrays (such as ACL manipulation) to make sure they
are null-safe. Contrib needs work too.
I have not changed the behaviors that are still under discussion about
array comparison and what to do with lower bounds.
Diffstat (limited to 'src/backend/utils/adt/oid.c')
-rw-r--r-- | src/backend/utils/adt/oid.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/utils/adt/oid.c b/src/backend/utils/adt/oid.c index 62db042bbde..e400c9a1b4f 100644 --- a/src/backend/utils/adt/oid.c +++ b/src/backend/utils/adt/oid.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.64 2005/10/15 02:49:29 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.65 2005/11/17 22:14:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -176,7 +176,7 @@ buildoidvector(const Oid *oids, int n) */ result->size = OidVectorSize(n); result->ndim = 1; - result->flags = 0; + result->dataoffset = 0; /* never any nulls */ result->elemtype = OIDOID; result->dim1 = n; result->lbound1 = 0; @@ -213,7 +213,7 @@ oidvectorin(PG_FUNCTION_ARGS) result->size = OidVectorSize(n); result->ndim = 1; - result->flags = 0; + result->dataoffset = 0; /* never any nulls */ result->elemtype = OIDOID; result->dim1 = n; result->lbound1 = 0; @@ -262,9 +262,9 @@ oidvectorrecv(PG_FUNCTION_ARGS) ObjectIdGetDatum(OIDOID), Int32GetDatum(-1))); /* sanity checks: oidvector must be 1-D, no nulls */ - if (result->ndim != 1 || - result->flags != 0 || - result->elemtype != OIDOID) + if (ARR_NDIM(result) != 1 || + ARR_HASNULL(result) || + ARR_ELEMTYPE(result) != OIDOID) ereport(ERROR, (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), errmsg("invalid oidvector data"))); |