summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-04-23 05:39:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-04-23 05:39:19 +0000
commitca1e578d62e21d1aef13e6b556f70fbf77216bfe (patch)
tree917e33811ab2f9475cdc948cd52bbc21a39e0ccd
parentdaa7e6604ca20e271d7a737379e94d3ee4cd29c6 (diff)
downloadpostgresql-ca1e578d62e21d1aef13e6b556f70fbf77216bfe.tar.gz
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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c
index b964bf8862..afe55df881 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);