ha_innobase::rnd_next

/*****************************************************************//**
Reads the next row in a table scan (also used to read the FIRST row
in a table scan).
@return    0, HA_ERR_END_OF_FILE, or error number */
UNIV_INTERN
int
ha_innobase::rnd_next(
/*==================*/
    uchar*    buf)    /*!< in/out: returns the row in this buffer,
            in MySQL format */
{
    int    error;

    DBUG_ENTER("rnd_next");
    ha_statistic_increment(&SSV::ha_read_rnd_next_count);

    if (start_of_scan) {
        error = index_first(buf);

        if (error == HA_ERR_KEY_NOT_FOUND) {
            error = HA_ERR_END_OF_FILE;
        }

        start_of_scan = 0;
    } else {
        error = general_fetch(buf, ROW_SEL_NEXT, 0);
    }

    DBUG_RETURN(error);
}
时间: 2024-11-05 19:39:11

ha_innobase::rnd_next的相关文章

select 数据

http://blog.csdn.net/wudongxu/article/details/6683846 ha_innobase::open ib_table = dict_table_get(norm_name, TRUE, ignore_err); prebuilt = row_create_prebuilt(ib_table, table->s->reclength); ha_innobase::rnd_next if(第一次查找) index_first(buf); else gen

class ha_innobase: public handler

/** The class defining a handle to an Innodb table */ class ha_innobase: public handler { row_prebuilt_t* prebuilt; /*!< prebuilt struct in InnoDB, used to save CPU time with prebuilt data structures*/ THD* user_thd; /*!< the thread handle of the us

ha_innobase::general_fetch

/***********************************************************************//** Reads the next or previous row from a cursor, which must have previously been positioned using index_read. @return 0, HA_ERR_END_OF_FILE, or error number */ UNIV_INTERN int

ha_innobase::open

http://mysql.taobao.org/monthly/2015/08/07/ /*****************************************************************//** Creates and opens a handle to a table which already exists in an InnoDB database. @return 1 if error, 0 if success */ UNIV_INTERN int h

MySQL 外键异常分析

外键约束异常现象 如下测例中,没有违反引用约束的插入失败. create database `a-b`; use `a-b`; SET FOREIGN_KEY_CHECKS=0; create table t1(c1 int primary key, c2 int) engine=innodb; create table t2(c1 int primary key, c2 int) engine=innodb; alter table t2 add foreign key(c2) referen

怎么跳出MySQL的10个大坑

淘宝自从2010开始规模使用MySQL,替换了之前商品.交易.用户等原基于IOE方案的核心数据库,目前已部署数千台规模.同时和Oracle, Percona, Mariadb等上游厂商有良好合作,共向上游提交20多个Patch.目前淘宝核心系统研发部数据库组,根据淘宝的业务需求,改进数据库和提升性能,提供高性能.可扩展的.稳定可靠的数据库(存储)解决方案. 目前有以下几个方向:单机,提升单机数据库的性能,增加我们所需特性:集群,提供性能扩展,可靠性,可能涉及分布式事务处理:IO存储体系,跟踪IO

MYSQL INNODB主键使用varchar和int有什么区别?

本文和大家分享的主要是MYSQL 数据库主键使用varchar和int的区别,一起来看看吧,希望对大家学习mysql有所帮助. 我现在总结的3个问题: 1.tablespace中空间浪费 当然我们知道使用varchar可能会导致辅助索引比较大,因为用到varchar可能存储的字符较多,同时 在行头也存在一个可变字段字符区域(1-2)字节 而辅助索引叶子结点毕竟都存储了主键值,这样至少会多varchar数据字节数量+1(或者2) 字节- 4(int)字节空间. 如果辅助索引比较多空间浪费是可想而知

Atitit.自定义存储引擎的接口设计&#160;api&#160;标准化&#160;attilax&#160;总结&#160;&#160;mysql

Atitit.自定义存储引擎的接口设计 api 标准化 attilax 总结  mysql 1. 图16.1:MySQL体系结构1 2. 16.7. 创建表create()虚拟函数:2 3. 16.8. 打开表 open()2 4. ---------------------------------------------------------------------------------------------------------------------2 5. 16.9. 实施基本的

类handler

/** The handler class is the interface for dynamically loadable storage engines. Do not add ifdefs and take care when adding or changing virtual functions to avoid vtable confusion */ class handler :public Sql_alloc { public: typedef ulonglong Table_