~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/trx0xa.h

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#define MAXBQUALSIZE     64             /* maximum size in bytes of bqual */
17
17
 
18
18
struct xid_t {
19
 
        long formatID;                  /* format identifier */
 
19
        long formatID;                  /* format identifier; -1
 
20
                                        means that the XID is null */
20
21
        long gtrid_length;              /* value from 1 through 64 */
21
22
        long bqual_length;              /* value from 1 through 64 */
22
23
        char data[XIDDATASIZE];
23
24
};
24
25
typedef struct xid_t XID;
25
26
#endif
26
 
/*
27
 
 * A value of -1 in formatID means that the XID is null.
28
 
 */
29
 
 
30
 
 
31
 
#ifdef NOTDEFINED
32
 
/* Let us comment this out to remove compiler errors!!!!!!!!!!!! */
33
 
 
34
 
/*
35
 
 * Declarations of routines by which RMs call TMs:
36
 
 */
37
 
extern int ax_reg __P((int, XID *, long));
38
 
extern int ax_unreg __P((int, long));
39
 
 
40
 
/*
41
 
 * XA Switch Data Structure
42
 
 */
43
 
#define RMNAMESZ        32              /* length of resource manager name, */
44
 
                                        /* including the null terminator */
45
 
#define MAXINFOSIZE     256             /* maximum size in bytes of xa_info */
46
 
                                        /* strings, including the null
47
 
                                        terminator */
48
 
 
49
 
 
50
 
struct xa_switch_t {
51
 
        char name[RMNAMESZ];            /* name of resource manager */
52
 
        long flags;                     /* resource manager specific options */
53
 
        long version;                   /* must be 0 */
54
 
        int (*xa_open_entry)            /* xa_open function pointer */
55
 
                __P((char *, int, long));
56
 
        int (*xa_close_entry)           /* xa_close function pointer */
57
 
                __P((char *, int, long));
58
 
        int (*xa_start_entry)           /* xa_start function pointer */
59
 
                __P((XID *, int, long));
60
 
        int (*xa_end_entry)             /* xa_end function pointer */
61
 
                __P((XID *, int, long));
62
 
        int (*xa_rollback_entry)        /* xa_rollback function pointer */
63
 
                __P((XID *, int, long));
64
 
        int (*xa_prepare_entry)         /* xa_prepare function pointer */
65
 
                __P((XID *, int, long));
66
 
        int (*xa_commit_entry)          /* xa_commit function pointer */
67
 
                __P((XID *, int, long));
68
 
        int (*xa_recover_entry)         /* xa_recover function pointer */
69
 
                __P((XID *, long, int, long));
70
 
        int (*xa_forget_entry)          /* xa_forget function pointer */
71
 
                __P((XID *, int, long));
72
 
        int (*xa_complete_entry)        /* xa_complete function pointer */
73
 
                __P((int *, int *, int, long));
74
 
};
75
 
#endif  /* NOTDEFINED */
76
 
 
77
 
 
78
 
/*
79
 
 * Flag definitions for the RM switch
80
 
 */
81
 
#define TMNOFLAGS       0x00000000L     /* no resource manager features
82
 
                                        selected */
83
 
#define TMREGISTER      0x00000001L     /* resource manager dynamically
84
 
                                        registers */
85
 
#define TMNOMIGRATE     0x00000002L     /* resource manager does not support
86
 
                                        association migration */
87
 
#define TMUSEASYNC      0x00000004L     /* resource manager supports
88
 
                                        asynchronous operations */
89
 
/*
90
 
 * Flag definitions for xa_ and ax_ routines
91
 
 */
92
 
/* use TMNOFLAGGS, defined above, when not specifying other flags */
93
 
#define TMASYNC         0x80000000L     /* perform routine asynchronously */
94
 
#define TMONEPHASE      0x40000000L     /* caller is using one-phase commit
95
 
                                        optimisation */
96
 
#define TMFAIL          0x20000000L     /* dissociates caller and marks
97
 
                                        transaction branch rollback-only */
98
 
#define TMNOWAIT        0x10000000L     /* return if blocking condition
99
 
                                        exists */
100
 
#define TMRESUME        0x08000000L     /* caller is resuming association with
101
 
                                        suspended transaction branch */
102
 
#define TMSUCCESS       0x04000000L     /* dissociate caller from transaction
103
 
                                        branch */
104
 
#define TMSUSPEND       0x02000000L     /* caller is suspending, not ending,
105
 
                                        association */
106
 
#define TMSTARTRSCAN    0x01000000L     /* start a recovery scan */
107
 
#define TMENDRSCAN      0x00800000L     /* end a recovery scan */
108
 
#define TMMULTIPLE      0x00400000L     /* wait for any asynchronous
109
 
                                        operation */
110
 
#define TMJOIN          0x00200000L     /* caller is joining existing
111
 
                                        transaction branch */
112
 
#define TMMIGRATE       0x00100000L     /* caller intends to perform
113
 
                                        migration */
114
 
 
115
 
/*
116
 
 * ax_() return codes (transaction manager reports to resource manager)
117
 
 */
118
 
#define TM_JOIN         2               /* caller is joining existing
119
 
                                        transaction branch */
120
 
#define TM_RESUME       1               /* caller is resuming association with
121
 
                                        suspended transaction branch */
122
 
#define TM_OK           0               /* normal execution */
123
 
#define TMER_TMERR      -1              /* an error occurred in the transaction
124
 
                                        manager */
125
 
#define TMER_INVAL      -2              /* invalid arguments were given */
126
 
#define TMER_PROTO      -3              /* routine invoked in an improper
127
 
                                        context */
128
 
 
129
 
/*
130
 
 * xa_() return codes (resource manager reports to transaction manager)
131
 
 */
132
 
#define XA_RBBASE       100             /* The inclusive lower bound of the
133
 
                                        rollback codes */
134
 
#define XA_RBROLLBACK   XA_RBBASE       /* The rollback was caused by an
135
 
                                        unspecified reason */
136
 
#define XA_RBCOMMFAIL   XA_RBBASE+1     /* The rollback was caused by a
137
 
                                        communication failure */
138
 
#define XA_RBDEADLOCK   XA_RBBASE+2     /* A deadlock was detected */
139
 
#define XA_RBINTEGRITY  XA_RBBASE+3     /* A condition that violates the
140
 
                                        integrity of the resources was
141
 
                                        detected */
142
 
#define XA_RBOTHER      XA_RBBASE+4     /* The resource manager rolled back the
143
 
                                        transaction branch for a reason not
144
 
                                        on this list */
145
 
#define XA_RBPROTO      XA_RBBASE+5     /* A protocol error occurred in the
146
 
                                        resource manager */
147
 
#define XA_RBTIMEOUT    XA_RBBASE+6     /* A transaction branch took
148
 
                                        too long */
149
 
#define XA_RBTRANSIENT  XA_RBBASE+7     /* May retry the transaction branch */
150
 
#define XA_RBEND        XA_RBTRANSIENT  /* The inclusive upper bound of the
151
 
                                        rollback codes */
152
 
#define XA_NOMIGRATE    9               /* resumption must occur where
153
 
                                        suspension occurred */
154
 
#define XA_HEURHAZ      8               /* the transaction branch may have
155
 
                                        been heuristically completed */
156
 
#define XA_HEURCOM      7               /* the transaction branch has been
157
 
                                        heuristically committed */
158
 
#define XA_HEURRB       6               /* the transaction branch has been
159
 
                                        heuristically rolled back */
160
 
#define XA_HEURMIX      5               /* the transaction branch has been
161
 
                                        heuristically committed and rolled
162
 
                                        back */
163
 
#define XA_RETRY        4               /* routine returned with no effect and
164
 
                                        may be re-issued */
165
 
#define XA_RDONLY       3               /* the transaction branch was read-only
166
 
                                        and has been committed */
167
27
#define XA_OK           0               /* normal execution */
168
28
#define XAER_ASYNC      -2              /* asynchronous operation already
169
29
                                        outstanding */