typedef struct row_prebuilt_struct row_prebuilt_t;

/** A struct for (sometimes lazily) prebuilt structures in an Innobase table
handle used within MySQL; these are used to save CPU time. */

struct row_prebuilt_struct {
    ulint        magic_n;    /*!< this magic number is set to
                    ROW_PREBUILT_ALLOCATED when created,
                    or ROW_PREBUILT_FREED when the
                    struct has been freed */
    dict_table_t*    table;        /*!< Innobase table handle */
    dict_index_t*    index;        /*!< current index for a search, if
                    any */
    trx_t*        trx;        /*!< current transaction handle */
    unsigned    sql_stat_start:;/*!< TRUE when we start processing of
                    an SQL statement: we may have to set
                    an intention lock on the table,
                    create a consistent read view etc. */
    unsigned    mysql_has_locked:;/*!< this is set TRUE when MySQL
                    calls external_lock on this handle
                    with a lock flag, and set FALSE when
                    with the F_UNLOCK flag */
    unsigned    clust_index_was_generated:;
                    /*!< if the user did not define a
                    primary key in MySQL, then Innobase
                    automatically generated a clustered
                    index where the ordering column is
                    the row id: in this case this flag
                    is set to TRUE */
    unsigned    index_usable:;    /*!< caches the value of
                    row_merge_is_index_usable(trx,index) */
    unsigned    read_just_key:;/*!< set to 1 when MySQL calls
                    ha_innobase::extra with the
                    argument HA_EXTRA_KEYREAD; it is enough
                    to read just columns defined in
                    the index (i.e., no read of the
                    clustered index record necessary) */
    unsigned    used_in_HANDLER:;/*!< TRUE if we have been using this
                    handle in a MySQL HANDLER low level
                    index cursor command: then we must
                    store the pcur position even in a
                    unique search from a clustered index,
                    because HANDLER allows NEXT and PREV
                    in such a situation */
    unsigned    template_type:;/*!< ROW_MYSQL_WHOLE_ROW,
                    ROW_MYSQL_REC_FIELDS,
                    ROW_MYSQL_DUMMY_TEMPLATE, or
                    ROW_MYSQL_NO_TEMPLATE */
    unsigned    n_template:;    /*!< number of elements in the
                    template */
    unsigned    null_bitmap_len:;/*!< number of bytes in the SQL NULL
                    bitmap at the start of a row in the
                    MySQL format */
    unsigned    need_to_access_clustered:; /*!< if we are fetching
                    columns through a secondary index
                    and at least one column is not in
                    the secondary index, then this is
                    set to TRUE */
    unsigned    templ_contains_blob:;/*!< TRUE if the template contains
                    a column with DATA_BLOB ==
                    get_innobase_type_from_mysql_type();
                    not to be confused with InnoDB
                    externally stored columns
                    (VARCHAR can be off-page too) */
    mysql_row_templ_t* mysql_template;/*!< template used to transform
                    rows fast between MySQL and Innobase
                    formats; memory for this template
                    is not allocated from 'heap' */
    mem_heap_t*    heap;        /*!< memory heap from which
                    these auxiliary structures are
                    allocated when needed */
    ins_node_t*    ins_node;    /*!< Innobase SQL insert node
                    used to perform inserts
                    to the table */
    byte*        ins_upd_rec_buff;/*!< buffer for storing data converted
                    to the Innobase format from the MySQL
                    format */
    const byte*    default_rec;    /*!< the default values of all columns
                    (a "default row") in MySQL format */
    ulint        hint_need_to_fetch_extra_cols;
                    /*!< normally this is set to 0; if this
                    is set to ROW_RETRIEVE_PRIMARY_KEY,
                    then we should at least retrieve all
                    columns in the primary key; if this
                    is set to ROW_RETRIEVE_ALL_COLS, then
                    we must retrieve all columns in the
                    key (if read_just_key == 1), or all
                    columns in the table */
    upd_node_t*    upd_node;    /*!< Innobase SQL update node used
                    to perform updates and deletes */
    que_fork_t*    ins_graph;    /*!< Innobase SQL query graph used
                    in inserts */
    que_fork_t*    upd_graph;    /*!< Innobase SQL query graph used
                    in updates or deletes */
    btr_pcur_t    pcur;        /*!< persistent cursor used in selects
                    and updates */
    btr_pcur_t    clust_pcur;    /*!< persistent cursor used in
                    some selects and updates */
    que_fork_t*    sel_graph;    /*!< dummy query graph used in
                    selects */
    dtuple_t*    search_tuple;    /*!< prebuilt dtuple used in selects */
    byte        row_id[DATA_ROW_ID_LEN];
                    /*!< if the clustered index was
                    generated, the row id of the
                    last row fetched is stored
                    here */
    dtuple_t*    clust_ref;    /*!< prebuilt dtuple used in
                    sel/upd/del */
    ulint        select_lock_type;/*!< LOCK_NONE, LOCK_S, or LOCK_X */
    ulint        stored_select_lock_type;/*!< this field is used to
                    remember the original select_lock_type
                    that was decided in ha_innodb.cc,
                    ::store_lock(), ::external_lock(),
                    etc. */
    ulint        row_read_type;    /*!< ROW_READ_WITH_LOCKS if row locks
                    should be the obtained for records
                    under an UPDATE or DELETE cursor.
                    If innodb_locks_unsafe_for_binlog
                    is TRUE, this can be set to
                    ROW_READ_TRY_SEMI_CONSISTENT, so that
                    if the row under an UPDATE or DELETE
                    cursor was locked by another
                    transaction, InnoDB will resort
                    to reading the last committed value
                    ('semi-consistent read').  Then,
                    this field will be set to
                    ROW_READ_DID_SEMI_CONSISTENT to
                    indicate that.    If the row does not
                    match the WHERE condition, MySQL will
                    invoke handler::unlock_row() to
                    clear the flag back to
                    ROW_READ_TRY_SEMI_CONSISTENT and
                    to simply skip the row.     If
                    the row matches, the next call to
                    row_search_for_mysql() will lock
                    the row.
                    This eliminates lock waits in some
                    cases; note that this breaks
                    serializability. */
    ulint        new_rec_locks;    /*!< normally 0; if
                    srv_locks_unsafe_for_binlog is
                    TRUE or session is using READ
                    COMMITTED or READ UNCOMMITTED
                    isolation level, set in
                    row_search_for_mysql() if we set a new
                    record lock on the secondary
                    or clustered index; this is
                    used in row_unlock_for_mysql()
                    when releasing the lock under
                    the cursor if we determine
                    after retrieving the row that
                    it does not need to be locked
                    ('mini-rollback') */
    ulint        mysql_prefix_len;/*!< byte offset of the end of
                    the last requested column */
    ulint        mysql_row_len;    /*!< length in bytes of a row in the
                    MySQL format */
    ulint        n_rows_fetched;    /*!< number of rows fetched after
                    positioning the current cursor */
    ulint        fetch_direction;/*!< ROW_SEL_NEXT or ROW_SEL_PREV */
    byte*        fetch_cache[MYSQL_FETCH_CACHE_SIZE];
                    /*!< a cache for fetched rows if we
                    fetch many rows from the same cursor:
                    it saves CPU time to fetch them in a
                    batch; we reserve mysql_row_len
                    bytes for each such row; these
                    pointers point 4 bytes past the
                    allocated mem buf start, because
                    there is a 4 byte magic number at the
                    start and at the end */
    ibool        keep_other_fields_on_keyread; /*!< when using fetch
                    cache with HA_EXTRA_KEYREAD, don't
                    overwrite other fields in mysql row
                    row buffer.*/
    ulint        fetch_cache_first;/*!< position of the first not yet
                    fetched row in fetch_cache */
    ulint        n_fetch_cached;    /*!< number of not yet fetched rows
                    in fetch_cache */
    mem_heap_t*    blob_heap;    /*!< in SELECTS BLOB fields are copied
                    to this heap */
    mem_heap_t*    old_vers_heap;    /*!< memory heap where a previous
                    version is built in consistent read */
    /*----------------------*/
    ulonglong    autoinc_last_value;
                    /*!< last value of AUTO-INC interval */
    ulonglong    autoinc_increment;/*!< The increment step of the auto
                    increment column. Value must be
                    greater than or equal to 1. Required to
                    calculate the next value */
    ulonglong    autoinc_offset; /*!< The offset passed to
                    get_auto_increment() by MySQL. Required
                    to calculate the next value */
    ulint        autoinc_error;    /*!< The actual error code encountered
                    while trying to init or read the
                    autoinc value from the table. We
                    store it here so that we can return
                    it to MySQL */
    /*----------------------*/
    ulint        magic_n2;    /*!< this should be the same as
                    magic_n */
};

结构体 row_prebuilt_t的更多相关文章

  1. Go结构体实现类似成员函数机制

    Go语言结构体成员能否是函数,从而实现类似类的成员函数的机制呢?答案是肯定的. package main import "fmt" type stru struct { testf ...

  2. C#基础回顾(二)—页面值传递、重载与重写、类与结构体、装箱与拆箱

    一.前言 -孤独的路上有梦想作伴,乘风破浪- 二.页面值传递 (1)C#各页面之间可以进行数据的交换和传递,页面之间可根据获取的数据,进行各自的操作(跳转.计算等操作).为了实现多种方式的数据传递,C ...

  3. go语言结构体

    定义: 是一种聚合的数据类型,是由零个或多个任意类型的值聚合成的实体. 成员: 每个值称为结构体的成员. 示例: 用结构体的经典案例处理公司的员工信息,每个员工信息包含一个唯一的员工编号.员工的名字. ...

  4. C语言中的结构体

    用户自己建立自己的结构体类型 1.  定义和使用结构体变量 (1).结构体的定义 C语言允许用户自己建立由不同类型数据组成的组合型的数据结构,它称为结构体. (2).声明一个结构体类型的一般形式为: ...

  5. C++_系列自学课程_第_12_课_结构体

    #include <iostream> #include <string> using namespace std; struct CDAccount { double bal ...

  6. java socket传送一个结构体给用C++编写的服务器解析的问题

    另一端是Java写客户端程序,两者之间需要通信.c++/c接收和发送的都是结构体,而Java是直接发送的字节流或者byte 数组.解决方法:c++/c socket 在发送结构体的时候其实发送的也是字 ...

  7. swift学习笔记3——类、结构体、枚举

    之前学习swift时的个人笔记,根据github:the-swift-programming-language-in-chinese学习.总结,将重要的内容提取,加以理解后整理为学习笔记,方便以后查询 ...

  8. HDOJ 1009. Fat Mouse' Trade 贪心 结构体排序

    FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  9. C语言结构体对齐

    1.结构体变量中的元素如何访问? (1)数组中元素的访问方式:表面上有2种方式(数组下标方式和指针方式):实质上都是指针方式访问.(2)结构体变量中的元素访问方式:只有一种,用.或者->的方式来 ...

随机推荐

  1. 如何将C++中的SOCKADDR_IN*参数类型转换成C#中的参数类型

    将C++中的参数类型SOCKADDR_IN*映射为C#中的IntPtr参数类型的示例代码如下: IntPtr ptrSockaddr = new IntPtr(); //ip地址 sockaddr_i ...

  2. PHP连接sqlserver的两种方法,向sqlserver2000中写入数据,中文乱码

    项目环境是php5.3.28 项目用的ThinkPHP3.2.3  已经mysql5.5数据库,要和另一个项目对接,需要连接sqlsever2000数据库进行一些操作. 第一种用php自带扩展连接数据 ...

  3. WCF SOA服务应用

    WCF是微软官方推出的一个基于服务的整合框架,它整合了以前的Web Service.MSMQ.Remoting等通信技术,通过灵活的配置,让服务编程更加容易.可扩展.这篇文章主要目的就是带领大家从开发 ...

  4. demo_01 css3中的radius

    css属性:border-radius :border:边框:radius:弧度:所以这个属性的意思很明了. 下面实现一个小demo: <!doctype html> <html&g ...

  5. linear-gradient 的“高能”用法

    首先,让我们来了解一下“linear-gradient”的基本用法: 说明:用线性渐变创建图像 语法: <linear-gradient> = linear-gradient([ [ &l ...

  6. HTML meta viewport属性说明

    什么是Viewport 手机浏览器是把页面放在一个虚拟的“窗口”(viewport)中,通常这个虚拟的“窗口”(viewport)比屏幕宽,这样就不用把每个网页挤 到很小的窗口中(这样会破坏没有针对手 ...

  7. Maya QT interfaces in a class

    Most tutorials online have suggested the way to fire commands inside QT interfaces launched n Maya ( ...

  8. 【BZOJ】1001: [BeiJing2006]狼抓兔子 Dinic算法求解平面图对偶图-最小割

    1001: [BeiJing2006]狼抓兔子 Description 左上角点为(1,1),右下角点为(N,M)(上图中N=4,M=5).有以下 三种类型的道路 1:(x,y)<==>( ...

  9. 【BZOJ】1051: [HAOI2006]受欢迎的牛

    [HAOI2006]受欢迎的牛 Description 每一头牛的愿望就是变成一头最受欢迎的牛.现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎. 这种关系是具有传递性的,如果A认为B受欢 ...

  10. Ubuntu启动停止在checking battery state...

    Ubuntu在“checking battery state...”处停止了,出现这种现象的原因可能有很多种.笔者遇到的是其中的一种. 情景描述: 笔者此前将Ubuntu的图形启动方式修改为了字符界面 ...