summaryrefslogtreecommitdiff
path: root/storage/innobase/include/page0page.ic
diff options
context:
space:
mode:
authorJan Lindström <jplindst@mariadb.org>2015-01-19 12:39:17 +0200
committerJan Lindström <jplindst@mariadb.org>2015-01-19 12:39:17 +0200
commit2877c5ecc22ab0323ab86ce548a81909d7c865c8 (patch)
tree57dc4082002845ddc14b7bc01d4eb336f6ed11cf /storage/innobase/include/page0page.ic
parent7cb4a1c61f3327dbb86b6160ec2421bf827cea20 (diff)
downloadmariadb-git-2877c5ecc22ab0323ab86ce548a81909d7c865c8.tar.gz
MDEV-7477: Make innochecksum work on compressed tables
This patch ports the work that facebook has performed to make innochecksum handle compressed tables. the basic idea is to use actual innodb-code to perform checksum verification rather than duplicating in innochecksum.cc. to make this work, innodb code has been annotated with lots of #ifndef UNIV_INNOCHECKSUM so that it can be compiled outside of storage/innobase. A new testcase is also added that verifies that innochecksum works on compressed/non-compressed tables. Merged from commit fabc79d2ea976c4ff5b79bfe913e6bc03ef69d42 from https://code.google.com/p/google-mysql/ The actual steps to produce this patch are: take innochecksum from 5.6.14 apply changes in innodb from facebook patches needed to make innochecksum compile apply changes in innochecksum from facebook patches add handcrafted testcase The referenced facebook patches used are: https://github.com/facebook/mysql-5.6/commit/91e25120e75272db4cdbc07d0e45877d9dea5715 https://github.com/facebook/mysql-5.6/commit/847fe76ea5239b09fa361b023c56e6be76d32046 https://github.com/facebook/mysql-5.6/commit/1135628a5a9b3412621b93233478f3804bcef51a https://github.com/facebook/mysql-5.6/commit/4dbf7c240ce2f08b7d6572d9452c9779ce90641c
Diffstat (limited to 'storage/innobase/include/page0page.ic')
-rw-r--r--storage/innobase/include/page0page.ic19
1 files changed, 18 insertions, 1 deletions
diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic
index 9b81156708f..99e17001c0a 100644
--- a/storage/innobase/include/page0page.ic
+++ b/storage/innobase/include/page0page.ic
@@ -23,6 +23,8 @@ Index page routines
Created 2/2/1994 Heikki Tuuri
*******************************************************/
+#ifndef UNIV_INNOCHECKSUM
+
#include "mach0data.h"
#ifdef UNIV_DEBUG
# include "log0recv.h"
@@ -38,6 +40,7 @@ Created 2/2/1994 Heikki Tuuri
#define UNIV_INLINE
#endif
+#endif /* !UNIV_INNOCHECKSUM */
/************************************************************//**
Gets the start of a page.
@return start of the page */
@@ -49,6 +52,7 @@ page_align(
{
return((page_t*) ut_align_down(ptr, UNIV_PAGE_SIZE));
}
+#ifndef UNIV_INNOCHECKSUM
/************************************************************//**
Gets the offset within a page.
@return offset from the start of the page */
@@ -103,6 +107,7 @@ page_update_max_trx_id(
}
}
+#endif /* !UNIV_INNOCHECKSUM */
/*************************************************************//**
Reads the given header field. */
UNIV_INLINE
@@ -118,6 +123,7 @@ page_header_get_field(
return(mach_read_from_2(page + PAGE_HEADER + field));
}
+#ifndef UNIV_INNOCHECKSUM
/*************************************************************//**
Sets the given header field. */
UNIV_INLINE
@@ -223,6 +229,7 @@ page_header_reset_last_insert(
}
#endif /* !UNIV_HOTBACKUP */
+#endif /* !UNIV_INNOCHECKSUM */
/************************************************************//**
Determine whether the page is in new-style compact format.
@return nonzero if the page is in compact format, zero if it is in
@@ -236,6 +243,7 @@ page_is_comp(
return(page_header_get_field(page, PAGE_N_HEAP) & 0x8000);
}
+#ifndef UNIV_INNOCHECKSUM
/************************************************************//**
TRUE if the record is on a page in compact format.
@return nonzero if in compact format */
@@ -264,6 +272,7 @@ page_rec_get_heap_no(
}
}
+#endif /* !UNIV_INNOCHECKSUM */
/************************************************************//**
Determine whether the page is a B-tree leaf.
@return true if the page is a B-tree leaf (PAGE_LEVEL = 0) */
@@ -276,6 +285,7 @@ page_is_leaf(
return(!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));
}
+#ifndef UNIV_INNOCHECKSUM
/************************************************************//**
Determine whether the page is empty.
@return true if the page is empty (PAGE_N_RECS = 0) */
@@ -529,6 +539,7 @@ page_cmp_dtuple_rec_with_match(
}
#endif /* !UNIV_HOTBACKUP */
+#endif /* !UNIV_INNOCHECKSUM */
/*************************************************************//**
Gets the page number.
@return page number */
@@ -542,6 +553,7 @@ page_get_page_no(
return(mach_read_from_4(page + FIL_PAGE_OFFSET));
}
+#ifndef UNIV_INNOCHECKSUM
/*************************************************************//**
Gets the tablespace identifier.
@return space id */
@@ -555,6 +567,7 @@ page_get_space_id(
return(mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID));
}
+#endif /* !UNIV_INNOCHECKSUM */
/*************************************************************//**
Gets the number of user records on page (infimum and supremum records
are not user records).
@@ -568,6 +581,7 @@ page_get_n_recs(
return(page_header_get_field(page, PAGE_N_RECS));
}
+#ifndef UNIV_INNOCHECKSUM
/*************************************************************//**
Gets the number of dir slots in directory.
@return number of slots */
@@ -958,6 +972,7 @@ page_rec_get_base_extra_size(
return(REC_N_NEW_EXTRA_BYTES + (ulint) !page_rec_is_comp(rec));
}
+#endif /* !UNIV_INNOCHECKSUM */
/************************************************************//**
Returns the sum of the sizes of the records in the record list, excluding
the infimum and supremum records.
@@ -981,7 +996,7 @@ page_get_data_size(
return(ret);
}
-
+#ifndef UNIV_INNOCHECKSUM
/************************************************************//**
Allocates a block of memory from the free list of an index page. */
UNIV_INLINE
@@ -1170,6 +1185,8 @@ page_mem_free(
}
}
+#endif /* !UNIV_INNOCHECKSUM */
+
#ifdef UNIV_MATERIALIZE
#undef UNIV_INLINE
#define UNIV_INLINE UNIV_INLINE_ORIGINAL