summaryrefslogtreecommitdiff
path: root/storage/innobase/include/page0page.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2011-06-16 12:07:49 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2011-06-16 12:07:49 +0300
commit3400e0be0aefa15fe128e0151a2a88f1ae4123c6 (patch)
tree21472269b09029bfbd95f0e0aadad837f0fc0dfa /storage/innobase/include/page0page.h
parent5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff)
parent417a267927b9249868e8ca7bd3cb7b6e09485f43 (diff)
downloadmariadb-git-3400e0be0aefa15fe128e0151a2a88f1ae4123c6.tar.gz
Merge mysql-5.1 to mysql-5.5.
Diffstat (limited to 'storage/innobase/include/page0page.h')
-rw-r--r--storage/innobase/include/page0page.h39
1 files changed, 33 insertions, 6 deletions
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index 7091d8c2707..346f65302f7 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -284,16 +284,42 @@ page_get_supremum_offset(
const page_t* page); /*!< in: page which must have record(s) */
#define page_get_infimum_rec(page) ((page) + page_get_infimum_offset(page))
#define page_get_supremum_rec(page) ((page) + page_get_supremum_offset(page))
+
/************************************************************//**
-Returns the middle record of record list. If there are an even number
-of records in the list, returns the first record of upper half-list.
-@return middle record */
+Returns the nth record of the record list.
+This is the inverse function of page_rec_get_n_recs_before().
+@return nth record */
UNIV_INTERN
+const rec_t*
+page_rec_get_nth_const(
+/*===================*/
+ const page_t* page, /*!< in: page */
+ ulint nth) /*!< in: nth record */
+ __attribute__((nonnull, warn_unused_result));
+/************************************************************//**
+Returns the nth record of the record list.
+This is the inverse function of page_rec_get_n_recs_before().
+@return nth record */
+UNIV_INLINE
+rec_t*
+page_rec_get_nth(
+/*=============*/
+ page_t* page, /*< in: page */
+ ulint nth) /*!< in: nth record */
+ __attribute__((nonnull, warn_unused_result));
+
+#ifndef UNIV_HOTBACKUP
+/************************************************************//**
+Returns the middle record of the records on the page. If there is an
+even number of records in the list, returns the first record of the
+upper half-list.
+@return middle record */
+UNIV_INLINE
rec_t*
page_get_middle_rec(
/*================*/
- page_t* page); /*!< in: page */
-#ifndef UNIV_HOTBACKUP
+ page_t* page) /*!< in: page */
+ __attribute__((nonnull, warn_unused_result));
/*************************************************************//**
Compares a data tuple to a physical record. Differs from the function
cmp_dtuple_rec_with_match in the way that the record must reside on an
@@ -348,6 +374,7 @@ page_get_n_recs(
/***************************************************************//**
Returns the number of records before the given record in chain.
The number includes infimum and supremum records.
+This is the inverse function of page_rec_get_nth().
@return number of records */
UNIV_INTERN
ulint