diff options
Diffstat (limited to 'storage/innobase/include/page0page.ic')
-rw-r--r-- | storage/innobase/include/page0page.ic | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 98b518187b5..75bfa56e2a6 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2019, MariaDB Corporation. +Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2016, 2020, MariaDB Corporation. 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 @@ -359,6 +359,26 @@ page_rec_is_last( } /************************************************************//** +true if distance between the records (measured in number of times we have to +move to the next record) is at most the specified value */ +UNIV_INLINE +bool +page_rec_distance_is_at_most( +/*=========================*/ + const rec_t* left_rec, + const rec_t* right_rec, + ulint val) +{ + for (ulint i = 0; i <= val; i++) { + if (left_rec == right_rec) { + return (true); + } + left_rec = page_rec_get_next_const(left_rec); + } + return (false); +} + +/************************************************************//** true if the record is the second last user record on a page. @return true if the second last user record */ UNIV_INLINE |