diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-02-27 19:36:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-02-27 19:36:13 +0000 |
commit | 6779c55c228ba5904dc767a7882b47a2b4c74ff7 (patch) | |
tree | 27a1df60ccf81098405bd477d653da6edebce6c0 /src/backend/executor/functions.c | |
parent | e22c9c44756da85bf1e453f83bf260c9e5ef5813 (diff) | |
download | postgresql-6779c55c228ba5904dc767a7882b47a2b4c74ff7.tar.gz postgresql-6779c55c228ba5904dc767a7882b47a2b4c74ff7.zip |
Clean up BeginCommand and related routines. BeginCommand and EndCommand
are now both invoked once per received SQL command (raw parsetree) from
pg_exec_query_string. BeginCommand is actually just an empty routine
at the moment --- all its former operations have been pushed into tuple
receiver setup routines in printtup.c. This makes for a clean distinction
between BeginCommand/EndCommand (once per command) and the tuple receiver
setup/teardown routines (once per ExecutorRun call), whereas the old code
was quite ad hoc. Along the way, clean up the calling conventions for
ExecutorRun a little bit.
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r-- | src/backend/executor/functions.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index c38b8077f52..885d93a2aff 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.48 2002/02/26 22:47:05 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.49 2002/02/27 19:34:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -111,9 +111,8 @@ init_execution_state(char *src, Oid *argOidVect, int nargs) nextes->next = NULL; nextes->status = F_EXEC_START; - nextes->qd = CreateQueryDesc(queryTree, - planTree, - None); + + nextes->qd = CreateQueryDesc(queryTree, planTree, None, NULL); estate = CreateExecutorState(); if (nargs > 0) @@ -268,7 +267,7 @@ postquel_start(execution_state *es) static TupleTableSlot * postquel_getnext(execution_state *es) { - int feature; + long count; if (es->qd->operation == CMD_UTILITY) { @@ -281,9 +280,10 @@ postquel_getnext(execution_state *es) return (TupleTableSlot *) NULL; } - feature = (LAST_POSTQUEL_COMMAND(es)) ? EXEC_RETONE : EXEC_RUN; + /* If it's not the last command, just run it to completion */ + count = (LAST_POSTQUEL_COMMAND(es)) ? 1L : 0L; - return ExecutorRun(es->qd, es->estate, feature, 0L); + return ExecutorRun(es->qd, es->estate, ForwardScanDirection, count); } static void |