/************************************************************//**
Gets the pointer to the next record on the page.
@return    pointer to next record */
UNIV_INLINE
const rec_t*
page_rec_get_next_const(
/*====================*/
    const rec_t*    rec)    /*!< in: pointer to record */
{
    return(page_rec_get_next_low(rec, page_rec_is_comp(rec)));
}

/************************************************************//**
TRUE if the record is on a page in compact format.
@return    nonzero if in compact format */
UNIV_INLINE
ulint
page_rec_is_comp(
/*=============*/
    const rec_t*    rec)    /*!< in: record */
{
    return(page_is_comp(page_align(rec)));
}

/************************************************************//**
Determine whether the page is in new-style compact format.
@return nonzero if the page is in compact format, zero if it is in
old-style format */
UNIV_INLINE
ulint
page_is_comp(
/*=========*/
    const page_t*    page)    /*!< in: index page */
{
    return(UNIV_EXPECT(page_header_get_field(page, PAGE_N_HEAP) & 0x8000,
               0x8000));
}

/************************************************************//**
Gets the pointer to the next record on the page.
@return    pointer to next record */
UNIV_INLINE
const rec_t*
page_rec_get_next_low(
/*==================*/
    const rec_t*    rec,    /*!< in: pointer to record */
    ulint        comp)    /*!< in: nonzero=compact page layout */
{
    ulint        offs;
    const page_t*    page;

    ut_ad(page_rec_check(rec));

    page = page_align(rec);

    offs = rec_get_next_offs(rec, comp);

    if (UNIV_UNLIKELY(offs >= UNIV_PAGE_SIZE)) {
        fprintf(stderr,
            "InnoDB: Next record offset is nonsensical %lu"
            " in record at offset %lu\n"
            "InnoDB: rec address %p, space id %lu, page %lu\n",
            (ulong)offs, (ulong) page_offset(rec),
            (void*) rec,
            (ulong) page_get_space_id(page),
            (ulong) page_get_page_no(page));
        buf_page_print(page, , );

        ut_error;
    }

    )) {

        return(NULL);
    }

    return(page + offs);
}

函数page_rec_get_next_const的更多相关文章

  1. Python 小而美的函数

    python提供了一些有趣且实用的函数,如any all zip,这些函数能够大幅简化我们得代码,可以更优雅的处理可迭代的对象,同时使用的时候也得注意一些情况   any any(iterable) ...

  2. 探究javascript对象和数组的异同,及函数变量缓存技巧

    javascript中最经典也最受非议的一句话就是:javascript中一切皆是对象.这篇重点要提到的,就是任何jser都不陌生的Object和Array. 有段时间曾经很诧异,到底两种数据类型用来 ...

  3. JavaScript权威指南 - 函数

    函数本身就是一段JavaScript代码,定义一次但可能被调用任意次.如果函数挂载在一个对象上,作为对象的一个属性,通常这种函数被称作对象的方法.用于初始化一个新创建的对象的函数被称作构造函数. 相对 ...

  4. C++对C的函数拓展

    一,内联函数 1.内联函数的概念 C++中的const常量可以用来代替宏常数的定义,例如:用const int a = 10来替换# define a 10.那么C++中是否有什么解决方案来替代宏代码 ...

  5. 菜鸟Python学习笔记第一天:关于一些函数库的使用

    2017年1月3日 星期二 大一学习一门新的计算机语言真的很难,有时候连函数拼写出错查错都能查半天,没办法,谁让我英语太渣. 关于计算机语言的学习我想还是从C语言学习开始为好,Python有很多语言的 ...

  6. javascript中的this与函数讲解

    前言 javascript中没有块级作用域(es6以前),javascript中作用域分为函数作用域和全局作用域.并且,大家可以认为全局作用域其实就是Window函数的函数作用域,我们编写的js代码, ...

  7. 复杂的 Hash 函数组合有意义吗?

    很久以前看到一篇文章,讲某个大网站储存用户口令时,会经过十分复杂的处理.怎么个复杂记不得了,大概就是先 Hash,结果加上一些特殊字符再 Hash,结果再加上些字符.再倒序.再怎么怎么的.再 Hash ...

  8. JS核心系列:浅谈函数的作用域

    一.作用域(scope) 所谓作用域就是:变量在声明它们的函数体以及这个函数体嵌套的任意函数体内都是有定义的. function scope(){ var foo = "global&quo ...

  9. C++中的时间函数

    C++获取时间函数众多,何时该用什么函数,拿到的是什么时间?该怎么用?很多人都会混淆. 本文是本人经历了几款游戏客户端和服务器开发后,对游戏中时间获取的一点总结. 最早学习游戏客户端时,为了获取最精确 ...

随机推荐

  1. struts2 package元素配置(转载)

    package 元素的所有属性及对应功能: Attribute Required Description name yes key to for other packages to reference ...

  2. How to Change Password Complexity Requirements in Windows XP

    Original Link: http://www.ehow.com/how_4812793_password-complexity-requirements-windows-xp.html#ixzz ...

  3. leetcode problem 42 -- Trapping Rain Water

    Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...

  4. node.js 安装express 提示 command is not found

    肯定有遇到这样的问题. 在执行express -e app时,出现 command is not found 此时需要执行 : $ npm install -g express-generator 你 ...

  5. 利用javascript Location访问Url,重定向,刷新页面

    网上转来了, 方便以后查询参考 本文介绍怎么使用javascript Location对象读和修改Url.怎么重载或刷新页面.javascript提供了许多方法访问,修改当前用户在浏览器中访问的url ...

  6. Modernizr.js介绍与使用

    Modernizr帮助我们检测浏览器是否实现了某个feature,如果实现了那么开发人员就可以充分利用这个feature做一些工作,反之没有实现开发人员也好提供一个fallback.所以,我们要明白的 ...

  7. 笨方法学python 33课

    今天Eiffel看到了第33章,任务是把一个while循环改成一个函数. 我在把while循环改成函数上很顺利,但是不知道怎么写python的主函数,在参数的调用上也出现了问题. 通过查资料,发现py ...

  8. Python复杂多重排序

    1. cmp函数是python自带的函数,用于比较两个参数哪个大哪个小 print cmp(2, 3) # -1 如果第一个参数比第二个小,就返回-1,两个元素相等,返回0,否则返回1 2.所以就可以 ...

  9. Mysql zip压缩包安装

    解压mysql.zip 配置环境变量(略) 配置my-default.ini 配置文件 安装mysql:mysqld -install 初始化mysql:mysqld --initialize 启动服 ...

  10. Word分栏

    情景描述 Word分栏在小论文的撰写过程中是很常用的技术.但是,我们经常会遇到很难过的情况: 一段文字本来是连续分布的,可是当选择了分两栏         之后,开始部分在左边一栏,中间在右边一栏. ...