diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-09 13:09:07 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-09 13:09:07 -0500 |
commit | 304845075ce0eb9045af50ed32c688a0cb8dd490 (patch) | |
tree | 74e9b957bc60160376621860bb8a4bc5fc2dacb4 /src/backend/utils/adt/tsrank.c | |
parent | 361418be7c23e236d07edf4052de85ab8f32d88d (diff) | |
download | postgresql-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/tsrank.c')
-rw-r--r-- | src/backend/utils/adt/tsrank.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index 65823bd7052..8f5941c1476 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -408,7 +408,7 @@ getWeights(ArrayType *win) (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), errmsg("array of weight is too short"))); - if (ARR_HASNULL(win)) + if (array_contains_nulls(win)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("array of weight must not contain nulls"))); |