Merge lp:~gaul/percona-data-recovery-tool-for-innodb/dulint-to-uint64_t into lp:percona-data-recovery-tool-for-innodb

Proposed by Andrew Gaul on 2012-08-23
Status: Needs review
Proposed branch: lp:~gaul/percona-data-recovery-tool-for-innodb/dulint-to-uint64_t
Merge into: lp:percona-data-recovery-tool-for-innodb
Diff against target: 41 lines (+7/-8)
1 file modified
page_printer.c (+7/-8)
To merge this branch: bzr merge lp:~gaul/percona-data-recovery-tool-for-innodb/dulint-to-uint64_t
Reviewer Review Type Date Requested Status
Percona developers 2012-08-23 Pending
Review via email: mp+120913@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

70. By Andrew Gaul <email address hidden> on 2012-08-23

Add dulint_to_uint64_t helper

Used several times in upcoming enhancements to page_printer.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'page_printer.c'
2--- page_printer.c 2012-08-09 20:35:20 +0000
3+++ page_printer.c 2012-08-23 05:06:25 +0000
4@@ -27,6 +27,11 @@
5
6 #define COLUMN_NAME_FMT "%-32s"
7
8+static uint64_t dulint_to_uint64_t(dulint tuple)
9+{
10+ return (((uint64_t) tuple.high) << 32) | tuple.low;
11+}
12+
13 static void print_page(uchar *p)
14 {
15 int type = mach_read_from_2(p + FIL_PAGE_TYPE);
16@@ -46,11 +51,8 @@
17 mach_read_from_4(p + FIL_PAGE_LSN));
18 printf(COLUMN_NAME_FMT " %ld\n", "FIL_PAGE_TYPE",
19 mach_read_from_2(p + FIL_PAGE_TYPE));
20- dulint flush_lsn_tuple = mach_read_from_6(p + FIL_PAGE_FILE_FLUSH_LSN);
21- uint64_t flush_lsn = (((uint64_t) flush_lsn_tuple.high) << 32) +
22- flush_lsn_tuple.low;
23 printf(COLUMN_NAME_FMT " %" PRIu64 "\n", "FIL_PAGE_FILE_FLUSH_LSN",
24- flush_lsn);
25+ dulint_to_uint64_t(mach_read_from_6(p + FIL_PAGE_FILE_FLUSH_LSN)));
26 printf(COLUMN_NAME_FMT " %ld\n", "FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID",
27 mach_read_from_4(p + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID));
28 printf(COLUMN_NAME_FMT " 0x%08lX\n", "FIL_PAGE_END_LSN_OLD_CHKSUM",
29@@ -69,11 +71,8 @@
30 mach_read_from_2(pd + PAGE_N_HEAP));
31 printf(COLUMN_NAME_FMT " 0x%lX\n", "PAGE_FREE",
32 mach_read_from_2(pd + PAGE_FREE));
33- dulint index_id_tuple = mach_read_from_8(pd + PAGE_INDEX_ID);
34- uint64_t index_id = (((uint64_t) index_id_tuple.high) << 32) +
35- index_id_tuple.low;
36 printf(COLUMN_NAME_FMT " %" PRIu64 "\n", "PAGE_INDEX_ID",
37- index_id);
38+ dulint_to_uint64_t(mach_read_from_8(pd + PAGE_INDEX_ID)));
39 printf(COLUMN_NAME_FMT " %ld\n", "PAGE_BTR_SEG_LEAF",
40 mach_read_from_4(pd + PAGE_BTR_SEG_LEAF + FSEG_HDR_SPACE));
41 printf(COLUMN_NAME_FMT " %ld\n", "PAGE_BTR_SEG_TOP",

Subscribers

People subscribed via source and target branches