mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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.
This commit is contained in:
@ -187,7 +187,7 @@ cube_a_f8_f8(PG_FUNCTION_ARGS)
|
||||
double *dur,
|
||||
*dll;
|
||||
|
||||
if (ARR_HASNULL(ur) || ARR_HASNULL(ll))
|
||||
if (array_contains_nulls(ur) || array_contains_nulls(ll))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_ARRAY_ELEMENT_ERROR),
|
||||
errmsg("cannot work with arrays containing NULLs")));
|
||||
@ -228,7 +228,7 @@ cube_a_f8(PG_FUNCTION_ARGS)
|
||||
int size;
|
||||
double *dur;
|
||||
|
||||
if (ARR_HASNULL(ur))
|
||||
if (array_contains_nulls(ur))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_ARRAY_ELEMENT_ERROR),
|
||||
errmsg("cannot work with arrays containing NULLs")));
|
||||
@ -262,7 +262,7 @@ cube_subset(PG_FUNCTION_ARGS)
|
||||
i;
|
||||
int *dx;
|
||||
|
||||
if (ARR_HASNULL(idx))
|
||||
if (array_contains_nulls(idx))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_ARRAY_ELEMENT_ERROR),
|
||||
errmsg("cannot work with arrays containing NULLs")));
|
||||
|
Reference in New Issue
Block a user