summaryrefslogtreecommitdiff
path: root/storage/xtradb/fsp
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2010-04-28 16:35:00 +0200
committerunknown <knielsen@knielsen-hq.org>2010-04-28 16:35:00 +0200
commit15f39b523445ce52fb1e737765bc61544983d56c (patch)
tree38427051e417a093270aa5047e4b044c82bca805 /storage/xtradb/fsp
parentfc5fbd4d311a936f66d855b6fe78169b017faeff (diff)
parent3e4d2be619d1d67f6d7405514295d4faf21d39c5 (diff)
downloadmariadb-git-15f39b523445ce52fb1e737765bc61544983d56c.tar.gz
Merge XtraDB 10 into MariaDB.
Diffstat (limited to 'storage/xtradb/fsp')
-rw-r--r--storage/xtradb/fsp/fsp0fsp.c66
1 files changed, 55 insertions, 11 deletions
diff --git a/storage/xtradb/fsp/fsp0fsp.c b/storage/xtradb/fsp/fsp0fsp.c
index 3cc4318fc06..3b888f292a7 100644
--- a/storage/xtradb/fsp/fsp0fsp.c
+++ b/storage/xtradb/fsp/fsp0fsp.c
@@ -370,6 +370,12 @@ fsp_get_space_header(
ut_ad(id || !zip_size);
block = buf_page_get(id, zip_size, 0, RW_X_LATCH, mtr);
+
+ if (srv_pass_corrupt_table && !block) {
+ return(0);
+ }
+ ut_a(block);
+
header = FSP_HEADER_OFFSET + buf_block_get_frame(block);
buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
@@ -652,15 +658,16 @@ xdes_calc_descriptor_page(
ulint offset) /*!< in: page offset */
{
#ifndef DOXYGEN /* Doxygen gets confused of these */
-# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
- + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
-# error
-# endif
+//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
+// + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
+//# error
+//# endif
# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
+ (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
# error
# endif
#endif /* !DOXYGEN */
+ ut_a(UNIV_PAGE_SIZE > XDES_ARR_OFFSET + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
ut_ad(ut_is_2pow(zip_size));
if (!zip_size) {
@@ -788,6 +795,12 @@ xdes_get_descriptor(
fsp_header_t* sp_header;
block = buf_page_get(space, zip_size, 0, RW_X_LATCH, mtr);
+
+ if (srv_pass_corrupt_table && !block) {
+ return(0);
+ }
+ ut_a(block);
+
buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
sp_header = FSP_HEADER_OFFSET + buf_block_get_frame(block);
@@ -1457,12 +1470,12 @@ fsp_fill_free_list(
mtr);
xdes_init(descr, mtr);
-#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
-# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
-#endif
-#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
-# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
-#endif
+//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
+//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
+//#endif
+//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
+//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
+//#endif
if (UNIV_UNLIKELY(init_xdes)) {
@@ -1871,6 +1884,11 @@ fsp_seg_inode_page_find_free(
{
fseg_inode_t* inode;
+ if (srv_pass_corrupt_table && !page) {
+ return(ULINT_UNDEFINED);
+ }
+ ut_a(page);
+
for (; i < FSP_SEG_INODES_PER_PAGE(zip_size); i++) {
inode = fsp_seg_inode_page_get_nth_inode(
@@ -1984,6 +2002,11 @@ fsp_alloc_seg_inode(
page = buf_block_get_frame(block);
+ if (srv_pass_corrupt_table && !page) {
+ return(0);
+ }
+ ut_a(page);
+
n = fsp_seg_inode_page_find_free(page, 0, zip_size, mtr);
ut_a(n != ULINT_UNDEFINED);
@@ -2077,6 +2100,11 @@ fseg_inode_try_get(
inode = fut_get_ptr(space, zip_size, inode_addr, RW_X_LATCH, mtr);
+ if (srv_pass_corrupt_table && !inode) {
+ return(0);
+ }
+ ut_a(inode);
+
if (UNIV_UNLIKELY
(ut_dulint_is_zero(mach_read_from_8(inode + FSEG_ID)))) {
@@ -2104,7 +2132,7 @@ fseg_inode_get(
{
fseg_inode_t* inode
= fseg_inode_try_get(header, space, zip_size, mtr);
- ut_a(inode);
+ ut_a(srv_pass_corrupt_table || inode);
return(inode);
}
@@ -3263,6 +3291,11 @@ fseg_free_page_low(
descr = xdes_get_descriptor(space, zip_size, page, mtr);
+ if (srv_pass_corrupt_table && !descr) {
+ /* The page may be corrupt. pass it. */
+ return;
+ }
+
ut_a(descr);
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)) {
fputs("InnoDB: Dump of the tablespace extent descriptor: ",
@@ -3515,6 +3548,11 @@ fseg_free_step(
descr = xdes_get_descriptor(space, zip_size, header_page, mtr);
+ if (srv_pass_corrupt_table && !descr) {
+ /* The page may be corrupt. pass it. */
+ return(TRUE);
+ }
+
/* Check that the header resides on a page which has not been
freed yet */
@@ -3599,6 +3637,12 @@ fseg_free_step_not_header(
inode = fseg_inode_get(header, space, zip_size, mtr);
+ if (srv_pass_corrupt_table && !inode) {
+ /* ignore the corruption */
+ return(TRUE);
+ }
+ ut_a(inode);
+
descr = fseg_get_first_extent(inode, space, zip_size, mtr);
if (descr != NULL) {