~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Merged from jay.

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
 
UNIV_INTERN
 
20
 
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
 
UNIV_INTERN
 
28
 
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
 
UNIV_INTERN
 
34
 
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
 
UNIV_INTERN
 
50
 
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
 
UNIV_INTERN
 
61
 
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
 
UNIV_INTERN
 
76
 
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
 
UNIV_INTERN
 
85
 
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
 
UNIV_INTERN
 
93
 
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 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.
 
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.
109
108
Note: this is done in a background thread. */
110
 
UNIV_INTERN
 
109
 
111
110
os_thread_ret_t
112
 
trx_rollback_or_clean_all_recovered(
113
 
/*================================*/
 
111
trx_rollback_or_clean_all_without_sess(
 
112
/*===================================*/
114
113
                        /* out: a dummy parameter */
115
114
        void*   arg __attribute__((unused)));
116
115
                        /* in: a dummy parameter required by
117
116
                        os_thread_create */
118
117
/********************************************************************
119
118
Finishes a transaction rollback. */
120
 
UNIV_INTERN
 
119
 
121
120
void
122
121
trx_finish_rollback_off_kernel(
123
122
/*===========================*/
134
133
performed by executing this query graph like a query subprocedure call.
135
134
The reply about the completion of the rollback will be sent by this
136
135
graph. */
137
 
UNIV_INTERN
 
136
 
138
137
que_t*
139
138
trx_roll_graph_build(
140
139
/*=================*/
142
141
        trx_t*  trx);   /* in: trx handle */
143
142
/*************************************************************************
144
143
Creates a rollback command node struct. */
145
 
UNIV_INTERN
 
144
 
146
145
roll_node_t*
147
146
roll_node_create(
148
147
/*=============*/
150
149
        mem_heap_t*     heap);  /* in: mem heap where created */
151
150
/***************************************************************
152
151
Performs an execution step for a rollback command node in a query graph. */
153
 
UNIV_INTERN
 
152
 
154
153
que_thr_t*
155
154
trx_rollback_step(
156
155
/*==============*/
158
157
        que_thr_t*      thr);   /* in: query thread */
159
158
/***********************************************************************
160
159
Rollback a transaction used in MySQL. */
161
 
UNIV_INTERN
 
160
 
162
161
int
163
162
trx_rollback_for_mysql(
164
163
/*===================*/
166
165
        trx_t*  trx);   /* in: transaction handle */
167
166
/***********************************************************************
168
167
Rollback the latest SQL statement for MySQL. */
169
 
UNIV_INTERN
 
168
 
170
169
int
171
170
trx_rollback_last_sql_stat_for_mysql(
172
171
/*=================================*/
174
173
        trx_t*  trx);   /* in: transaction handle */
175
174
/***********************************************************************
176
175
Rollback a transaction used in MySQL. */
177
 
UNIV_INTERN
 
176
 
178
177
int
179
178
trx_general_rollback_for_mysql(
180
179
/*===========================*/
190
189
row holds a lock where the lock information is carried by the trx id stored in
191
190
the row, these locks are naturally released in the rollback. Savepoints which
192
191
were set after this savepoint are deleted. */
193
 
UNIV_INTERN
 
192
 
194
193
ulint
195
194
trx_rollback_to_savepoint_for_mysql(
196
195
/*================================*/
200
199
                                                otherwise DB_SUCCESS */
201
200
        trx_t*          trx,                    /* in: transaction handle */
202
201
        const char*     savepoint_name,         /* in: savepoint name */
203
 
        ib_int64_t*     mysql_binlog_cache_pos);/* out: the MySQL binlog cache
 
202
        ib_longlong*    mysql_binlog_cache_pos);/* out: the MySQL binlog cache
204
203
                                                position corresponding to this
205
204
                                                savepoint; MySQL needs this
206
205
                                                information to remove the
211
210
If there is already a savepoint of the same name, this call erases that old
212
211
savepoint and replaces it with a new. Savepoints are deleted in a transaction
213
212
commit or rollback. */
214
 
UNIV_INTERN
 
213
 
215
214
ulint
216
215
trx_savepoint_for_mysql(
217
216
/*====================*/
218
217
                                                /* out: always DB_SUCCESS */
219
218
        trx_t*          trx,                    /* in: transaction handle */
220
219
        const char*     savepoint_name,         /* in: savepoint name */
221
 
        ib_int64_t      binlog_cache_pos);      /* in: MySQL binlog cache
 
220
        ib_longlong     binlog_cache_pos);      /* in: MySQL binlog cache
222
221
                                                position corresponding to this
223
222
                                                connection at the time of the
224
223
                                                savepoint */
226
225
/***********************************************************************
227
226
Releases a named savepoint. Savepoints which
228
227
were set after this savepoint are deleted. */
229
 
UNIV_INTERN
 
228
 
230
229
ulint
231
230
trx_release_savepoint_for_mysql(
232
231
/*============================*/
239
238
 
240
239
/***********************************************************************
241
240
Frees savepoint structs. */
242
 
UNIV_INTERN
 
241
 
243
242
void
244
243
trx_roll_savepoints_free(
245
244
/*=====================*/
248
247
                                        if this is NULL, free all savepoints
249
248
                                        of trx */
250
249
 
 
250
extern sess_t*          trx_dummy_sess;
 
251
 
251
252
/* A cell in the array used during a rollback and a purge */
252
253
struct  trx_undo_inf_struct{
253
254
        dulint  trx_no;         /* transaction number: not defined during
280
281
        char*           name;           /* savepoint name */
281
282
        trx_savept_t    savept;         /* the undo number corresponding to
282
283
                                        the savepoint */
283
 
        ib_int64_t      mysql_binlog_cache_pos;
 
284
        ib_longlong     mysql_binlog_cache_pos;
284
285
                                        /* the MySQL binlog cache position
285
286
                                        corresponding to this savepoint, not
286
287
                                        defined if the MySQL binlogging is not