mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08: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:
parent
8e4b89ccf2
commit
58d0214ed8
@ -222,6 +222,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);
|
||||
|
Loading…
Reference in New Issue
Block a user