11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
14
this program; if not, write to the Free Software Foundation, Inc.,
15
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17
17
*****************************************************************************/
569
569
/* Track an assertion failure reported on the mailing
570
570
list on June 18th, 2003 */
572
buf_page_print(new_page, 0);
573
buf_page_print(page_align(rec), 0);
572
buf_page_print(new_page, 0,
573
BUF_PAGE_PRINT_NO_CRASH);
574
buf_page_print(page_align(rec), 0,
575
BUF_PAGE_PRINT_NO_CRASH);
574
576
ut_print_timestamp(stderr);
1455
#ifndef UNIV_HOTBACKUP
1456
1457
/************************************************************//**
1457
Returns the middle record of the record list. If there are an even number
1458
of records in the list, returns the first record of the upper half-list.
1459
@return middle record */
1458
Returns the nth record of the record list.
1459
This is the inverse function of page_rec_get_n_recs_before().
1460
@return nth record */
1462
page_get_middle_rec(
1463
/*================*/
1464
page_t* page) /*!< in: page */
1463
page_rec_get_nth_const(
1464
/*===================*/
1465
const page_t* page, /*!< in: page */
1466
ulint nth) /*!< in: nth record */
1466
page_dir_slot_t* slot;
1468
const page_dir_slot_t* slot;
1473
/* This many records we must leave behind */
1474
middle = (page_get_n_recs(page) + PAGE_HEAP_NO_USER_LOW) / 2;
1473
ut_ad(nth < UNIV_PAGE_SIZE / (REC_N_NEW_EXTRA_BYTES + 1));
1478
1475
for (i = 0;; i++) {
1480
1477
slot = page_dir_get_nth_slot(page, i);
1481
1478
n_owned = page_dir_slot_get_n_owned(slot);
1483
if (count + n_owned > middle) {
1480
if (n_owned > nth) {
1491
1488
slot = page_dir_get_nth_slot(page, i - 1);
1492
rec = (rec_t*) page_dir_slot_get_rec(slot);
1493
rec = page_rec_get_next(rec);
1495
/* There are now count records behind rec */
1497
for (i = 0; i < middle - count; i++) {
1498
rec = page_rec_get_next(rec);
1489
rec = page_dir_slot_get_rec(slot);
1491
if (page_is_comp(page)) {
1493
rec = page_rec_get_next_low(rec, TRUE);
1498
rec = page_rec_get_next_low(rec, FALSE);
1503
#endif /* !UNIV_HOTBACKUP */
1505
1506
/***************************************************************//**
1506
1507
Returns the number of records before the given record in chain.
1834
1836
fprintf(stderr,
1835
1837
"InnoDB: Page directory corruption:"
1836
1838
" infimum not pointed to\n");
1837
buf_page_print(page, 0);
1839
buf_page_print(page, 0, 0);
1840
1842
if (UNIV_UNLIKELY(!page_rec_is_supremum_low(supremum_offs))) {
1842
1844
fprintf(stderr,
1843
1845
"InnoDB: Page directory corruption:"
1844
1846
" supremum not pointed to\n");
1845
buf_page_print(page, 0);
1847
buf_page_print(page, 0, 0);
1848
1850
#endif /* !UNIV_HOTBACKUP */
2546
2548
(ulong) page_get_space_id(page),
2547
2549
(ulong) page_get_page_no(page),
2549
buf_page_print(page, 0);
2551
buf_page_print(page, 0, 0);