diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-23 05:38:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-23 05:38:43 +0000 |
commit | 58d0214ed8798baa7c4bf4a5089a9d9d39307dda (patch) | |
tree | 70dc9e43d9182667bd8df691b8bf493066fbb44c | |
parent | 8e4b89ccf2884d9646eeaa4fe309d371726ebe24 (diff) |
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.
-rw-r--r-- | contrib/intagg/int_aggregate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c index 75cd34fe6e3..1ab4c54a55d 100644 --- a/contrib/intagg/int_aggregate.c +++ b/contrib/intagg/int_aggregate.c @@ -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); |