1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Here is a patch for the Table Function API. It fixes a bug found by Neil

Conway (BuildTupleFromCStrings sets NULL for pass-by-value types when
intended value is 0). It also implements some other improvements
suggested by Neil.

Joe Conway
This commit is contained in:
Bruce Momjian
2002-07-18 04:40:30 +00:00
parent a5a8110a86
commit 7ea5f1d7f1
3 changed files with 71 additions and 24 deletions

View File

@@ -52,7 +52,7 @@ init_MultiFuncCall(PG_FUNCTION_ARGS)
retval->call_cntr = 0;
retval->max_calls = 0;
retval->slot = NULL;
retval->fctx = NULL;
retval->user_fctx = NULL;
retval->attinmeta = NULL;
retval->fmctx = fcinfo->flinfo->fn_mcxt;
@@ -75,6 +75,23 @@ init_MultiFuncCall(PG_FUNCTION_ARGS)
return retval;
}
/*
* per_MultiFuncCall
*
* Do Multi-function per-call setup
*/
FuncCallContext *
per_MultiFuncCall(PG_FUNCTION_ARGS)
{
FuncCallContext *retval = (FuncCallContext *) fcinfo->flinfo->fn_extra;
/* make sure we start with a fresh slot */
if(retval->slot != NULL)
ExecClearTuple(retval->slot);
return retval;
}
/*
* end_MultiFuncCall
* Clean up after init_MultiFuncCall