~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/trx0roll.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:
17
17
 
18
18
/***********************************************************************
19
19
Returns a transaction savepoint taken at this point in time. */
20
 
 
 
20
UNIV_INTERN
21
21
trx_savept_t
22
22
trx_savept_take(
23
23
/*============*/
25
25
        trx_t*  trx);   /* in: transaction */
26
26
/***********************************************************************
27
27
Creates an undo number array. */
28
 
 
 
28
UNIV_INTERN
29
29
trx_undo_arr_t*
30
30
trx_undo_arr_create(void);
31
31
/*=====================*/
32
32
/***********************************************************************
33
33
Frees an undo number array. */
34
 
 
 
34
UNIV_INTERN
35
35
void
36
36
trx_undo_arr_free(
37
37
/*==============*/
47
47
        ulint           n);     /* in: position */
48
48
/***************************************************************************
49
49
Tries truncate the undo logs. */
50
 
 
 
50
UNIV_INTERN
51
51
void
52
52
trx_roll_try_truncate(
53
53
/*==================*/
58
58
undo number of the popped undo record to the array of currently processed
59
59
undo numbers in the transaction. When the query thread finishes processing
60
60
of this undo record, it must be released with trx_undo_rec_release. */
61
 
 
 
61
UNIV_INTERN
62
62
trx_undo_rec_t*
63
63
trx_roll_pop_top_rec_of_trx(
64
64
/*========================*/
73
73
Reserves an undo log record for a query thread to undo. This should be
74
74
called if the query thread gets the undo log record not using the pop
75
75
function above. */
76
 
 
 
76
UNIV_INTERN
77
77
ibool
78
78
trx_undo_rec_reserve(
79
79
/*=================*/
82
82
        dulint  undo_no);/* in: undo number of the record */
83
83
/***********************************************************************
84
84
Releases a reserved undo record. */
85
 
 
 
85
UNIV_INTERN
86
86
void
87
87
trx_undo_rec_release(
88
88
/*=================*/
90
90
        dulint  undo_no);/* in: undo number */
91
91
/*************************************************************************
92
92
Starts a rollback operation. */
93
 
 
 
93
UNIV_INTERN
94
94
void
95
95
trx_rollback(
96
96
/*=========*/
102
102
                                calling function can start running
103
103
                                a new query thread */
104
104
/***********************************************************************
105
 
Rollback or clean up transactions which have no user session. If the
106
 
transaction already was committed, then we clean up a possible insert
107
 
undo log. If the transaction was not yet committed, then we roll it back.
 
105
Rollback or clean up any incomplete transactions which were
 
106
encountered in crash recovery.  If the transaction already was
 
107
committed, then we clean up a possible insert undo log. If the
 
108
transaction was not yet committed, then we roll it back.
108
109
Note: this is done in a background thread. */
109
 
 
 
110
UNIV_INTERN
110
111
os_thread_ret_t
111
 
trx_rollback_or_clean_all_without_sess(
112
 
/*===================================*/
 
112
trx_rollback_or_clean_all_recovered(
 
113
/*================================*/
113
114
                        /* out: a dummy parameter */
114
115
        void*   arg __attribute__((unused)));
115
116
                        /* in: a dummy parameter required by
116
117
                        os_thread_create */
117
118
/********************************************************************
118
119
Finishes a transaction rollback. */
119
 
 
 
120
UNIV_INTERN
120
121
void
121
122
trx_finish_rollback_off_kernel(
122
123
/*===========================*/
133
134
performed by executing this query graph like a query subprocedure call.
134
135
The reply about the completion of the rollback will be sent by this
135
136
graph. */
136
 
 
 
137
UNIV_INTERN
137
138
que_t*
138
139
trx_roll_graph_build(
139
140
/*=================*/
141
142
        trx_t*  trx);   /* in: trx handle */
142
143
/*************************************************************************
143
144
Creates a rollback command node struct. */
144
 
 
 
145
UNIV_INTERN
145
146
roll_node_t*
146
147
roll_node_create(
147
148
/*=============*/
149
150
        mem_heap_t*     heap);  /* in: mem heap where created */
150
151
/***************************************************************
151
152
Performs an execution step for a rollback command node in a query graph. */
152
 
 
 
153
UNIV_INTERN
153
154
que_thr_t*
154
155
trx_rollback_step(
155
156
/*==============*/
157
158
        que_thr_t*      thr);   /* in: query thread */
158
159
/***********************************************************************
159
160
Rollback a transaction used in MySQL. */
160
 
 
 
161
UNIV_INTERN
161
162
int
162
163
trx_rollback_for_mysql(
163
164
/*===================*/
165
166
        trx_t*  trx);   /* in: transaction handle */
166
167
/***********************************************************************
167
168
Rollback the latest SQL statement for MySQL. */
168
 
 
 
169
UNIV_INTERN
169
170
int
170
171
trx_rollback_last_sql_stat_for_mysql(
171
172
/*=================================*/
173
174
        trx_t*  trx);   /* in: transaction handle */
174
175
/***********************************************************************
175
176
Rollback a transaction used in MySQL. */
176
 
 
 
177
UNIV_INTERN
177
178
int
178
179
trx_general_rollback_for_mysql(
179
180
/*===========================*/
189
190
row holds a lock where the lock information is carried by the trx id stored in
190
191
the row, these locks are naturally released in the rollback. Savepoints which
191
192
were set after this savepoint are deleted. */
192
 
 
 
193
UNIV_INTERN
193
194
ulint
194
195
trx_rollback_to_savepoint_for_mysql(
195
196
/*================================*/
199
200
                                                otherwise DB_SUCCESS */
200
201
        trx_t*          trx,                    /* in: transaction handle */
201
202
        const char*     savepoint_name,         /* in: savepoint name */
202
 
        ib_longlong*    mysql_binlog_cache_pos);/* out: the MySQL binlog cache
 
203
        ib_int64_t*     mysql_binlog_cache_pos);/* out: the MySQL binlog cache
203
204
                                                position corresponding to this
204
205
                                                savepoint; MySQL needs this
205
206
                                                information to remove the
210
211
If there is already a savepoint of the same name, this call erases that old
211
212
savepoint and replaces it with a new. Savepoints are deleted in a transaction
212
213
commit or rollback. */
213
 
 
 
214
UNIV_INTERN
214
215
ulint
215
216
trx_savepoint_for_mysql(
216
217
/*====================*/
217
218
                                                /* out: always DB_SUCCESS */
218
219
        trx_t*          trx,                    /* in: transaction handle */
219
220
        const char*     savepoint_name,         /* in: savepoint name */
220
 
        ib_longlong     binlog_cache_pos);      /* in: MySQL binlog cache
 
221
        ib_int64_t      binlog_cache_pos);      /* in: MySQL binlog cache
221
222
                                                position corresponding to this
222
223
                                                connection at the time of the
223
224
                                                savepoint */
225
226
/***********************************************************************
226
227
Releases a named savepoint. Savepoints which
227
228
were set after this savepoint are deleted. */
228
 
 
 
229
UNIV_INTERN
229
230
ulint
230
231
trx_release_savepoint_for_mysql(
231
232
/*============================*/
238
239
 
239
240
/***********************************************************************
240
241
Frees savepoint structs. */
241
 
 
 
242
UNIV_INTERN
242
243
void
243
244
trx_roll_savepoints_free(
244
245
/*=====================*/
247
248
                                        if this is NULL, free all savepoints
248
249
                                        of trx */
249
250
 
250
 
extern sess_t*          trx_dummy_sess;
251
 
 
252
251
/* A cell in the array used during a rollback and a purge */
253
252
struct  trx_undo_inf_struct{
254
253
        dulint  trx_no;         /* transaction number: not defined during
281
280
        char*           name;           /* savepoint name */
282
281
        trx_savept_t    savept;         /* the undo number corresponding to
283
282
                                        the savepoint */
284
 
        ib_longlong     mysql_binlog_cache_pos;
 
283
        ib_int64_t      mysql_binlog_cache_pos;
285
284
                                        /* the MySQL binlog cache position
286
285
                                        corresponding to this savepoint, not
287
286
                                        defined if the MySQL binlogging is not