Repository navigation
Expand file tree
/
Copy pathRecord.cc
More file actions
641 lines (579 loc) · 19.9 KB
/
Copy pathRecord.cc
File metadata and controls
641 lines (579 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
/*
* Copyright (c) [2025-2026] [Zhao Song]
*/
#include "Record.h"
#include "Index.h"
#include "Table.h"
#include "Column.h"
#include <cassert>
#include <cinttypes>
#include <cstdio>
namespace ibd_ninja {
#define ninja_pt(p, fmt, ...) \
do { if (p) printf(fmt, ##__VA_ARGS__); } while (0)
#define ninja_error(format, ...) \
fprintf(stderr, "[ERROR] %s:%d - " format "\n", \
__FILE__, __LINE__, ##__VA_ARGS__)
#define UT_BITS_IN_BYTES(b) (((b) + 7UL) / 8UL)
/* ------ Record ------ */
uint32_t Record::GetBitsFrom1B(uint32_t offs, uint32_t mask, uint32_t shift) {
return ((ReadFrom1B(rec_ - offs) & mask) >> shift);
}
uint32_t Record::GetBitsFrom2B(uint32_t offs, uint32_t mask, uint32_t shift) {
return ((ReadFrom2B(rec_ - offs) & mask) >> shift);
}
uint32_t Record::GetStatus() {
uint32_t ret = 0;
ret = GetBitsFrom1B(REC_NEW_STATUS, REC_NEW_STATUS_MASK,
REC_NEW_STATUS_SHIFT);
assert((ret & ~REC_NEW_STATUS_MASK) == 0);
return ret;
}
uint32_t* Record::GetColumnOffsets() {
uint32_t n = 0;
if (index_->table()->IsCompact()) {
switch (GetStatus()) {
case REC_STATUS_ORDINARY:
n = index_->GetNFields();
break;
case REC_STATUS_NODE_PTR:
n = index_->GetNUniqueInTreeNonleaf() + 1;
break;
case REC_STATUS_INFIMUM:
case REC_STATUS_SUPREMUM:
n = 1;
break;
default:
// The status bits come from the record on disk
ninja_error("Invalid record status %u, the record is corrupt",
GetStatus());
return nullptr;
}
} else {
// TODO(Zhao): Support redundant row format
}
uint32_t size = n + (1 + REC_OFFS_HEADER_SIZE);
assert(offsets_ == nullptr);
offsets_ = new uint32_t[size];
SetNAlloc(size);
SetNFields(n);
InitColumnOffsets();
return offsets_;
}
static uint32_t* RecOffsBase(uint32_t* offsets) {
return offsets + REC_OFFS_HEADER_SIZE;
}
static uint32_t RecOffsNFields(uint32_t* offsets) {
uint32_t n_fields = offsets[1];
assert(n_fields > 0);
return n_fields;
}
void Record::InitColumnOffsetsCompact() {
uint32_t n_node_ptr_field = ULINT_UNDEFINED;
switch (GetStatus()) {
case REC_STATUS_INFIMUM:
case REC_STATUS_SUPREMUM:
RecOffsBase(offsets_)[0] = REC_N_NEW_EXTRA_BYTES | REC_OFFS_COMPACT;
RecOffsBase(offsets_)[1] = 8;
return;
case REC_STATUS_NODE_PTR:
n_node_ptr_field = index_->GetNUniqueInTreeNonleaf();
break;
case REC_STATUS_ORDINARY:
InitColumnOffsetsCompactLeaf();
return;
}
// non-leaf page record
assert(!IsVersionedCompact());
const unsigned char* nulls = rec_ - (REC_N_NEW_EXTRA_BYTES + 1);
const size_t nullable_cols = index_->GetNullableBeforeInstantAddDrop();
const unsigned char* lens = nulls - UT_BITS_IN_BYTES(nullable_cols);
uint32_t offs = 0;
uint32_t null_mask = 1;
uint32_t i = 0;
IndexColumn* index_col = nullptr;
Column* col = nullptr;
do {
uint32_t len;
if (i == n_node_ptr_field) {
len = offs += REC_NODE_PTR_SIZE;
goto resolved;
}
index_col = index_->ib_fields()->at(i);
col = index_col->column();
if (col->is_nullable()) {
if (!(unsigned char)null_mask) {
nulls--;
null_mask = 1;
}
if (*nulls & null_mask) {
null_mask <<= 1;
len = offs | REC_OFFS_SQL_NULL;
goto resolved;
}
null_mask <<= 1;
}
if (!index_col->ib_fixed_len()) {
/* DATA_POINT should always be a fixed
length column. */
assert(col->ib_mtype() != DATA_POINT);
/* Variable-length field: read the length */
len = *lens--;
if (col->IsBigCol()) {
if (len & 0x80) {
len <<= 8;
len |= *lens--;
assert(!(len & 0x4000));
offs += len & 0x3fff;
len = offs;
goto resolved;
}
}
len = offs += len;
} else {
len = offs += index_col->ib_fixed_len();
}
resolved:
RecOffsBase(offsets_)[i + 1] = len;
} while (++i < RecOffsNFields(offsets_));
*RecOffsBase(offsets_) = (rec_ - (lens + 1)) | REC_OFFS_COMPACT;
}
void Record::InitColumnOffsets() {
if (index_->table()->IsCompact()) {
InitColumnOffsetsCompact();
} else {
// TODO(Zhao): Support redundant row format
}
}
void Record::InitColumnOffsetsCompactLeaf() {
const unsigned char* nulls = nullptr;
const unsigned char* lens = nullptr;
uint16_t n_null = 0;
enum REC_INSERT_STATE rec_insert_state = REC_INSERT_STATE::NONE;
uint8_t row_version = UINT8_UNDEFINED;
uint16_t non_default_fields = 0;
rec_insert_state = InitNullAndLengthCompact(&nulls, &lens, &n_null,
&non_default_fields, &row_version);
uint32_t offs = 0;
uint32_t any_ext = 0;
uint32_t null_mask = 1;
uint16_t i = 0;
do {
IndexColumn* index_col = index_->GetPhysicalField(i);
if (index_col == nullptr) {
// Corrupt metadata: fill the remaining offsets as zero-length NULL
// fields so callers never read uninitialized offsets.
do {
RecOffsBase(offsets_)[i + 1] = offs | REC_OFFS_SQL_NULL;
} while (++i < RecOffsNFields(offsets_));
break;
}
Column* col = index_col->column();
uint64_t len;
switch (rec_insert_state) {
case INSERTED_INTO_TABLE_WITH_NO_INSTANT_NO_VERSION:
assert(!index_->HasInstantColsOrRowVersions());
break;
case INSERTED_BEFORE_INSTANT_ADD_NEW_IMPLEMENTATION: {
assert(row_version == UINT8_UNDEFINED || row_version == 0);
assert(index_->ib_row_versions());
row_version = 0;
}
[[fallthrough]];
case INSERTED_AFTER_UPGRADE_BEFORE_INSTANT_ADD_NEW_IMPLEMENTATION:
case INSERTED_AFTER_INSTANT_ADD_NEW_IMPLEMENTATION: {
assert(index_->ib_row_versions() ||
(index_->table()->ib_m_upgraded_instant() && row_version == 0));
if (col->IsDroppedInOrBefore(row_version)) {
len = offs | REC_OFFS_DROP;
goto resolved;
} else if (col->IsAddedAfter(row_version)) {
len = GetInstantOffset(i, offs);
goto resolved;
}
} break;
case INSERTED_BEFORE_INSTANT_ADD_OLD_IMPLEMENTATION:
case INSERTED_AFTER_INSTANT_ADD_OLD_IMPLEMENTATION: {
assert(non_default_fields > 0);
assert(index_->ib_instant_cols());
if (i >= non_default_fields) {
len = GetInstantOffset(i, offs);
goto resolved;
}
} break;
default:
assert(false);
}
if (col->is_nullable()) {
// n_null tracks the nullable columns accounted for in the null
// bitmap; running out means the record is corrupt. (Must not be a
// side effect inside assert(): that breaks under -DNDEBUG.)
if (n_null > 0) {
n_null--;
}
if (!(unsigned char)null_mask) {
nulls--;
null_mask = 1;
}
if (*nulls & null_mask) {
null_mask <<= 1;
len = offs | REC_OFFS_SQL_NULL;
goto resolved;
}
null_mask <<= 1;
}
if (!index_col->ib_fixed_len()) {
/* Variable-length field: read the length */
len = *lens--;
if (col->IsBigCol()) {
if (len & 0x80) {
len <<= 8;
len |= *lens--;
offs += len & 0x3fff;
if (len & 0x4000) {
assert(index_->IsClustered());
any_ext = REC_OFFS_EXTERNAL;
len = offs | REC_OFFS_EXTERNAL;
} else {
len = offs;
}
goto resolved;
}
}
len = offs += len;
} else {
len = offs += index_col->ib_fixed_len();
}
resolved:
RecOffsBase(offsets_)[i + 1] = len;
} while (++i < RecOffsNFields(offsets_));
*RecOffsBase(offsets_) = (rec_ - (lens + 1)) | REC_OFFS_COMPACT | any_ext;
}
Record::REC_INSERT_STATE Record::InitNullAndLengthCompact(
const unsigned char** nulls, const unsigned char** lens,
uint16_t* n_null, uint16_t* non_default_fields,
uint8_t* row_version) {
*non_default_fields = static_cast<uint16_t>(index_->GetNFields());
*row_version = UINT8_UNDEFINED;
*nulls = rec_ - (REC_N_NEW_EXTRA_BYTES + 1);
const enum REC_INSERT_STATE rec_insert_state =
GetInsertState();
switch (rec_insert_state) {
case INSERTED_INTO_TABLE_WITH_NO_INSTANT_NO_VERSION: {
assert(!GetInstantFlagCompact());
assert(!IsVersionedCompact());
*n_null = index_->ib_n_nullable();
} break;
case INSERTED_AFTER_INSTANT_ADD_NEW_IMPLEMENTATION:
case INSERTED_AFTER_UPGRADE_BEFORE_INSTANT_ADD_NEW_IMPLEMENTATION: {
*row_version = (uint8_t)(**nulls);
*nulls -= 1;
*n_null = index_->GetNullableInVersion(*row_version);
} break;
case INSERTED_AFTER_INSTANT_ADD_OLD_IMPLEMENTATION: {
uint16_t length;
*non_default_fields =
GetNFieldsInstant(REC_N_NEW_EXTRA_BYTES, &length);
assert(length == 1 || length == 2);
*nulls -= length;
*n_null = index_->CalculateNInstantNullable(*non_default_fields);
} break;
case INSERTED_BEFORE_INSTANT_ADD_OLD_IMPLEMENTATION: {
*n_null = index_->GetNullableBeforeInstantAddDrop();
*non_default_fields = index_->GetNOriginalFields();
} break;
case INSERTED_BEFORE_INSTANT_ADD_NEW_IMPLEMENTATION: {
*n_null = index_->GetNullableBeforeInstantAddDrop();
} break;
default:
assert(0);
}
*lens = *nulls - UT_BITS_IN_BYTES(*n_null);
return (rec_insert_state);
}
Record::REC_INSERT_STATE Record::GetInsertState() {
if (!index_->HasInstantColsOrRowVersions()) {
return INSERTED_INTO_TABLE_WITH_NO_INSTANT_NO_VERSION;
}
const unsigned char* v_ptr =
(const unsigned char*)rec_ - (REC_N_NEW_EXTRA_BYTES + 1);
const bool is_versioned = IsVersionedCompact();
const uint8_t version = (is_versioned) ? (uint8_t)(*v_ptr) : UINT8_UNDEFINED;
const bool is_instant = GetInstantFlagCompact();
assert(!is_versioned || !is_instant);
enum REC_INSERT_STATE rec_insert_state = REC_INSERT_STATE::NONE;
if (is_versioned) {
if (version == 0) {
assert(index_->ib_instant_cols());
rec_insert_state =
INSERTED_AFTER_UPGRADE_BEFORE_INSTANT_ADD_NEW_IMPLEMENTATION;
} else {
assert(index_->ib_row_versions());
rec_insert_state = INSERTED_AFTER_INSTANT_ADD_NEW_IMPLEMENTATION;
}
} else if (is_instant) {
assert(index_->table()->HasInstantCols());
rec_insert_state = INSERTED_AFTER_INSTANT_ADD_OLD_IMPLEMENTATION;
} else if (index_->table()->HasInstantCols()) {
rec_insert_state = INSERTED_BEFORE_INSTANT_ADD_OLD_IMPLEMENTATION;
} else {
rec_insert_state = INSERTED_BEFORE_INSTANT_ADD_NEW_IMPLEMENTATION;
}
assert(rec_insert_state != REC_INSERT_STATE::NONE);
return rec_insert_state;
}
bool Record::IsVersionedCompact() {
uint32_t info = GetInfoBits(true);
return ((info & REC_INFO_VERSION_FLAG) != 0);
}
uint32_t Record::GetInfoBits(bool comp) {
const uint32_t val = GetBitsFrom1B(comp ?
REC_NEW_INFO_BITS : REC_OLD_INFO_BITS,
REC_INFO_BITS_MASK, REC_INFO_BITS_SHIFT);
return val;
}
bool Record::GetInstantFlagCompact() {
uint32_t info = GetInfoBits(true);
return ((info & REC_INFO_INSTANT_FLAG) != 0);
}
uint32_t Record::GetNFieldsInstant(const uint32_t extra_bytes,
uint16_t* length) {
uint16_t n_fields;
const unsigned char *ptr;
ptr = rec_ - (extra_bytes + 1);
if ((*ptr & REC_N_FIELDS_TWO_BYTES_FLAG) == 0) {
*length = 1;
return (*ptr);
}
*length = 2;
n_fields = ((*ptr-- & REC_N_FIELDS_ONE_BYTE_MAX) << 8);
n_fields |= *ptr;
// The count comes from the record on disk; report instead of asserting.
// Callers bound it against the index field array before using it.
if (n_fields >= REC_MAX_N_FIELDS || n_fields == 0) {
ninja_error("Instant field count %u is out of range, "
"the record is likely corrupt", n_fields);
}
return (n_fields);
}
uint64_t Record::GetInstantOffset(uint32_t n, uint64_t offs) {
assert(index_->HasInstantColsOrRowVersions());
IndexColumn* index_col = index_->GetPhysicalField(n);
if (index_col == nullptr) {
return (offs | REC_OFFS_SQL_NULL);
}
Column* col = index_col->column();
if (col->ib_instant_default()) {
return (offs | REC_OFFS_DEFAULT);
} else {
return (offs | REC_OFFS_SQL_NULL);
}
}
void Record::ParseRecord(bool leaf, uint32_t row_no,
PageAnalysisResult* result,
bool print) {
uint32_t n_fields = leaf ? index_->GetNFields() :
index_->GetNUniqueInTreeNonleaf() + 1;
uint32_t header_len = (RecOffsBase(offsets_)[0] & REC_OFFS_MASK);
uint32_t rec_len = (RecOffsBase(offsets_)[n_fields] &
REC_OFFS_MASK);
// The offsets above accumulate variable-length field lengths read from
// the file; bound everything by the page so a bad length can't make the
// dump below walk past the page buffer.
uint32_t rec_off = page_offset(rec_);
uint32_t max_body_len =
(g_page_physical_size > rec_off) ? g_page_physical_size - rec_off : 0;
if (header_len > rec_off) {
ninja_error("Record header length %u runs past the start of the page, "
"the record is likely corrupt", header_len);
header_len = rec_off;
}
if (rec_len > max_body_len) {
ninja_error("Record length %u runs past the end of the page, "
"the record is likely corrupt", rec_len);
rec_len = max_body_len;
}
ninja_pt(print, "=========================================="
"=============================\n");
ninja_pt(print, "[ROW %u] Length: %u (%d | %d), Number of fields: %u\n",
row_no,
header_len + rec_len,
header_len,
rec_len,
n_fields);
bool deleted = false;
if (RecGetDeletedFlag(rec_, true) != 0) {
ninja_pt(print, "[DELETED MARK]\n");
deleted = true;
}
if (!deleted) {
if (leaf) {
result->n_recs_leaf++;
result->headers_len_leaf += header_len;
result->recs_len_leaf += rec_len;
} else {
result->n_recs_non_leaf++;
result->headers_len_non_leaf += header_len;
result->recs_len_non_leaf += rec_len;
}
} else {
if (leaf) {
result->n_deleted_recs_leaf++;
result->deleted_recs_len_leaf += (header_len + rec_len);
} else {
result->n_deleted_recs_non_leaf++;
result->deleted_recs_len_non_leaf += (header_len + rec_len);
}
}
uint32_t start_pos = 0;
uint32_t len = 0;
uint32_t end_pos = 0;
ibd_ninja::IndexColumn* index_col = nullptr;
ninja_pt(print, "------------------------------------------"
"-----------------------------\n");
ninja_pt(print, " [HEADER ] ");
int count = 0;
for (uint32_t i = 0; i < header_len; i++) {
ninja_pt(print, "%02x ", (rec_ - header_len)[i]);
count++;
if (count == 8) {
ninja_pt(print, " ");
} else if (count == 16) {
ninja_pt(print, "\n ");
count = 0;
}
}
ninja_pt(print, "\n");
bool dropped_column_counted = false;
for (uint32_t i = 0; i < n_fields; i++) {
index_col = nullptr;
if (!leaf && i == n_fields - 1) {
ninja_pt(print, " [FIELD %3u] Name : *NODE_PTR(Child page no)\n",
i + 1);
} else {
index_col = index_->GetPhysicalField(i);
if (index_col == nullptr) {
ninja_pt(print, " [FIELD %3u] <corrupt field metadata, "
"stopping record dump>\n", i + 1);
break;
}
ninja_pt(print, " [FIELD %3u] Name : %s\n",
i + 1,
index_col->column()->name().c_str());
}
len = RecOffsBase(offsets_)[i + 1];
end_pos = (len & REC_OFFS_MASK);
if (end_pos > max_body_len) {
// Bad on-disk length; clamp the dump to the page.
end_pos = max_body_len;
}
if (end_pos < start_pos) {
end_pos = start_pos;
}
ninja_pt(print, " "
"Length: %-5u\n",
end_pos - start_pos);
// TODO(Zhao): handle external part
if (index_col != nullptr &&
index_col->column()->IsColumnDropped()) {
// Only count valid records with non-zero size for dropped columns.
if (!deleted && !(len & REC_OFFS_DROP)) {
if (leaf) {
result->dropped_cols_len_leaf += (end_pos - start_pos);
if (!dropped_column_counted) {
result->n_contain_dropped_cols_recs_leaf++;
}
} else {
result->dropped_cols_len_non_leaf += (end_pos - start_pos);
if (!dropped_column_counted) {
result->n_contain_dropped_cols_recs_non_leaf++;
}
}
dropped_column_counted = true;
}
}
// index_col is nullptr for node_ptr
if (index_col != nullptr) {
ninja_pt(print, " "
"Type : %-15s | %-12s | %-20s\n",
index_col->column()->dd_column_type_utf8().c_str(),
index_col->column()->FieldTypeString().c_str(),
index_col->column()->SeTypeString().c_str());
}
ninja_pt(print, " "
"Value : ");
if (len & REC_OFFS_SQL_NULL) {
ninja_pt(print, "*NULL*\n");
start_pos = end_pos;
continue;
}
if (len & REC_OFFS_DROP) {
ninja_pt(print, "*NULL*\n"
" "
"(This row was inserted after this column "
"was instantly dropped)\n");
start_pos = end_pos;
continue;
}
if (len & REC_OFFS_DEFAULT) {
ninja_pt(print, "*DEFAULT*\n"
" "
"(This row was inserted before this column "
"was instantly added)\n");
start_pos = end_pos;
continue;
}
count = 0;
while (start_pos < end_pos) {
ninja_pt(print, "%02x ", rec_[start_pos]);
count++;
if (count == 8) {
ninja_pt(print, " ");
} else if (count == 16) {
ninja_pt(print, "\n ");
count = 0;
}
start_pos++;
}
if (len & REC_OFFS_EXTERNAL) {
if (end_pos < BTR_EXTERN_FIELD_REF_SIZE) {
ninja_pt(print, "\n "
"[EXTERNAL: corrupt reference, field too short]");
ninja_pt(print, "\n");
continue;
}
const unsigned char* ext_ref =
&rec_[end_pos - BTR_EXTERN_FIELD_REF_SIZE];
uint32_t space_id = ReadFrom4B(ext_ref + BTR_EXTERN_SPACE_ID);
uint32_t ext_page_no = ReadFrom4B(ext_ref + BTR_EXTERN_PAGE_NO);
uint32_t ext_version = ReadFrom4B(ext_ref + BTR_EXTERN_VERSION);
uint64_t ext_len = ReadFrom8B(ext_ref + BTR_EXTERN_LEN) & 0x1FFFFFFFFFULL;
ninja_pt(print, "\n "
"[EXTERNAL: space=%u, page=%u, version=%u, len=%" PRIu64 "]",
space_id, ext_page_no, ext_version, ext_len);
FetchAndDisplayExternalLob(space_id, ext_page_no, ext_version, ext_len,
g_lob_output_format,
g_lob_show_version_history, print);
}
ninja_pt(print, "\n");
}
}
uint32_t Record::GetChildPageNo() {
uint32_t n_fields = GetNFields();
assert(n_fields >= 2);
uint32_t last_2_len = (RecOffsBase(offsets_)[n_fields - 1]);
uint32_t last_2_end_pos = (last_2_len & REC_OFFS_MASK);
uint32_t last_len = (RecOffsBase(offsets_)[n_fields]);
uint32_t last_end_pos = (last_len & REC_OFFS_MASK);
uint32_t rec_off = page_offset(rec_);
// Both offsets come from parsing on-disk data: validate that the
// node-pointer field is the expected 4 bytes and lies inside the page.
if (last_end_pos - last_2_end_pos != REC_NODE_PTR_SIZE ||
rec_off + last_end_pos > g_page_physical_size) {
ninja_error("Corrupt node-pointer record (field end offsets %u/%u)",
last_2_end_pos, last_end_pos);
return FIL_NULL;
}
return ReadFrom4B(&rec_[last_2_end_pos]);
}
} // namespace ibd_ninja