From 304845075ce0eb9045af50ed32c688a0cb8dd490 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 9 Jan 2011 13:09:07 -0500 Subject: 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. --- src/backend/utils/adt/arrayfuncs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/arrayfuncs.c') diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index a1bcbe687fd..1be96517df9 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -4700,7 +4700,7 @@ array_fill_internal(ArrayType *dims, ArrayType *lbs, errmsg("wrong range of array subscripts"), errdetail("Lower bound of dimension array must be one."))); - if (ARR_HASNULL(dims)) + if (array_contains_nulls(dims)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("dimension values cannot be null"))); @@ -4732,7 +4732,7 @@ array_fill_internal(ArrayType *dims, ArrayType *lbs, errmsg("wrong range of array subscripts"), errdetail("Lower bound of dimension array must be one."))); - if (ARR_HASNULL(lbs)) + if (array_contains_nulls(lbs)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("dimension values cannot be null"))); -- cgit v1.2.3