1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-29 16:21:20 +03:00

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.
This commit is contained in:
Tom Lane 2005-04-23 05:39:19 +00:00
parent daa7e6604c
commit ca1e578d62

View File

@ -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);