diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-21 22:05:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-21 22:05:55 +0000 |
commit | 959e61e917a802074e257d4bec13ee04ab4822ff (patch) | |
tree | 880e848a4b330587976ae3502164dc6e0c874ca4 /src/backend/executor/functions.c | |
parent | 0a2682445ebad57f911ed52f0634d1520164c319 (diff) | |
download | postgresql-959e61e917a802074e257d4bec13ee04ab4822ff.tar.gz postgresql-959e61e917a802074e257d4bec13ee04ab4822ff.zip |
Remove global variable scanCommandId in favor of storing a command ID
in snapshots, per my proposal of a few days ago. Also, tweak heapam.c
routines (heap_insert, heap_update, heap_delete, heap_mark4update) to
be passed the command ID to use, instead of doing GetCurrentCommandID.
For catalog updates they'll still get passed current command ID, but
for updates generated from the main executor they'll get passed the
command ID saved in the snapshot the query is using. This should fix
some corner cases associated with functions and triggers that advance
current command ID while an outer query is still in progress.
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r-- | src/backend/executor/functions.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index 938f7e17f93..1265bc78d4b 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.50 2002/05/12 20:10:02 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.51 2002/05/21 22:05:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -465,7 +465,6 @@ fmgr_sql(PG_FUNCTION_ARGS) SQLFunctionCachePtr fcache; execution_state *es; Datum result = 0; - CommandId savedId; /* * Switch to context in which the fcache lives. This ensures that @@ -475,14 +474,6 @@ fmgr_sql(PG_FUNCTION_ARGS) oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt); /* - * Before we start do anything we must save CurrentScanCommandId to - * restore it before return to upper Executor. Also, we have to set - * CurrentScanCommandId equal to CurrentCommandId. - vadim 08/29/97 - */ - savedId = GetScanCommandId(); - SetScanCommandId(GetCurrentCommandId()); - - /* * Initialize fcache and execution state if first time through. */ fcache = (SQLFunctionCachePtr) fcinfo->flinfo->fn_extra; @@ -516,11 +507,6 @@ fmgr_sql(PG_FUNCTION_ARGS) } /* - * Restore outer command ID. - */ - SetScanCommandId(savedId); - - /* * If we've gone through every command in this function, we are done. */ if (es == (execution_state *) NULL) |