/** Persistent cursor */
typedef struct btr_pcur_struct        btr_pcur_t;

/* The persistent B-tree cursor structure. This is used mainly for SQL
selects, updates, and deletes. */

struct btr_pcur_struct{
    btr_cur_t    btr_cur;    /*!< a B-tree cursor */
    ulint        latch_mode;    /*!< see TODO note below!
                    BTR_SEARCH_LEAF, BTR_MODIFY_LEAF,
                    BTR_MODIFY_TREE, or BTR_NO_LATCHES,
                    depending on the latching state of
                    the page and tree where the cursor is
                    positioned; the last value means that
                    the cursor is not currently positioned:
                    we say then that the cursor is
                    detached; it can be restored to
                    attached if the old position was
                    stored in old_rec */
    ulint        old_stored;    /*!< BTR_PCUR_OLD_STORED
                    or BTR_PCUR_OLD_NOT_STORED */
    rec_t*        old_rec;    /*!< if cursor position is stored,
                    contains an initial segment of the
                    latest record cursor was positioned
                    either on, before, or after */
    ulint        old_n_fields;    /*!< number of fields in old_rec */
    ulint        rel_pos;    /*!< BTR_PCUR_ON, BTR_PCUR_BEFORE, or
                    BTR_PCUR_AFTER, depending on whether
                    cursor was on, before, or after the
                    old_rec record */
    buf_block_t*    block_when_stored;/* buffer block when the position was
                    stored */
    ib_uint64_t    modify_clock;    /*!< the modify clock value of the
                    buffer block when the cursor position
                    was stored */
    enum pcur_pos_t    pos_state;    /*!< btr_pcur_store_position() and
                    btr_pcur_restore_position() state. */
    ulint        search_mode;    /*!< PAGE_CUR_G, ... */
    trx_t*        trx_if_known;    /*!< the transaction, if we know it;
                    otherwise this field is not defined;
                    can ONLY BE USED in error prints in
                    fatal assertion failures! */
    /*-----------------------------*/
    /* NOTE that the following fields may possess dynamically allocated
    memory which should be freed if not needed anymore! */

    byte*        old_rec_buf;    /*!< NULL, or a dynamically allocated
                    buffer for old_rec */
    ulint        buf_size;    /*!< old_rec_buf size if old_rec_buf
                    is not NULL */
};

btr_pcur_t的更多相关文章

  1. 宏btr_pcur_open_on_user_rec

    参考http://wqtn22.iteye.com/blog/1820436 http://blog.jcole.us/2013/01/10/btree-index-structures-in-inn ...

  2. 结构体 row_prebuilt_t

    typedef struct row_prebuilt_struct row_prebuilt_t; /** A struct for (sometimes lazily) prebuilt stru ...

  3. 源码浅析:InnoDB聚集索引如何定位到数据的物理位置,并从磁盘读取

    索引结构概述: MyISAM索引文件和数据文件是分离的,索引文件仅保存数据记录的地址.这与Oracle的索引结构相似,比较好理解.那么,常用的Innodb聚集索引结构是怎样的呢? InnoDB的数据文 ...

  4. MySQL Update执行流程解读

    GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 一.update跟踪执行配置 使用内部程序堆栈跟踪工具path_viewer,跟踪mysql update 一行数据的执行 ...

随机推荐

  1. VBS基础篇 - RegExp 对象

    正则表达式(RegExp)对象下面的代码说明了RegExp对象的用法: Function RegExpTest(patrn, strng) Dim regEx, Match, Matches '创建变 ...

  2. DB天气app冲刺二阶段第十天

    昨天困到不行了 所以就写了那么几句..所以今天好好写写了要.. 今天的收获了一个很重要的问题 就还是api接口的事情,以前的那个接口虽然能用但是总是不稳定,今天由决定百度的一下然后就发现了一个很好用的 ...

  3. 高质量的javascript代码 -- 深入理解Javascript

    一. 编写高质量的javascript代码基本要点a) 可维护的代码(Writing Maintainable Code)i. 可读(注释)ii. 一致(看上去是同一个人写的)iii. 已记录b) 最 ...

  4. html利用锚点实现定位代码实例

    本章节介绍介绍一下如何利用锚点实现定位,使用锚点实现定位是html固有的功能,当然比较简单,也实现了基本的功能,但是功能相对简单一些,如果想要实现平滑的定位可以参阅jquery实现的点击页面动画方式平 ...

  5. windows下编译Libevent

    下载最新的libevent,目前是 libevent-2.0.21-stable.tar.gz 修改“D:\libevent-2.0.21-stable\event_iocp.c”.“D:\libev ...

  6. 浅谈Feature Scaling

    浅谈Feature Scaling 定义:Feature scaling is a method used to standardize the range of independent variab ...

  7. <%@page include%>、<%@include%>、<jsp:include>三者之间的本质区别

    <%@page include%>.<%@include%>.<jsp:include>三者之间的本质区别 先从它的几个内置对象说起. application和se ...

  8. XML注入介绍--XXE,XEE,xpath等

    XML注入指在请求的XML中插入攻击利用代码.根据不同的场景,可能会形成以下的漏洞形式: (1)XEE ----xml entity xpansion(xml实体膨胀,用于dos) 具体介绍:http ...

  9. What are Scopes?

    scope is an object that refers to the application model. It is an execution context for expressions. ...

  10. What is Object Oriented Design? (OOD)

    Object Oriented Design is the concept that forces programmers to plan out their code in order to hav ...