⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 btr0pcur.h

📁 这是linux下运行的mysql软件包,可用于linux 下安装 php + mysql + apach 的网络配置
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************The index tree persistent cursor(c) 1996 Innobase OyCreated 2/23/1996 Heikki Tuuri*******************************************************/#ifndef btr0pcur_h#define btr0pcur_h#include "univ.i"#include "dict0dict.h"#include "data0data.h"#include "mtr0mtr.h"#include "page0cur.h"#include "btr0cur.h"#include "btr0btr.h"#include "btr0types.h"/* Relative positions for a stored cursor position */#define BTR_PCUR_ON			1#define BTR_PCUR_BEFORE			2#define BTR_PCUR_AFTER			3/* Note that if the tree is not empty, btr_pcur_store_position does notuse the following, but only uses the above three alternatives, where theposition is stored relative to a specific record: this makes implementationof a scroll cursor easier */#define BTR_PCUR_BEFORE_FIRST_IN_TREE	4	/* in an empty tree */#define BTR_PCUR_AFTER_LAST_IN_TREE	5	/* in an empty tree *//******************************************************************Allocates memory for a persistent cursor object and initializes the cursor. */btr_pcur_t*btr_pcur_create_for_mysql(void);/*============================*/				/* out, own: persistent cursor *//******************************************************************Frees the memory for a persistent cursor object. */voidbtr_pcur_free_for_mysql(/*====================*/	btr_pcur_t*	cursor);	/* in, own: persistent cursor *//******************************************************************Copies the stored position of a pcur to another pcur. */voidbtr_pcur_copy_stored_position(/*==========================*/	btr_pcur_t*	pcur_receive,	/* in: pcur which will receive the					position info */	btr_pcur_t*	pcur_donate);	/* in: pcur from which the info is					copied *//******************************************************************Sets the old_rec_buf field to NULL. */UNIV_INLINEvoidbtr_pcur_init(/*==========*/	btr_pcur_t*	pcur);	/* in: persistent cursor *//******************************************************************Initializes and opens a persistent cursor to an index tree. It should beclosed with btr_pcur_close. */UNIV_INLINEvoidbtr_pcur_open(/*==========*/	dict_index_t*	index,	/* in: index */	dtuple_t*	tuple,	/* in: tuple on which search done */	ulint		mode,	/* in: PAGE_CUR_L, ...;				NOTE that if the search is made using a unique				prefix of a record, mode should be				PAGE_CUR_LE, not PAGE_CUR_GE, as the latter				may end up on the previous page from the				record! */	ulint		latch_mode,/* in: BTR_SEARCH_LEAF, ... */	btr_pcur_t*	cursor, /* in: memory buffer for persistent cursor */	mtr_t*		mtr);	/* in: mtr *//******************************************************************Opens an persistent cursor to an index tree without initializing thecursor. */UNIV_INLINEvoidbtr_pcur_open_with_no_init(/*=======================*/	dict_index_t*	index,	/* in: index */	dtuple_t*	tuple,	/* in: tuple on which search done */	ulint		mode,	/* in: PAGE_CUR_L, ...;				NOTE that if the search is made using a unique				prefix of a record, mode should be				PAGE_CUR_LE, not PAGE_CUR_GE, as the latter				may end up on the previous page of the				record! */	ulint		latch_mode,/* in: BTR_SEARCH_LEAF, ...;				NOTE that if has_search_latch != 0 then				we maybe do not acquire a latch on the cursor				page, but assume that the caller uses his				btr search latch to protect the record! */	btr_pcur_t*	cursor, /* in: memory buffer for persistent cursor */	ulint		has_search_latch,/* in: latch mode the caller				currently has on btr_search_latch:				RW_S_LATCH, or 0 */	mtr_t*		mtr);	/* in: mtr *//*********************************************************************Opens a persistent cursor at either end of an index. */UNIV_INLINEvoidbtr_pcur_open_at_index_side(/*========================*/	ibool		from_left,	/* in: TRUE if open to the low end,					FALSE if to the high end */	dict_index_t*	index,		/* in: index */	ulint		latch_mode,	/* in: latch mode */	btr_pcur_t*	pcur,		/* in: cursor */	ibool		do_init,	/* in: TRUE if should be initialized */	mtr_t*		mtr);		/* in: mtr *//******************************************************************Gets the up_match value for a pcur after a search. */UNIV_INLINEulintbtr_pcur_get_up_match(/*==================*/				/* out: number of matched fields at the cursor				or to the right if search mode was PAGE_CUR_GE,				otherwise undefined */	btr_pcur_t*	cursor); /* in: memory buffer for persistent cursor *//******************************************************************Gets the low_match value for a pcur after a search. */UNIV_INLINEulintbtr_pcur_get_low_match(/*===================*/				/* out: number of matched fields at the cursor				or to the right if search mode was PAGE_CUR_LE,				otherwise undefined */	btr_pcur_t*	cursor); /* in: memory buffer for persistent cursor *//******************************************************************If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the firstuser record satisfying the search condition, in the case PAGE_CUR_L orPAGE_CUR_LE, on the last user record. If no such user record exists, thenin the first case sets the cursor after last in tree, and in the latter casebefore first in tree. The latching mode must be BTR_SEARCH_LEAF orBTR_MODIFY_LEAF. */voidbtr_pcur_open_on_user_rec(/*======================*/	dict_index_t*	index,		/* in: index */	dtuple_t*	tuple,		/* in: tuple on which search done */	ulint		mode,		/* in: PAGE_CUR_L, ... */	ulint		latch_mode,	/* in: BTR_SEARCH_LEAF or					BTR_MODIFY_LEAF */	btr_pcur_t*	cursor, 	/* in: memory buffer for persistent					cursor */	mtr_t*		mtr);		/* in: mtr *//**************************************************************************Positions a cursor at a randomly chosen position within a B-tree. */UNIV_INLINEvoidbtr_pcur_open_at_rnd_pos(/*=====================*/	dict_index_t*	index,		/* in: index */	ulint		latch_mode,	/* in: BTR_SEARCH_LEAF, ... */	btr_pcur_t*	cursor,		/* in/out: B-tree pcur */	mtr_t*		mtr);		/* in: mtr *//******************************************************************Frees the possible old_rec_buf buffer of a persistent cursor and sets thelatch mode of the persistent cursor to BTR_NO_LATCHES. */UNIV_INLINEvoidbtr_pcur_close(/*===========*/	btr_pcur_t*	cursor);	/* in: persistent cursor *//******************************************************************The position of the cursor is stored by taking an initial segment of therecord the cursor is positioned on, before, or after, and copying it to thecursor data structure, or just setting a flag if the cursor id before thefirst in an EMPTY tree, or after the last in an EMPTY tree. NOTE that thepage where the cursor is positioned must not be empty if the index tree isnot totally empty! */voidbtr_pcur_store_position(/*====================*/	btr_pcur_t*	cursor, /* in: persistent cursor */	mtr_t*		mtr);	/* in: mtr *//******************************************************************Restores the stored position of a persistent cursor bufferfixing the page andobtaining the specified latches. If the cursor position was saved when the(1) cursor was positioned on a user record: this function restores the positionto the last record LESS OR EQUAL to the stored record;(2) cursor was positioned on a page infimum record: restores the position tothe last record LESS than the user record which was the successor of the pageinfimum;(3) cursor was positioned on the page supremum: restores to the first recordGREATER than the user record which was the predecessor of the supremum.(4) cursor was positioned before the first or after the last in an empty tree:restores to before first or after the last in the tree. */iboolbtr_pcur_restore_position(/*======================*/					/* out: TRUE if the cursor position					was stored when it was on a user record					and it can be restored on a user record					whose ordering fields are identical to					the ones of the original user record */	ulint		latch_mode,	/* in: BTR_SEARCH_LEAF, ... */	btr_pcur_t*	cursor, 	/* in: detached persistent cursor */	mtr_t*		mtr);		/* in: mtr *//******************************************************************If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,releases the page latch and bufferfix reserved by the cursor.NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changesmade by the current mini-transaction to the data protected by thecursor latch, as then the latch must not be released until mtr_commit. */voidbtr_pcur_release_leaf(/*==================*/	btr_pcur_t*	cursor, /* in: persistent cursor */	mtr_t*		mtr);	/* in: mtr *//*************************************************************Gets the rel_pos field for a cursor whose position has been stored. */UNIV_INLINEulintbtr_pcur_get_rel_pos(/*=================*/				/* out: BTR_PCUR_ON, ... */	btr_pcur_t*	cursor);/* in: persistent cursor *//*************************************************************Sets the mtr field for a pcur. */UNIV_INLINEvoidbtr_pcur_set_mtr(/*=============*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr);	/* in, own: mtr *//*************************************************************Gets the mtr field for a pcur. */UNIV_INLINEmtr_t*btr_pcur_get_mtr(/*=============*/				/* out: mtr */	btr_pcur_t*	cursor);	/* in: persistent cursor *//******************************************************************Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,that is, the cursor becomes detached. If there have been modificationsto the page where pcur is positioned, this can be used instead ofbtr_pcur_release_leaf. Function btr_pcur_store_position should be usedbefore calling this, if restoration of cursor is wanted later. */UNIV_INLINEvoidbtr_pcur_commit(/*============*/	btr_pcur_t*	pcur);	/* in: persistent cursor */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -