Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #pragma once
00027 #ifndef trx0roll_h
00028 #define trx0roll_h
00029
00030 #include "univ.i"
00031 #include "trx0trx.h"
00032 #include "trx0types.h"
00033 #include "mtr0mtr.h"
00034 #include "trx0sys.h"
00035
00036 #define trx_roll_free_all_savepoints(s) trx_roll_savepoints_free((s), NULL)
00037
00038
00043 UNIV_INTERN
00044 ibool
00045 trx_is_recv(
00046
00047 const trx_t* trx);
00048
00051 UNIV_INTERN
00052 trx_savept_t
00053 trx_savept_take(
00054
00055 trx_t* trx);
00056
00058 UNIV_INTERN
00059 trx_undo_arr_t*
00060 trx_undo_arr_create(void);
00061
00062
00064 UNIV_INTERN
00065 void
00066 trx_undo_arr_free(
00067
00068 trx_undo_arr_t* arr);
00069
00072 UNIV_INLINE
00073 trx_undo_inf_t*
00074 trx_undo_arr_get_nth_info(
00075
00076 trx_undo_arr_t* arr,
00077 ulint n);
00078
00080 UNIV_INTERN
00081 void
00082 trx_roll_try_truncate(
00083
00084 trx_t* trx);
00085
00093 UNIV_INTERN
00094 trx_undo_rec_t*
00095 trx_roll_pop_top_rec_of_trx(
00096
00097 trx_t* trx,
00098 undo_no_t limit,
00099 roll_ptr_t* roll_ptr,
00100 mem_heap_t* heap);
00101
00106 UNIV_INTERN
00107 ibool
00108 trx_undo_rec_reserve(
00109
00110 trx_t* trx,
00111 undo_no_t undo_no);
00112
00114 UNIV_INTERN
00115 void
00116 trx_undo_rec_release(
00117
00118 trx_t* trx,
00119 undo_no_t undo_no);
00120
00122 UNIV_INTERN
00123 void
00124 trx_rollback(
00125
00126 trx_t* trx,
00127 trx_sig_t* sig,
00128 que_thr_t** next_thr);
00133
00138 UNIV_INTERN
00139 void
00140 trx_rollback_or_clean_recovered(
00141
00142 ibool all);
00144
00151 UNIV_INTERN
00152 os_thread_ret_t
00153 trx_rollback_or_clean_all_recovered(
00154
00155 void* arg);
00158
00160 UNIV_INTERN
00161 void
00162 trx_finish_rollback_off_kernel(
00163
00164 que_t* graph,
00165 trx_t* trx,
00166 que_thr_t** next_thr);
00172
00178 UNIV_INTERN
00179 que_t*
00180 trx_roll_graph_build(
00181
00182 trx_t* trx);
00183
00186 UNIV_INTERN
00187 roll_node_t*
00188 roll_node_create(
00189
00190 mem_heap_t* heap);
00191
00194 UNIV_INTERN
00195 que_thr_t*
00196 trx_rollback_step(
00197
00198 que_thr_t* thr);
00199
00202 UNIV_INTERN
00203 int
00204 trx_rollback_for_mysql(
00205
00206 trx_t* trx);
00207
00210 UNIV_INTERN
00211 int
00212 trx_rollback_last_sql_stat_for_mysql(
00213
00214 trx_t* trx);
00215
00218 UNIV_INTERN
00219 int
00220 trx_general_rollback_for_mysql(
00221
00222 trx_t* trx,
00223 trx_savept_t* savept);
00226
00235 UNIV_INTERN
00236 ulint
00237 trx_rollback_to_savepoint_for_mysql(
00238
00239 trx_t* trx,
00240 const char* savepoint_name,
00241 ib_int64_t* mysql_binlog_cache_pos);
00247
00253 UNIV_INTERN
00254 ulint
00255 trx_savepoint_for_mysql(
00256
00257 trx_t* trx,
00258 const char* savepoint_name,
00259 ib_int64_t binlog_cache_pos);
00264
00269 UNIV_INTERN
00270 ulint
00271 trx_release_savepoint_for_mysql(
00272
00273 trx_t* trx,
00274 const char* savepoint_name);
00276
00278 UNIV_INTERN
00279 void
00280 trx_roll_savepoint_free(
00281
00282 trx_t* trx,
00283 trx_named_savept_t* savep);
00285
00288 UNIV_INTERN
00289 void
00290 trx_roll_savepoints_free(
00291
00292 trx_t* trx,
00293 trx_named_savept_t* savep);
00298 struct trx_undo_inf_struct{
00299 trx_id_t trx_no;
00301 undo_no_t undo_no;
00302 ibool in_use;
00303 };
00304
00308 struct trx_undo_arr_struct{
00309 ulint n_cells;
00310 ulint n_used;
00311 trx_undo_inf_t* infos;
00312 mem_heap_t* heap;
00313 };
00314
00316 enum roll_node_state {
00317 ROLL_NODE_SEND = 1,
00319 ROLL_NODE_WAIT
00321 };
00322
00324 struct roll_node_struct{
00325 que_common_t common;
00326 enum roll_node_state state;
00327 ibool partial;
00329 trx_savept_t savept;
00332 };
00333
00335 struct trx_named_savept_struct{
00336 char* name;
00337 trx_savept_t savept;
00339 ib_int64_t mysql_binlog_cache_pos;
00344 UT_LIST_NODE_T(trx_named_savept_t)
00345 trx_savepoints;
00347 };
00348
00349 #ifndef UNIV_NONINL
00350 #include "trx0roll.ic"
00351 #endif
00352
00353 #endif