git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 56c8877)
int_aggregate's int_enum() doesn't work correctly with arrays that
2005年4月23日 05:38:22 +0000 (05:38 +0000)
2005年4月23日 05:38:22 +0000 (05:38 +0000)
aren't 1-D, so give an error message instead of failing. Per report
from Ron Mayer.


diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c
index 1c95d64af6130383ad501a07947726176f10acd4..292855018acc1d0a828960387d3fdaef0769d945 100644 (file)
--- a/contrib/intagg/int_aggregate.c
+++ b/contrib/intagg/int_aggregate.c
@@ -242,6 +242,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);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /