File tree 3 files changed +19
-0
lines changed
3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,10 @@ commit prepared 'y';
349
349
ERROR: COMMIT PREPARED cannot run inside a transaction block
350
350
rollback;
351
351
commit prepared 'y';
352
+ begin;
353
+ select 1/0;
354
+ ERROR: division by zero
355
+ prepare transaction 'noprep';
352
356
table twopc_test;
353
357
i
354
358
---
Original file line number Diff line number Diff line change @@ -251,6 +251,10 @@ rollback;
251
251
252
252
commit prepared ' y' ;
253
253
254
+ begin ;
255
+ select 1 / 0 ;
256
+ prepare transaction ' noprep' ;
257
+
254
258
table twopc_test;
255
259
table twopc_test2;
256
260
Original file line number Diff line number Diff line change @@ -483,6 +483,17 @@ MtmExplicitPrepare(char *gid)
483
483
int n_messages ;
484
484
int i ;
485
485
486
+ /*
487
+ * GetTopTransactionId() will fail for aborted tx, but we still need to
488
+ * finish it, so handle that manually.
489
+ */
490
+ if (IsAbortedTransactionBlockState ())
491
+ {
492
+ ret = PrepareTransactionBlock (gid );
493
+ Assert (!ret );
494
+ return false;
495
+ }
496
+
486
497
xid = GetTopTransactionId ();
487
498
sprintf (stream , "xid" XID_FMT , xid );
488
499
dmq_stream_subscribe (stream );
You can’t perform that action at this time.
0 commit comments