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/arrayutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/adt/arrayutils.c') diff --git a/src/backend/utils/adt/arrayutils.c b/src/backend/utils/adt/arrayutils.c index e3f116975d..af7359ca4e 100644 --- a/src/backend/utils/adt/arrayutils.c +++ b/src/backend/utils/adt/arrayutils.c @@ -213,7 +213,7 @@ ArrayGetIntegerTypmods(ArrayType *arr, int *n) (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), errmsg("typmod array must be one-dimensional"))); - if (ARR_HASNULL(arr)) + if (array_contains_nulls(arr)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("typmod array must not contain nulls"))); -- cgit v1.2.1