postgres.git / summary / log / commit / refs

commit    c7b94bbad96144d8e31b0437ea40fdb1dd82190c
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Sat Apr 23 05:39:01 2005 +0000
First released in: 8.1.0, 7.3.10, 7.4.8, 8.0.3

    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.


contrib/intagg/int_aggregate.c | 3 +++ 1 file changed, 3 insertions(+) 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); [parent: 5eed8ce3820e]