diff options
Diffstat (limited to 'contrib/tsearch2/tsearch2.c')
| -rw-r--r-- | contrib/tsearch2/tsearch2.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/contrib/tsearch2/tsearch2.c b/contrib/tsearch2/tsearch2.c index 33291ea581..63fba13329 100644 --- a/contrib/tsearch2/tsearch2.c +++ b/contrib/tsearch2/tsearch2.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/tsearch2/tsearch2.c,v 1.11 2010/01/02 16:57:32 momjian Exp $ + * $PostgreSQL: pgsql/contrib/tsearch2/tsearch2.c,v 1.12 2010/02/08 20:39:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -422,15 +422,8 @@ tsa_rewrite_accum(PG_FUNCTION_ARGS) MemoryContext aggcontext; MemoryContext oldcontext; - if (fcinfo->context && IsA(fcinfo->context, AggState)) - aggcontext = ((AggState *) fcinfo->context)->aggcontext; - else if (fcinfo->context && IsA(fcinfo->context, WindowAggState)) - aggcontext = ((WindowAggState *) fcinfo->context)->wincontext; - else - { + if (!AggCheckCallContext(fcinfo, &aggcontext)) elog(ERROR, "tsa_rewrite_accum called in non-aggregate context"); - aggcontext = NULL; /* keep compiler quiet */ - } if (PG_ARGISNULL(0) || PG_GETARG_POINTER(0) == NULL) { |
