From: Tom Lane Date: Sat, 23 Apr 2005 05:39:19 +0000 (+0000) Subject: int_aggregate's int_enum() doesn't work correctly with arrays that X-Git-Tag: REL7_3_10~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca1e578d62e21d1aef13e6b556f70fbf77216bfe;p=thirdparty%2Fpostgresql.git int_aggregate's int_enum() doesn't work correctly with arrays that aren't 1-D, so give an error message instead of failing. Per report from Ron Mayer. --- diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c index b964bf8862c..afe55df881b 100644 --- a/contrib/intagg/int_aggregate.c +++ b/contrib/intagg/int_aggregate.c @@ -220,6 +220,9 @@ int_enum(PG_FUNCTION_ARGS) pc->p = p; pc->flags = 0; } + /* Now that we have a detoasted array, verify dimensions */ + if (pc->p->a.ndim != 1) + elog(ERROR, "int_enum only accepts 1-D arrays"); pc->num = 0; fcinfo->context = (Node *) pc; MemoryContextSwitchTo(oldcontext);