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

📄 btr0pcur.ic

📁 这是linux下运行的mysql软件包,可用于linux 下安装 php + mysql + apach 的网络配置
💻 IC
📖 第 1 页 / 共 2 页
字号:
/******************************************************The index tree persistent cursor(c) 1996 Innobase OyCreated 2/23/1996 Heikki Tuuri*******************************************************//*************************************************************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 */{	ut_ad(cursor);	ut_ad(cursor->old_rec);	ut_ad(cursor->old_stored == BTR_PCUR_OLD_STORED);	ut_ad(cursor->pos_state == BTR_PCUR_WAS_POSITIONED			|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);	return(cursor->rel_pos);}/*************************************************************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 */{	ut_ad(cursor);	cursor->mtr = mtr;}/*************************************************************Gets the mtr field for a pcur. */UNIV_INLINEmtr_t*btr_pcur_get_mtr(/*=============*/				/* out: mtr */	btr_pcur_t*	cursor)	/* in: persistent cursor */{	ut_ad(cursor);	return(cursor->mtr);}/*************************************************************Returns the btr cursor component of a persistent cursor. */UNIV_INLINEbtr_cur_t*btr_pcur_get_btr_cur(/*=================*/				/* out: pointer to btr cursor component */	btr_pcur_t*	cursor)	/* in: persistent cursor */{	return(&(cursor->btr_cur));}/*************************************************************Returns the page cursor component of a persistent cursor. */UNIV_INLINEpage_cur_t*btr_pcur_get_page_cur(/*==================*/				/* out: pointer to page cursor component */	btr_pcur_t*	cursor)	/* in: persistent cursor */{	return(btr_cur_get_page_cur(&(cursor->btr_cur)));}/*************************************************************Returns the page of a persistent cursor. */UNIV_INLINEpage_t*btr_pcur_get_page(/*==============*/				/* out: pointer to the page */	btr_pcur_t*	cursor)	/* in: persistent cursor */{	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	return(page_cur_get_page(btr_pcur_get_page_cur(cursor)));}/*************************************************************Returns the record of a persistent cursor. */UNIV_INLINErec_t*btr_pcur_get_rec(/*=============*/				/* out: pointer to the record */	btr_pcur_t*	cursor)	/* in: persistent cursor */{	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		return(page_cur_get_rec(btr_pcur_get_page_cur(cursor)));}/******************************************************************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 */{	btr_cur_t*	btr_cursor;	ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED)			|| (cursor->pos_state == BTR_PCUR_IS_POSITIONED));	btr_cursor = btr_pcur_get_btr_cur(cursor);	ut_ad(btr_cursor->up_match != ULINT_UNDEFINED);	return(btr_cursor->up_match);}/******************************************************************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 */{	btr_cur_t*	btr_cursor;	ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED)			|| (cursor->pos_state == BTR_PCUR_IS_POSITIONED));	btr_cursor = btr_pcur_get_btr_cur(cursor);	ut_ad(btr_cursor->low_match != ULINT_UNDEFINED);	return(btr_cursor->low_match);}/*************************************************************Checks if the persistent cursor is after the last user record on a page. */UNIV_INLINEiboolbtr_pcur_is_after_last_on_page(/*===========================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	UT_NOT_USED(mtr);	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor)));}/*************************************************************Checks if the persistent cursor is before the first user record on a page. */UNIV_INLINEiboolbtr_pcur_is_before_first_on_page(/*=============================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	UT_NOT_USED(mtr);	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		return(page_cur_is_before_first(btr_pcur_get_page_cur(cursor)));}/*************************************************************Checks if the persistent cursor is on a user record. */UNIV_INLINEiboolbtr_pcur_is_on_user_rec(/*====================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		if ((btr_pcur_is_before_first_on_page(cursor, mtr))	    || (btr_pcur_is_after_last_on_page(cursor, mtr))) {		return(FALSE);	}	return(TRUE);}/*************************************************************Checks if the persistent cursor is before the first user record inthe index tree. */UNIV_INLINEiboolbtr_pcur_is_before_first_in_tree(/*=============================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		if (btr_page_get_prev(btr_pcur_get_page(cursor), mtr) != FIL_NULL) {		return(FALSE);	}	return(page_cur_is_before_first(btr_pcur_get_page_cur(cursor)));}/*************************************************************Checks if the persistent cursor is after the last user record inthe index tree. */UNIV_INLINEiboolbtr_pcur_is_after_last_in_tree(/*===========================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		if (btr_page_get_next(btr_pcur_get_page(cursor), mtr) != FIL_NULL) {		return(FALSE);	}	return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor)));}/*************************************************************Moves the persistent cursor to the next record on the same page. */UNIV_INLINEvoidbtr_pcur_move_to_next_on_page(/*==========================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	UT_NOT_USED(mtr);	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		page_cur_move_to_next(btr_pcur_get_page_cur(cursor));	cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;}/*************************************************************Moves the persistent cursor to the previous record on the same page. */UNIV_INLINEvoidbtr_pcur_move_to_prev_on_page(/*==========================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	UT_NOT_USED(mtr);	ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		page_cur_move_to_prev(btr_pcur_get_page_cur(cursor));	cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;}/*************************************************************Moves the persistent cursor to the last record on the same page. */UNIV_INLINEvoidbtr_pcur_move_to_last_on_page(/*==========================*/	btr_pcur_t*	cursor,	/* in: persistent cursor */	mtr_t*		mtr)	/* in: mtr */{	UT_NOT_USED(mtr);	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);		page_cur_set_after_last(buf_frame_align(btr_pcur_get_rec(cursor)),				btr_pcur_get_page_cur(cursor));	cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;}/*************************************************************Moves the persistent cursor to the next user record in the tree. If no userrecords are left, the cursor ends up 'after last in tree'. */UNIV_INLINEiboolbtr_pcur_move_to_next_user_rec(/*===========================*/				/* out: TRUE if the cursor moved forward,				ending on a user record */	btr_pcur_t*	cursor,	/* in: persistent cursor; NOTE that the				function may release the page latch */	mtr_t*		mtr)	/* in: mtr */

⌨️ 快捷键说明

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