Drizzled Public API Documentation

trx0rec.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003 Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
00004 
00005 This program is free software; you can redistribute it and/or modify it under
00006 the terms of the GNU General Public License as published by the Free Software
00007 Foundation; version 2 of the License.
00008 
00009 This program is distributed in the hope that it will be useful, but WITHOUT
00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00012 
00013 You should have received a copy of the GNU General Public License along with
00014 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
00015 St, Fifth Floor, Boston, MA 02110-1301 USA
00016 
00017 *****************************************************************************/
00018 
00019 /**************************************************/
00026 #pragma once
00027 #ifndef trx0rec_h
00028 #define trx0rec_h
00029 
00030 #include "univ.i"
00031 #include "trx0types.h"
00032 #include "row0types.h"
00033 #include "mtr0mtr.h"
00034 #include "dict0types.h"
00035 #include "data0data.h"
00036 #include "rem0types.h"
00037 
00038 #ifndef UNIV_HOTBACKUP
00039 # include "que0types.h"
00040 
00041 /***********************************************************************/
00044 UNIV_INLINE
00045 trx_undo_rec_t*
00046 trx_undo_rec_copy(
00047 /*==============*/
00048   const trx_undo_rec_t* undo_rec, 
00049   mem_heap_t*   heap);    
00050 /**********************************************************************/
00053 UNIV_INLINE
00054 ulint
00055 trx_undo_rec_get_type(
00056 /*==================*/
00057   const trx_undo_rec_t* undo_rec);  
00058 /**********************************************************************/
00061 UNIV_INLINE
00062 ulint
00063 trx_undo_rec_get_cmpl_info(
00064 /*=======================*/
00065   const trx_undo_rec_t* undo_rec);  
00066 /**********************************************************************/
00069 UNIV_INLINE
00070 ibool
00071 trx_undo_rec_get_extern_storage(
00072 /*============================*/
00073   const trx_undo_rec_t* undo_rec);  
00074 /**********************************************************************/
00077 UNIV_INLINE
00078 undo_no_t
00079 trx_undo_rec_get_undo_no(
00080 /*=====================*/
00081   const trx_undo_rec_t* undo_rec);  
00082 /**********************************************************************/
00085 UNIV_INLINE
00086 ulint
00087 trx_undo_rec_get_offset(
00088 /*====================*/
00089   undo_no_t undo_no)  
00090   __attribute__((const));
00091 
00092 /**********************************************************************/
00094 #define trx_undo_rec_get_ptr(undo_rec, undo_no)   \
00095   ((undo_rec) + trx_undo_rec_get_offset(undo_no))
00096 
00097 /**********************************************************************/
00100 UNIV_INTERN
00101 byte*
00102 trx_undo_rec_get_pars(
00103 /*==================*/
00104   trx_undo_rec_t* undo_rec, 
00105   ulint*    type,   
00107   ulint*    cmpl_info,  
00109   ibool*    updated_extern, 
00111   undo_no_t*  undo_no,  
00112   table_id_t* table_id);  
00113 /*******************************************************************/
00116 UNIV_INTERN
00117 byte*
00118 trx_undo_rec_get_row_ref(
00119 /*=====================*/
00120   byte*   ptr,  
00126   dict_index_t* index,  
00127   dtuple_t**  ref,  
00128   mem_heap_t* heap);  
00130 /*******************************************************************/
00133 UNIV_INTERN
00134 byte*
00135 trx_undo_rec_skip_row_ref(
00136 /*======================*/
00137   byte*   ptr,  
00139   dict_index_t* index); 
00140 /**********************************************************************/
00144 UNIV_INTERN
00145 byte*
00146 trx_undo_update_rec_get_sys_cols(
00147 /*=============================*/
00148   byte*   ptr,    
00151   trx_id_t* trx_id,   
00152   roll_ptr_t* roll_ptr, 
00153   ulint*    info_bits); 
00154 /*******************************************************************/
00158 UNIV_INTERN
00159 byte*
00160 trx_undo_update_rec_get_update(
00161 /*===========================*/
00162   byte*   ptr,  
00168   dict_index_t* index,  
00169   ulint   type, 
00174   trx_id_t  trx_id, 
00175   roll_ptr_t  roll_ptr,
00176   ulint   info_bits,
00177   trx_t*    trx,  
00178   mem_heap_t* heap, 
00180   upd_t**   upd); 
00181 /*******************************************************************/
00185 UNIV_INTERN
00186 byte*
00187 trx_undo_rec_get_partial_row(
00188 /*=========================*/
00189   byte*   ptr,  
00196   dict_index_t* index,  
00197   dtuple_t**  row,  
00198   ibool   ignore_prefix, 
00201   mem_heap_t* heap);  
00203 /***********************************************************************/
00209 UNIV_INTERN
00210 ulint
00211 trx_undo_report_row_operation(
00212 /*==========================*/
00213   ulint   flags,    
00215   ulint   op_type,  
00217   que_thr_t*  thr,    
00218   dict_index_t* index,    
00219   const dtuple_t* clust_entry,  
00222   const upd_t*  update,   
00224   ulint   cmpl_info,  
00226   const rec_t*  rec,    
00229   roll_ptr_t* roll_ptr);  
00233 /******************************************************************/
00237 UNIV_INTERN
00238 trx_undo_rec_t*
00239 trx_undo_get_undo_rec_low(
00240 /*======================*/
00241   roll_ptr_t  roll_ptr, 
00242   mem_heap_t* heap);    
00243 /******************************************************************/
00251 UNIV_INTERN
00252 ulint
00253 trx_undo_get_undo_rec(
00254 /*==================*/
00255   roll_ptr_t  roll_ptr, 
00256   trx_id_t  trx_id,   
00259   trx_undo_rec_t** undo_rec,  
00260   mem_heap_t* heap);    
00261 /*******************************************************************/
00269 UNIV_INTERN
00270 ulint
00271 trx_undo_prev_version_build(
00272 /*========================*/
00273   const rec_t*  index_rec,
00275   mtr_t*    index_mtr,
00277   const rec_t*  rec,  
00278   dict_index_t* index,  
00279   ulint*    offsets,
00280   mem_heap_t* heap, 
00282   rec_t**   old_vers);
00285 #endif /* !UNIV_HOTBACKUP */
00286 /***********************************************************/
00289 UNIV_INTERN
00290 byte*
00291 trx_undo_parse_add_undo_rec(
00292 /*========================*/
00293   byte* ptr,  
00294   byte* end_ptr,
00295   page_t* page);  
00296 /***********************************************************/
00299 UNIV_INTERN
00300 byte*
00301 trx_undo_parse_erase_page_end(
00302 /*==========================*/
00303   byte* ptr,  
00304   byte* end_ptr,
00305   page_t* page, 
00306   mtr_t*  mtr); 
00308 #ifndef UNIV_HOTBACKUP
00309 
00310 /* Types of an undo log record: these have to be smaller than 16, as the
00311 compilation info multiplied by 16 is ORed to this value in an undo log
00312 record */
00313 
00314 #define TRX_UNDO_INSERT_REC 11  /* fresh insert into clustered index */
00315 #define TRX_UNDO_UPD_EXIST_REC  12  /* update of a non-delete-marked
00316           record */
00317 #define TRX_UNDO_UPD_DEL_REC  13  /* update of a delete marked record to
00318           a not delete marked record; also the
00319           fields of the record can change */
00320 #define TRX_UNDO_DEL_MARK_REC 14  /* delete marking of a record; fields
00321           do not change */
00322 #define TRX_UNDO_CMPL_INFO_MULT 16  /* compilation info is multiplied by
00323           this and ORed to the type above */
00324 #define TRX_UNDO_UPD_EXTERN 128 /* This bit can be ORed to type_cmpl
00325           to denote that we updated external
00326           storage fields: used by purge to
00327           free the external storage */
00328 
00329 /* Operation type flags used in trx_undo_report_row_operation */
00330 #define TRX_UNDO_INSERT_OP    1
00331 #define TRX_UNDO_MODIFY_OP    2
00332 
00333 #ifndef UNIV_NONINL
00334 #include "trx0rec.ic"
00335 #endif
00336 
00337 #endif /* !UNIV_HOTBACKUP */
00338 
00339 #endif /* trx0rec_h */