aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/arrayfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-01-09 13:09:07 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-01-09 13:09:07 -0500
commit304845075ce0eb9045af50ed32c688a0cb8dd490 (patch)
tree74e9b957bc60160376621860bb8a4bc5fc2dacb4 /src/backend/utils/adt/arrayfuncs.c
parent361418be7c23e236d07edf4052de85ab8f32d88d (diff)
downloadpostgresql-304845075ce0eb9045af50ed32c688a0cb8dd490.tar.gz
postgresql-304845075ce0eb9045af50ed32c688a0cb8dd490.zip
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 'src/backend/utils/adt/arrayfuncs.c')
-rw-r--r--src/backend/utils/adt/arrayfuncs.c4
1 files changed, 2 insertions, 2 deletions
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")));