8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.76 2000/10/24 09:56:08 vadim Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.77 2000/10/24 20:06:39 tgl Exp $
12
12
*
13
13
* NOTES
14
14
* Transaction aborts can now occur two ways:
@@ -344,7 +344,7 @@ IsTransactionState(void)
344
344
* --------------------------------
345
345
*/
346
346
bool
347
- IsAbortedTransactionBlockState ()
347
+ IsAbortedTransactionBlockState (void )
348
348
{
349
349
TransactionState s = CurrentTransactionState ;
350
350
@@ -395,7 +395,7 @@ OverrideTransactionSystem(bool flag)
395
395
* --------------------------------
396
396
*/
397
397
TransactionId
398
- GetCurrentTransactionId ()
398
+ GetCurrentTransactionId (void )
399
399
{
400
400
TransactionState s = CurrentTransactionState ;
401
401
@@ -420,7 +420,7 @@ GetCurrentTransactionId()
420
420
* --------------------------------
421
421
*/
422
422
CommandId
423
- GetCurrentCommandId ()
423
+ GetCurrentCommandId (void )
424
424
{
425
425
TransactionState s = CurrentTransactionState ;
426
426
@@ -436,7 +436,7 @@ GetCurrentCommandId()
436
436
}
437
437
438
438
CommandId
439
- GetScanCommandId ()
439
+ GetScanCommandId (void )
440
440
{
441
441
TransactionState s = CurrentTransactionState ;
442
442
@@ -457,7 +457,7 @@ GetScanCommandId()
457
457
* --------------------------------
458
458
*/
459
459
AbsoluteTime
460
- GetCurrentTransactionStartTime ()
460
+ GetCurrentTransactionStartTime (void )
461
461
{
462
462
TransactionState s = CurrentTransactionState ;
463
463
@@ -523,7 +523,7 @@ CommandIdGEScanCommandId(CommandId cid)
523
523
*/
524
524
#ifdef NOT_USED
525
525
void
526
- ClearCommandIdCounterOverflowFlag ()
526
+ ClearCommandIdCounterOverflowFlag (void )
527
527
{
528
528
CommandIdCounterOverflowFlag = false;
529
529
}
@@ -535,7 +535,7 @@ ClearCommandIdCounterOverflowFlag()
535
535
* --------------------------------
536
536
*/
537
537
void
538
- CommandCounterIncrement ()
538
+ CommandCounterIncrement (void )
539
539
{
540
540
CurrentTransactionStateData .commandId += 1 ;
541
541
if (CurrentTransactionStateData .commandId == FirstCommandId )
@@ -568,7 +568,7 @@ SetScanCommandId(CommandId savedId)
568
568
* ----------------------------------------------------------------
569
569
*/
570
570
void
571
- InitializeTransactionSystem ()
571
+ InitializeTransactionSystem (void )
572
572
{
573
573
InitializeTransactionLog ();
574
574
}
@@ -583,7 +583,7 @@ InitializeTransactionSystem()
583
583
* --------------------------------
584
584
*/
585
585
static void
586
- AtStart_Cache ()
586
+ AtStart_Cache (void )
587
587
{
588
588
DiscardInvalid ();
589
589
}
@@ -593,7 +593,7 @@ AtStart_Cache()
593
593
* --------------------------------
594
594
*/
595
595
static void
596
- AtStart_Locks ()
596
+ AtStart_Locks (void )
597
597
{
598
598
599
599
/*
@@ -609,7 +609,7 @@ AtStart_Locks()
609
609
* --------------------------------
610
610
*/
611
611
static void
612
- AtStart_Memory ()
612
+ AtStart_Memory (void )
613
613
{
614
614
/* ----------------
615
615
* We shouldn't have any transaction contexts already.
@@ -659,7 +659,7 @@ AtStart_Memory()
659
659
* --------------------------------
660
660
*/
661
661
static void
662
- RecordTransactionCommit ()
662
+ RecordTransactionCommit (void )
663
663
{
664
664
TransactionId xid ;
665
665
int leak ;
@@ -740,7 +740,7 @@ RecordTransactionCommit()
740
740
* --------------------------------
741
741
*/
742
742
static void
743
- AtCommit_Cache ()
743
+ AtCommit_Cache (void )
744
744
{
745
745
/* ----------------
746
746
* Make catalog changes visible to all backend.
@@ -754,7 +754,7 @@ AtCommit_Cache()
754
754
* --------------------------------
755
755
*/
756
756
static void
757
- AtCommit_LocalCache ()
757
+ AtCommit_LocalCache (void )
758
758
{
759
759
/* ----------------
760
760
* Make catalog changes visible to me for the next command.
@@ -768,7 +768,7 @@ AtCommit_LocalCache()
768
768
* --------------------------------
769
769
*/
770
770
static void
771
- AtCommit_Locks ()
771
+ AtCommit_Locks (void )
772
772
{
773
773
/* ----------------
774
774
* XXX What if ProcReleaseLocks fails? (race condition?)
@@ -784,7 +784,7 @@ AtCommit_Locks()
784
784
* --------------------------------
785
785
*/
786
786
static void
787
- AtCommit_Memory ()
787
+ AtCommit_Memory (void )
788
788
{
789
789
/* ----------------
790
790
* Now that we're "out" of a transaction, have the
@@ -814,7 +814,7 @@ AtCommit_Memory()
814
814
* --------------------------------
815
815
*/
816
816
static void
817
- RecordTransactionAbort ()
817
+ RecordTransactionAbort (void )
818
818
{
819
819
TransactionId xid ;
820
820
@@ -855,7 +855,7 @@ RecordTransactionAbort()
855
855
* --------------------------------
856
856
*/
857
857
static void
858
- AtAbort_Cache ()
858
+ AtAbort_Cache (void )
859
859
{
860
860
RelationCacheAbort ();
861
861
SystemCacheAbort ();
@@ -867,7 +867,7 @@ AtAbort_Cache()
867
867
* --------------------------------
868
868
*/
869
869
static void
870
- AtAbort_Locks ()
870
+ AtAbort_Locks (void )
871
871
{
872
872
/* ----------------
873
873
* XXX What if ProcReleaseLocks() fails? (race condition?)
@@ -884,7 +884,7 @@ AtAbort_Locks()
884
884
* --------------------------------
885
885
*/
886
886
static void
887
- AtAbort_Memory ()
887
+ AtAbort_Memory (void )
888
888
{
889
889
/* ----------------
890
890
* Make sure we are in a valid context (not a child of
@@ -921,7 +921,7 @@ AtAbort_Memory()
921
921
* --------------------------------
922
922
*/
923
923
static void
924
- AtCleanup_Memory ()
924
+ AtCleanup_Memory (void )
925
925
{
926
926
/* ----------------
927
927
* Now that we're "out" of a transaction, have the
@@ -953,7 +953,7 @@ AtCleanup_Memory()
953
953
* --------------------------------
954
954
*/
955
955
static void
956
- StartTransaction ()
956
+ StartTransaction (void )
957
957
{
958
958
TransactionState s = CurrentTransactionState ;
959
959
@@ -1026,7 +1026,7 @@ StartTransaction()
1026
1026
* ---------------
1027
1027
*/
1028
1028
bool
1029
- CurrentXactInProgress ()
1029
+ CurrentXactInProgress (void )
1030
1030
{
1031
1031
return CurrentTransactionState -> state == TRANS_INPROGRESS ;
1032
1032
}
@@ -1038,7 +1038,7 @@ CurrentXactInProgress()
1038
1038
* --------------------------------
1039
1039
*/
1040
1040
static void
1041
- CommitTransaction ()
1041
+ CommitTransaction (void )
1042
1042
{
1043
1043
TransactionState s = CurrentTransactionState ;
1044
1044
@@ -1124,7 +1124,7 @@ CommitTransaction()
1124
1124
* --------------------------------
1125
1125
*/
1126
1126
static void
1127
- AbortTransaction ()
1127
+ AbortTransaction (void )
1128
1128
{
1129
1129
TransactionState s = CurrentTransactionState ;
1130
1130
@@ -1205,7 +1205,7 @@ AbortTransaction()
1205
1205
* --------------------------------
1206
1206
*/
1207
1207
static void
1208
- CleanupTransaction ()
1208
+ CleanupTransaction (void )
1209
1209
{
1210
1210
TransactionState s = CurrentTransactionState ;
1211
1211
@@ -1238,7 +1238,7 @@ CleanupTransaction()
1238
1238
* --------------------------------
1239
1239
*/
1240
1240
void
1241
- StartTransactionCommand ()
1241
+ StartTransactionCommand (void )
1242
1242
{
1243
1243
TransactionState s = CurrentTransactionState ;
1244
1244
@@ -1326,7 +1326,7 @@ StartTransactionCommand()
1326
1326
* --------------------------------
1327
1327
*/
1328
1328
void
1329
- CommitTransactionCommand ()
1329
+ CommitTransactionCommand (void )
1330
1330
{
1331
1331
TransactionState s = CurrentTransactionState ;
1332
1332
@@ -1407,7 +1407,7 @@ CommitTransactionCommand()
1407
1407
* --------------------------------
1408
1408
*/
1409
1409
void
1410
- AbortCurrentTransaction ()
1410
+ AbortCurrentTransaction (void )
1411
1411
{
1412
1412
TransactionState s = CurrentTransactionState ;
1413
1413
@@ -1636,7 +1636,7 @@ AbortTransactionBlock(void)
1636
1636
* --------------------------------
1637
1637
*/
1638
1638
void
1639
- UserAbortTransactionBlock ()
1639
+ UserAbortTransactionBlock (void )
1640
1640
{
1641
1641
TransactionState s = CurrentTransactionState ;
1642
1642
@@ -1696,17 +1696,30 @@ UserAbortTransactionBlock()
1696
1696
* --------------------------------
1697
1697
*/
1698
1698
void
1699
- AbortOutOfAnyTransaction ()
1699
+ AbortOutOfAnyTransaction (void )
1700
1700
{
1701
1701
TransactionState s = CurrentTransactionState ;
1702
1702
1703
1703
/*
1704
1704
* Get out of any low-level transaction
1705
1705
*/
1706
- if (s -> state != TRANS_DEFAULT )
1706
+ switch (s -> state )
1707
1707
{
1708
- AbortTransaction ();
1709
- CleanupTransaction ();
1708
+ case TRANS_START :
1709
+ case TRANS_INPROGRESS :
1710
+ case TRANS_COMMIT :
1711
+ /* In a transaction, so clean up */
1712
+ AbortTransaction ();
1713
+ CleanupTransaction ();
1714
+ break ;
1715
+ case TRANS_ABORT :
1716
+ /* AbortTransaction already done, still need Cleanup */
1717
+ CleanupTransaction ();
1718
+ break ;
1719
+ case TRANS_DEFAULT :
1720
+ case TRANS_DISABLED :
1721
+ /* Not in a transaction, do nothing */
1722
+ break ;
1710
1723
}
1711
1724
1712
1725
/*
@@ -1716,7 +1729,7 @@ AbortOutOfAnyTransaction()
1716
1729
}
1717
1730
1718
1731
bool
1719
- IsTransactionBlock ()
1732
+ IsTransactionBlock (void )
1720
1733
{
1721
1734
TransactionState s = CurrentTransactionState ;
1722
1735
0 commit comments