/** Set next page@param[in]next_page_nonext page no */

void PageBulk::setNext(page_no_t next_page_no) {

btr_page_set_next(m_page, nullptr, next_page_no, m_mtr);

}

/** Set previous page@param[in]prev_page_noprevious page no */

void PageBulk::setPrev(page_no_t prev_page_no) {

btr_page_set_prev(m_page, nullptr, prev_page_no, m_mtr);

}

双向

/** Sets the previous index page field. */

UNIV_INLINE

void btr_page_set_prev(

page_t *page, /*!< in: index page */

page_zip_des_t *page_zip, /*!< in: compressed page whose uncompressed

part will be updated, or NULL */

page_no_t prev, /*!< in: previous page number */

mtr_t *mtr) /*!< in: mini-transaction handle */

{

ut_ad(page != NULL);

ut_ad(mtr != NULL);

if (page_zip) {

mach_write_to_4(page + FIL_PAGE_PREV, prev);

page_zip_write_header(page_zip, page + FIL_PAGE_PREV, 4, mtr);

} else {

mlog_write_ulint(page + FIL_PAGE_PREV, prev, MLOG_4BYTES, mtr);

}

}

/** Sets the next index page field. */

UNIV_INLINE

void btr_page_set_next(

page_t *page, /*!< in: index page */

page_zip_des_t *page_zip, /*!< in: compressed page whose uncompressed

part will be updated, or NULL */

page_no_t next, /*!< in: next page number */

mtr_t *mtr) /*!< in: mini-transaction handle */

{

ut_ad(page != NULL);

ut_ad(mtr != NULL);

if (page_zip) {

mach_write_to_4(page + FIL_PAGE_NEXT, next);

page_zip_write_header(page_zip, page + FIL_PAGE_NEXT, 4, mtr);

} else {

mlog_write_ulint(page + FIL_PAGE_NEXT, next, MLOG_4BYTES, mtr);

}

}

双向更新

/** if there is a 'natural' predecessor of the page, its offset.

Otherwise FIL_NULL. This field is not set on BLOB pages, which are stored as a

singly-linked list. See also FIL_PAGE_NEXT. */

#define FIL_PAGE_PREV 8

/** On page 0 of the tablespace, this is the server version ID */

#define FIL_PAGE_SRV_VERSION 8

/** if there is a 'natural' successor of the page, its offset. Otherwise

FIL_NULL. B-tree index pages(FIL_PAGE_TYPE contains FIL_PAGE_INDEX) on the

same PAGE_LEVEL are maintained as a doubly linked list via FIL_PAGE_PREV and

FIL_PAGE_NEXT in the collation order of the smallest user record on each

page. */

#define FIL_PAGE_NEXT 12

注意:This field is not set on BLOB pages, which are stored as a singly-linked list. See also FIL_PAGE_NEXT. */

也就是BLOB页是单向的,

页:

数据页

Undo页

系统页

事务数据页

插入缓冲位图页

未压缩二进制大对象页

压缩二进制大对象页

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐