From dad4cb6258382e99409c3e0673f1a5ec5b8bf03f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 1 Oct 2008 19:51:50 +0000 Subject: Improve tuplestore.c to support multiple concurrent read positions. This facility replaces the former mark/restore support but is otherwise upward-compatible with previous uses. It's expected to be needed for single evaluation of CTEs and also for window functions, so I'm committing it separately instead of waiting for either one of those patches to be finished. Per discussion with Greg Stark and Hitoshi Harada. Note: I removed nodeFunctionscan's mark/restore support, instead of bothering to update it for this change, because it was dead code anyway. --- src/backend/executor/nodeFunctionscan.c | 41 ++++----------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) (limited to 'src/backend/executor/nodeFunctionscan.c') diff --git a/src/backend/executor/nodeFunctionscan.c b/src/backend/executor/nodeFunctionscan.c index 6bbb5b139b6..6113a2c9067 100644 --- a/src/backend/executor/nodeFunctionscan.c +++ b/src/backend/executor/nodeFunctionscan.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeFunctionscan.c,v 1.46 2008/02/29 02:49:39 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeFunctionscan.c,v 1.47 2008/10/01 19:51:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -131,6 +131,9 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags) TypeFuncClass functypclass; TupleDesc tupdesc = NULL; + /* check for unsupported flags */ + Assert(!(eflags & EXEC_FLAG_MARK)); + /* * FunctionScan should not have any children. */ @@ -273,42 +276,6 @@ ExecEndFunctionScan(FunctionScanState *node) node->tuplestorestate = NULL; } -/* ---------------------------------------------------------------- - * ExecFunctionMarkPos - * - * Calls tuplestore to save the current position in the stored file. - * ---------------------------------------------------------------- - */ -void -ExecFunctionMarkPos(FunctionScanState *node) -{ - /* - * if we haven't materialized yet, just return. - */ - if (!node->tuplestorestate) - return; - - tuplestore_markpos(node->tuplestorestate); -} - -/* ---------------------------------------------------------------- - * ExecFunctionRestrPos - * - * Calls tuplestore to restore the last saved file position. - * ---------------------------------------------------------------- - */ -void -ExecFunctionRestrPos(FunctionScanState *node) -{ - /* - * if we haven't materialized yet, just return. - */ - if (!node->tuplestorestate) - return; - - tuplestore_restorepos(node->tuplestorestate); -} - /* ---------------------------------------------------------------- * ExecFunctionReScan * -- cgit v1.2.3