Commit 6fa3d0a7 authored by Jan Wieck's avatar Jan Wieck

One more fix to QuerySnapshot usage in ExecutorStart(). Maybe

current QuerySnapshot could be NULL.

Jan
parent a5f3abac
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.72 1999/02/07 13:37:55 wieck Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.73 1999/02/07 13:54:58 wieck Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -131,6 +131,10 @@ ExecutorStart(QueryDesc *queryDesc, EState *estate) ...@@ -131,6 +131,10 @@ ExecutorStart(QueryDesc *queryDesc, EState *estate)
/* /*
* Make our own private copy of the current queries snapshot data * Make our own private copy of the current queries snapshot data
*/ */
if (QuerySnapshot == NULL)
estate->es_snapshot = NULL
else
{
estate->es_snapshot = (Snapshot)palloc(sizeof(SnapshotData)); estate->es_snapshot = (Snapshot)palloc(sizeof(SnapshotData));
memcpy(estate->es_snapshot, QuerySnapshot, sizeof(SnapshotData)); memcpy(estate->es_snapshot, QuerySnapshot, sizeof(SnapshotData));
if (estate->es_snapshot->xcnt > 0) if (estate->es_snapshot->xcnt > 0)
...@@ -140,6 +144,7 @@ ExecutorStart(QueryDesc *queryDesc, EState *estate) ...@@ -140,6 +144,7 @@ ExecutorStart(QueryDesc *queryDesc, EState *estate)
memcpy(estate->es_snapshot->xip, QuerySnapshot->xip, memcpy(estate->es_snapshot->xip, QuerySnapshot->xip,
estate->es_snapshot->xcnt * sizeof(TransactionId)); estate->es_snapshot->xcnt * sizeof(TransactionId));
} }
}
/* /*
* Initialize the plan * Initialize the plan
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment