diff options
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r-- | src/backend/executor/execMain.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 940499cc61a..7eb1f7d0209 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -147,6 +147,9 @@ standard_ExecutorStart(QueryDesc *queryDesc, int eflags) Assert(queryDesc != NULL); Assert(queryDesc->estate == NULL); + /* caller must ensure the query's snapshot is active */ + Assert(GetActiveSnapshot() == queryDesc->snapshot); + /* * If the transaction is read-only, we need to check if any writes are * planned to non-temporary tables. EXPLAIN is considered read-only. @@ -319,6 +322,9 @@ standard_ExecutorRun(QueryDesc *queryDesc, Assert(estate != NULL); Assert(!(estate->es_top_eflags & EXEC_FLAG_EXPLAIN_ONLY)); + /* caller must ensure the query's snapshot is active */ + Assert(GetActiveSnapshot() == estate->es_snapshot); + /* * Switch into per-query memory context */ |