diff options
author | Tom Lane | 2011-01-09 18:09:07 +0000 |
---|---|---|
committer | Tom Lane | 2011-01-09 18:09:07 +0000 |
commit | 304845075ce0eb9045af50ed32c688a0cb8dd490 (patch) | |
tree | 74e9b957bc60160376621860bb8a4bc5fc2dacb4 /contrib/ltree/_ltree_gist.c | |
parent | 361418be7c23e236d07edf4052de85ab8f32d88d (diff) |
Use array_contains_nulls instead of ARR_HASNULL on user-supplied arrays.
This applies the fix for bug #5784 to remaining places where we wish
to reject nulls in user-supplied arrays. In all these places, there's
no reason not to allow a null bitmap to be present, so long as none of
the current elements are actually null.
I did not change some other places where we are looking at system catalog
entries or aggregate transition values, as the presence of a null bitmap
in such an array would be suspicious.
Diffstat (limited to 'contrib/ltree/_ltree_gist.c')
-rw-r--r-- | contrib/ltree/_ltree_gist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c index f221c2de543..c1f509ed8b1 100644 --- a/contrib/ltree/_ltree_gist.c +++ b/contrib/ltree/_ltree_gist.c @@ -92,7 +92,7 @@ _ltree_compress(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), errmsg("array must be one-dimensional"))); - if (ARR_HASNULL(val)) + if (array_contains_nulls(val)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("array must not contain nulls"))); @@ -538,7 +538,7 @@ _arrq_cons(ltree_gist *key, ArrayType *_query) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), errmsg("array must be one-dimensional"))); - if (ARR_HASNULL(_query)) + if (array_contains_nulls(_query)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("array must not contain nulls"))); |