aboutsummaryrefslogtreecommitdiff
path: root/contrib/ltree/_ltree_gist.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ltree/_ltree_gist.c')
-rw-r--r--contrib/ltree/_ltree_gist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c
index 0344b6dc134..c4623ec020f 100644
--- a/contrib/ltree/_ltree_gist.c
+++ b/contrib/ltree/_ltree_gist.c
@@ -76,6 +76,10 @@ _ltree_compress(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("array must be one-dimensional")));
+ if (ARR_HASNULL(val))
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("array must not contain nulls")));
key = (ltree_gist *) palloc(len);
key->len = len;
@@ -518,6 +522,10 @@ _arrq_cons(ltree_gist * key, ArrayType *_query)
ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("array must be one-dimensional")));
+ if (ARR_HASNULL(_query))
+ ereport(ERROR,
+ (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
+ errmsg("array must not contain nulls")));
while (num > 0)
{