projects
/
users
/
gsingh
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5eed8ce
)
int_aggregate's int_enum() doesn't work correctly with arrays that
author
Tom Lane
<tgl@sss.pgh.pa.us>
Sat, 23 Apr 2005 05:39:01 +0000
(
05:39
+0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Sat, 23 Apr 2005 05:39:01 +0000
(
05:39
+0000)
aren't 1-D, so give an error message instead of failing. Per report
from Ron Mayer.
contrib/intagg/int_aggregate.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/intagg/int_aggregate.c
b/contrib/intagg/int_aggregate.c
index 75cd34fe6e36e95d178f9cfc2cc3362cc792dcdd..1ab4c54a55d8d5e16cc481186db4aa42e5f8b04b 100644
(file)
--- 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);