InnoDB Plugin  1.0
Macros | Functions
btr0btr.ic File Reference
#include "mach0data.h"
#include "mtr0mtr.h"
#include "mtr0log.h"
#include "page0zip.h"
Include dependency graph for btr0btr.ic:
This graph shows which files directly or indirectly include this file:

Macros

#define BTR_MAX_NODE_LEVEL   50

Functions

UNIV_INLINE buf_block_tbtr_block_get_func (ulint space, ulint zip_size, ulint page_no, ulint mode, const char *file, ulint line, const dict_index_t *index, mtr_t *mtr)
UNIV_INLINE void btr_page_set_index_id (page_t *page, page_zip_des_t *page_zip, index_id_t id, mtr_t *mtr)
UNIV_INLINE index_id_t btr_page_get_index_id (const page_t *page)
UNIV_INLINE ulint btr_page_get_level_low (const page_t *page)
UNIV_INLINE void btr_page_set_level (page_t *page, page_zip_des_t *page_zip, ulint level, mtr_t *mtr)
UNIV_INLINE ulint btr_page_get_next (const page_t *page, mtr_t *mtr))
UNIV_INLINE void btr_page_set_next (page_t *page, page_zip_des_t *page_zip, ulint next, mtr_t *mtr)
UNIV_INLINE ulint btr_page_get_prev (const page_t *page, mtr_t *mtr))
UNIV_INLINE void btr_page_set_prev (page_t *page, page_zip_des_t *page_zip, ulint prev, mtr_t *mtr)
UNIV_INLINE ulint btr_node_ptr_get_child_page_no (const rec_t *rec, const ulint *offsets)
UNIV_INLINE void btr_leaf_page_release (buf_block_t *block, ulint latch_mode, mtr_t *mtr)

Detailed Description

The B-tree

Created 6/2/1994 Heikki Tuuri

Macro Definition Documentation

#define BTR_MAX_NODE_LEVEL   50

Maximum B-tree page level (not really a hard limit). Used in debug assertions in btr_page_set_level and btr_page_get_level_low

Function Documentation

UNIV_INLINE buf_block_t* btr_block_get_func ( ulint  space,
ulint  zip_size,
ulint  page_no,
ulint  mode,
const char *  file,
ulint  line,
const dict_index_t index,
mtr_t mtr 
)

Gets a buffer page and declares its latching order level.

Parameters
spacein: space id
zip_sizein: compressed page size in bytes or 0 for uncompressed pages
page_noin: page number
modein: latch mode
filein: file name
linein: line where called
indexin: index tree, may be NULL if it is not an insert buffer tree
mtrin/out: mtr
UNIV_INLINE void btr_leaf_page_release ( buf_block_t block,
ulint  latch_mode,
mtr_t mtr 
)

Releases the latches on a leaf page and bufferunfixes it.

Parameters
blockin: buffer block
latch_modein: BTR_SEARCH_LEAF or BTR_MODIFY_LEAF
mtrin: mtr
UNIV_INLINE ulint btr_node_ptr_get_child_page_no ( const rec_t *  rec,
const ulint *  offsets 
)

Gets the child node file address in a node pointer. NOTE: the offsets array must contain all offsets for the record since we read the last field according to offsets and assume that it contains the child page number. In other words offsets must have been retrieved with rec_get_offsets(n_fields=ULINT_UNDEFINED).

Returns
child node address
Parameters
recin: node pointer record
offsetsin: array returned by rec_get_offsets()
UNIV_INLINE index_id_t btr_page_get_index_id ( const page_t page)

Gets the index id field of a page.

Returns
index id
Parameters
pagein: index page
UNIV_INLINE ulint btr_page_get_level_low ( const page_t page)

Gets the node level field in an index page.

Returns
level, leaf level == 0
Parameters
pagein: index page
UNIV_INLINE ulint btr_page_get_next ( const page_t page,
mtr_t mtr 
)

Gets the next index page number.

Returns
next page number

< in: mini-transaction handle

Parameters
pagein: index page
mtrin: mini-transaction handle
UNIV_INLINE ulint btr_page_get_prev ( const page_t page,
mtr_t mtr 
)

Gets the previous index page number.

Returns
prev page number

< in: mini-transaction handle

Parameters
pagein: index page
mtrin: mini-transaction handle
UNIV_INLINE void btr_page_set_index_id ( page_t page,
page_zip_des_t page_zip,
index_id_t  id,
mtr_t mtr 
)

Sets the index id field of a page.

Parameters
pagein: page to be created
page_zipin: compressed page whose uncompressed part will be updated, or NULL
idin: index id
mtrin: mtr
UNIV_INLINE void btr_page_set_level ( page_t page,
page_zip_des_t page_zip,
ulint  level,
mtr_t mtr 
)

Sets the node level field in an index page.

Parameters
pagein: index page
page_zipin: compressed page whose uncompressed part will be updated, or NULL
levelin: level, leaf level == 0
mtrin: mini-transaction handle
UNIV_INLINE void btr_page_set_next ( page_t page,
page_zip_des_t page_zip,
ulint  next,
mtr_t mtr 
)

Sets the next index page field.

Parameters
pagein: index page
page_zipin: compressed page whose uncompressed part will be updated, or NULL
nextin: next page number
mtrin: mini-transaction handle
UNIV_INLINE void btr_page_set_prev ( page_t page,
page_zip_des_t page_zip,
ulint  prev,
mtr_t mtr 
)

Sets the previous index page field.

Parameters
pagein: index page
page_zipin: compressed page whose uncompressed part will be updated, or NULL
previn: previous page number
mtrin: mini-transaction handle