summaryrefslogtreecommitdiff
path: root/contrib/cube/cube.c
diff options
context:
space:
mode:
authorTom Lane2011-01-09 18:09:07 +0000
committerTom Lane2011-01-09 18:09:07 +0000
commit304845075ce0eb9045af50ed32c688a0cb8dd490 (patch)
tree74e9b957bc60160376621860bb8a4bc5fc2dacb4 /contrib/cube/cube.c
parent361418be7c23e236d07edf4052de85ab8f32d88d (diff)
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 'contrib/cube/cube.c')
-rw-r--r--contrib/cube/cube.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c
index 16331524321..4a207ccb988 100644
--- a/contrib/cube/cube.c
+++ b/contrib/cube/cube.c
@@ -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")));