summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-07 17:15:34 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-07 17:15:34 +0300
commit18a62eb76df0cc0bece66ba29c354c613f58e944 (patch)
tree7bd7c36be88a9cc5a1f5181938de58f8b775575b /extra
parentba573c4736f908a6525acddb7573cc7d818eaa25 (diff)
downloadmariadb-git-18a62eb76df0cc0bece66ba29c354c613f58e944.tar.gz
MDEV-21133 follow-up: Use fil_page_get_type()
Let us use the common accessor function fil_page_get_type() instead of accessing the page header field FIL_PAGE_TYPE directly.
Diffstat (limited to 'extra')
-rw-r--r--extra/innochecksum.cc6
-rw-r--r--extra/mariabackup/fil_cur.cc4
2 files changed, 5 insertions, 5 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index 81deba4c390..d8d043d89b9 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -467,7 +467,7 @@ is_page_corrupted(
/* use to store LSN values. */
ulint logseq;
ulint logseqfield;
- ulint page_type = mach_read_from_2(buf+FIL_PAGE_TYPE);
+ const uint16_t page_type = fil_page_get_type(buf);
uint key_version = buf_page_get_key_version(buf, flags);
ulint space_id = mach_read_from_4(
buf + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
@@ -835,7 +835,7 @@ parse_page(
strcpy(str, "-");
}
- switch (mach_read_from_2(page + FIL_PAGE_TYPE)) {
+ switch (fil_page_get_type(page)) {
case FIL_PAGE_INDEX: {
uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
@@ -1933,7 +1933,7 @@ first_non_zero:
skip_page = false;
}
- ulint cur_page_type = mach_read_from_2(buf+FIL_PAGE_TYPE);
+ const uint16_t cur_page_type = fil_page_get_type(buf);
/* FIXME: Page compressed or Page compressed and encrypted
pages do not contain checksum. */
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index d1b2275a845..8f06005a9e4 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -276,7 +276,7 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
byte tmp_frame[UNIV_PAGE_SIZE_MAX];
byte tmp_page[UNIV_PAGE_SIZE_MAX];
const ulint page_size = cursor->page_size;
- ulint page_type = mach_read_from_2(page + FIL_PAGE_TYPE);
+ uint16_t page_type = fil_page_get_type(page);
/* We ignore the doublewrite buffer pages.*/
if (cursor->space_id == TRX_SYS_SPACE
@@ -359,7 +359,7 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
|| page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
ulint decomp = fil_page_decompress(tmp_frame, tmp_page,
space->flags);
- page_type = mach_read_from_2(tmp_page + FIL_PAGE_TYPE);
+ page_type = fil_page_get_type(tmp_page);
return (!decomp
|| (decomp != srv_page_size