We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parents029970c +2c332a2 commit568b13eCopy full SHA for 568b13e
src/ddl.c
@@ -1401,9 +1401,18 @@ MtmApplyDDLMessage(const char *messageBody, bool transactional)
1401
1402
DDLApplyInProgress=transactional ?MTM_DDL_IN_PROGRESS_TX :
1403
MTM_DDL_IN_PROGRESS_NONTX;
1404
+
1405
+/*
1406
+ * Due to ef94805096 'Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.'
1407
+ * there should be ActiveSnapshot set. Otherwise EnsurePortalSnapshotExists
1408
+ * will assert on ActivePortal->portalSnapshot == NULL since current
1409
+ * portal has snapshot in outer transaction.
1410
+ */
1411
+PushActiveSnapshot(GetTransactionSnapshot());
1412
SPI_connect();
1413
rc=SPI_execute(messageBody, false,0);
1414
SPI_finish();
1415
+PopActiveSnapshot();
1416
1417
if (rc<0)
1418
elog(ERROR,"Failed to execute utility statement %s",messageBody);