aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorJan Wieck <JanWieck@Yahoo.com>1999-02-07 13:54:58 +0000
committerJan Wieck <JanWieck@Yahoo.com>1999-02-07 13:54:58 +0000
commit6fa3d0a7abe3f1fed5127a5575e2906e27c771de (patch)
treeb1778950966e63b648468d442331c895d8ae7e3f /src/backend/executor/execMain.c
parenta5f3abacb5b8b9e8abf7c1510063dd964a7194da (diff)
downloadpostgresql-6fa3d0a7abe3f1fed5127a5575e2906e27c771de.tar.gz
postgresql-6fa3d0a7abe3f1fed5127a5575e2906e27c771de.zip
One more fix to QuerySnapshot usage in ExecutorStart(). Maybe
current QuerySnapshot could be NULL. Jan
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 7a8730ce021..e4f9e0e5d46 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -26,7 +26,7 @@
*
*
* 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,14 +131,19 @@ ExecutorStart(QueryDesc *queryDesc, EState *estate)
/*
* Make our own private copy of the current queries snapshot data
*/
- estate->es_snapshot = (Snapshot)palloc(sizeof(SnapshotData));
- memcpy(estate->es_snapshot, QuerySnapshot, sizeof(SnapshotData));
- if (estate->es_snapshot->xcnt > 0)
+ if (QuerySnapshot == NULL)
+ estate->es_snapshot = NULL
+ else
{
- estate->es_snapshot->xip = (TransactionId *)
+ estate->es_snapshot = (Snapshot)palloc(sizeof(SnapshotData));
+ memcpy(estate->es_snapshot, QuerySnapshot, sizeof(SnapshotData));
+ if (estate->es_snapshot->xcnt > 0)
+ {
+ estate->es_snapshot->xip = (TransactionId *)
palloc(estate->es_snapshot->xcnt * sizeof(TransactionId));
- memcpy(estate->es_snapshot->xip, QuerySnapshot->xip,
+ memcpy(estate->es_snapshot->xip, QuerySnapshot->xip,
estate->es_snapshot->xcnt * sizeof(TransactionId));
+ }
}
/*