Drizzled Public API Documentation

page0cur.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003 Copyright (C) 1994, 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 page0cur_h
00028 #define page0cur_h
00029 
00030 #include "univ.i"
00031 
00032 #include "buf0types.h"
00033 #include "page0page.h"
00034 #include "rem0rec.h"
00035 #include "data0data.h"
00036 #include "mtr0mtr.h"
00037 
00038 
00039 #define PAGE_CUR_ADAPT
00040 
00041 /* Page cursor search modes; the values must be in this order! */
00042 
00043 #define PAGE_CUR_UNSUPP 0
00044 #define PAGE_CUR_G  1
00045 #define PAGE_CUR_GE 2
00046 #define PAGE_CUR_L  3
00047 #define PAGE_CUR_LE 4
00048 /*#define PAGE_CUR_LE_OR_EXTENDS 5*/ /* This is a search mode used in
00049          "column LIKE 'abc%' ORDER BY column DESC";
00050          we have to find strings which are <= 'abc' or
00051          which extend it */
00052 #ifdef UNIV_SEARCH_DEBUG
00053 # define PAGE_CUR_DBG 6 /* As PAGE_CUR_LE, but skips search shortcut */
00054 #endif /* UNIV_SEARCH_DEBUG */
00055 
00056 #ifdef UNIV_DEBUG
00057 /*********************************************************/
00060 UNIV_INLINE
00061 page_t*
00062 page_cur_get_page(
00063 /*==============*/
00064   page_cur_t* cur); 
00065 /*********************************************************/
00068 UNIV_INLINE
00069 buf_block_t*
00070 page_cur_get_block(
00071 /*===============*/
00072   page_cur_t* cur); 
00073 /*********************************************************/
00076 UNIV_INLINE
00077 page_zip_des_t*
00078 page_cur_get_page_zip(
00079 /*==================*/
00080   page_cur_t* cur); 
00081 /*********************************************************/
00084 UNIV_INLINE
00085 rec_t*
00086 page_cur_get_rec(
00087 /*=============*/
00088   page_cur_t* cur); 
00089 #else /* UNIV_DEBUG */
00090 # define page_cur_get_page(cur)   page_align((cur)->rec)
00091 # define page_cur_get_block(cur)  (cur)->block
00092 # define page_cur_get_page_zip(cur) buf_block_get_page_zip((cur)->block)
00093 # define page_cur_get_rec(cur)    (cur)->rec
00094 #endif /* UNIV_DEBUG */
00095 /*********************************************************/
00098 UNIV_INLINE
00099 void
00100 page_cur_set_before_first(
00101 /*======================*/
00102   const buf_block_t*  block,  
00103   page_cur_t*   cur); 
00104 /*********************************************************/
00107 UNIV_INLINE
00108 void
00109 page_cur_set_after_last(
00110 /*====================*/
00111   const buf_block_t*  block,  
00112   page_cur_t*   cur); 
00113 /*********************************************************/
00116 UNIV_INLINE
00117 ibool
00118 page_cur_is_before_first(
00119 /*=====================*/
00120   const page_cur_t* cur); 
00121 /*********************************************************/
00124 UNIV_INLINE
00125 ibool
00126 page_cur_is_after_last(
00127 /*===================*/
00128   const page_cur_t* cur); 
00129 /**********************************************************/
00131 UNIV_INLINE
00132 void
00133 page_cur_position(
00134 /*==============*/
00135   const rec_t*    rec,  
00136   const buf_block_t*  block,  
00138   page_cur_t*   cur); 
00139 /**********************************************************/
00141 UNIV_INLINE
00142 void
00143 page_cur_invalidate(
00144 /*================*/
00145   page_cur_t* cur); 
00146 /**********************************************************/
00148 UNIV_INLINE
00149 void
00150 page_cur_move_to_next(
00151 /*==================*/
00152   page_cur_t* cur); 
00153 /**********************************************************/
00155 UNIV_INLINE
00156 void
00157 page_cur_move_to_prev(
00158 /*==================*/
00159   page_cur_t* cur); 
00160 #ifndef UNIV_HOTBACKUP
00161 /***********************************************************/
00167 UNIV_INLINE
00168 rec_t*
00169 page_cur_tuple_insert(
00170 /*==================*/
00171   page_cur_t* cursor, 
00172   const dtuple_t* tuple,  
00173   dict_index_t* index,  
00174   ulint   n_ext,  
00175   mtr_t*    mtr); 
00176 #endif /* !UNIV_HOTBACKUP */
00177 /***********************************************************/
00183 UNIV_INLINE
00184 rec_t*
00185 page_cur_rec_insert(
00186 /*================*/
00187   page_cur_t* cursor, 
00188   const rec_t*  rec,  
00189   dict_index_t* index,  
00190   ulint*    offsets,
00191   mtr_t*    mtr); 
00192 /***********************************************************/
00197 UNIV_INTERN
00198 rec_t*
00199 page_cur_insert_rec_low(
00200 /*====================*/
00201   rec_t*    current_rec,
00203   dict_index_t* index,  
00204   const rec_t*  rec,  
00205   ulint*    offsets,
00206   mtr_t*    mtr); 
00207 /***********************************************************/
00213 UNIV_INTERN
00214 rec_t*
00215 page_cur_insert_rec_zip(
00216 /*====================*/
00217   rec_t**   current_rec,
00219   buf_block_t*  block,  
00220   dict_index_t* index,  
00221   const rec_t*  rec,  
00222   ulint*    offsets,
00223   mtr_t*    mtr); 
00224 /*************************************************************/
00227 UNIV_INTERN
00228 void
00229 page_copy_rec_list_end_to_created_page(
00230 /*===================================*/
00231   page_t*   new_page, 
00232   rec_t*    rec,    
00233   dict_index_t* index,    
00234   mtr_t*    mtr);   
00235 /***********************************************************/
00238 UNIV_INTERN
00239 void
00240 page_cur_delete_rec(
00241 /*================*/
00242   page_cur_t* cursor, 
00243   dict_index_t* index,  
00244   const ulint*  offsets,
00245   mtr_t*    mtr); 
00246 #ifndef UNIV_HOTBACKUP
00247 /****************************************************************/
00250 UNIV_INLINE
00251 ulint
00252 page_cur_search(
00253 /*============*/
00254   const buf_block_t*  block,  
00255   const dict_index_t* index,  
00256   const dtuple_t*   tuple,  
00257   ulint     mode, 
00260   page_cur_t*   cursor);
00261 /****************************************************************/
00263 UNIV_INTERN
00264 void
00265 page_cur_search_with_match(
00266 /*=======================*/
00267   const buf_block_t*  block,  
00268   const dict_index_t* index,  
00269   const dtuple_t*   tuple,  
00270   ulint     mode, 
00273   ulint*      iup_matched_fields,
00276   ulint*      iup_matched_bytes,
00280   ulint*      ilow_matched_fields,
00283   ulint*      ilow_matched_bytes,
00287   page_cur_t*   cursor);
00288 /***********************************************************/
00291 UNIV_INTERN
00292 void
00293 page_cur_open_on_rnd_user_rec(
00294 /*==========================*/
00295   buf_block_t*  block,  
00296   page_cur_t* cursor);
00297 #endif /* !UNIV_HOTBACKUP */
00298 /***********************************************************/
00301 UNIV_INTERN
00302 byte*
00303 page_cur_parse_insert_rec(
00304 /*======================*/
00305   ibool   is_short,
00306   byte*   ptr,  
00307   byte*   end_ptr,
00308   buf_block_t*  block,  
00309   dict_index_t* index,  
00310   mtr_t*    mtr); 
00311 /**********************************************************/
00314 UNIV_INTERN
00315 byte*
00316 page_parse_copy_rec_list_to_created_page(
00317 /*=====================================*/
00318   byte*   ptr,  
00319   byte*   end_ptr,
00320   buf_block_t*  block,  
00321   dict_index_t* index,  
00322   mtr_t*    mtr); 
00323 /***********************************************************/
00326 UNIV_INTERN
00327 byte*
00328 page_cur_parse_delete_rec(
00329 /*======================*/
00330   byte*   ptr,  
00331   byte*   end_ptr,
00332   buf_block_t*  block,  
00333   dict_index_t* index,  
00334   mtr_t*    mtr); 
00338 struct page_cur_struct{
00339   byte*   rec;  
00340   buf_block_t*  block;  
00341 };
00342 
00343 #ifndef UNIV_NONINL
00344 #include "page0cur.ic"
00345 #endif
00346 
00347 #endif