diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-23 05:39:01 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-23 05:39:01 +0000 |
commit | c7b94bbad96144d8e31b0437ea40fdb1dd82190c (patch) | |
tree | 762d100226e18694c616c7285381a0910b072082 | |
parent | 5eed8ce3820e4b94f356d0a6259f0d4bb52694b5 (diff) | |
download | postgresql-c7b94bbad96144d8e31b0437ea40fdb1dd82190c.tar.gz postgresql-c7b94bbad96144d8e31b0437ea40fdb1dd82190c.zip |
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); |