diff -ruN a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
--- a/storage/innobase/btr/btr0btr.c 2010-11-03 07:01:13.000000000 +0900
+++ b/storage/innobase/btr/btr0btr.c 2010-12-04 15:38:18.110513593 +0900
-@@ -137,6 +137,12 @@
+@@ -691,6 +691,12 @@
root_page_no = dict_index_get_page(index);
block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
ut_a((ibool)!!page_is_comp(buf_block_get_frame(block))
== dict_table_is_comp(index->table));
#ifdef UNIV_BTR_DEBUG
-@@ -422,6 +428,12 @@
+@@ -977,6 +983,12 @@
root = btr_root_get(index, &mtr);
if (flag == BTR_N_LEAF_PAGES) {
seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
-@@ -869,6 +881,13 @@
+@@ -1433,6 +1445,13 @@
mtr_start(&mtr);
root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
+ root, space));
-@@ -891,6 +910,12 @@
+@@ -1455,6 +1474,12 @@
mtr_start(&mtr);
root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
+ root, space));
-@@ -924,6 +949,11 @@
+@@ -1488,6 +1513,11 @@
block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
page = buf_block_get_frame(block);
index = cursor->index;
zip_size = buf_block_get_zip_size(block);
-@@ -2924,6 +3002,11 @@
+@@ -2925,6 +3003,11 @@
block = btr_cur_get_block(cursor);
ut_ad(page_is_leaf(buf_block_get_frame(block)));
rec = btr_cur_get_rec(cursor);
-@@ -3627,6 +3710,11 @@
+@@ -3628,6 +3711,11 @@
page = btr_cur_get_page(&cursor);
switch (buf_block_get_state(block)) {
buf_page_t* bpage;
ibool success;
-@@ -3690,6 +3712,7 @@
+@@ -3693,6 +3715,7 @@
bpage->newest_modification = 0;
bpage->oldest_modification = 0;
HASH_INVALIDATE(bpage, hash);
#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
bpage->file_page_was_freed = FALSE;
#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
-@@ -4200,7 +4223,8 @@
+@@ -4203,7 +4226,8 @@
void
buf_page_io_complete(
/*=================*/
{
enum buf_io_fix io_type;
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
-@@ -4279,6 +4303,7 @@
+@@ -4282,6 +4306,7 @@
(ulong) bpage->offset);
}
/* From version 3.23.38 up we store the page checksum
to the 4 first bytes of the page end lsn field */
-@@ -4320,6 +4345,19 @@
+@@ -4323,6 +4348,19 @@
REFMAN "forcing-innodb-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
fputs("InnoDB: Ending processing because of"
" a corrupt database page.\n",
-@@ -4327,6 +4365,7 @@
+@@ -4330,6 +4368,7 @@
exit(1);
}
}
if (recv_recovery_is_on()) {
/* Pages must be uncompressed for crash recovery. */
-@@ -4336,8 +4375,11 @@
+@@ -4339,8 +4378,11 @@
if (uncompressed && !recv_no_ibuf_operations) {
ibuf_merge_or_delete_for_page(
size = btr_get_size(index, BTR_TOTAL_SIZE);
index->stat_index_size = size;
-@@ -4452,6 +4459,12 @@
+@@ -4480,6 +4487,12 @@
heap = mem_heap_create(1000);
while (index) {
/*===========================================*/
{
dict_table_t* sys_stats;
-@@ -4617,6 +4630,12 @@
+@@ -4666,6 +4679,12 @@
|| (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
&& dict_index_is_clust(index)))) {
ulint size;
size = btr_get_size(index, BTR_TOTAL_SIZE);
index->stat_index_size = size;
-@@ -5341,4 +5360,42 @@
+@@ -5462,4 +5481,42 @@
rw_lock_free(&dict_table_stats_latches[i]);
}
}
diff -ruN a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
--- a/storage/innobase/dict/dict0mem.c 2010-11-03 07:01:13.000000000 +0900
+++ b/storage/innobase/dict/dict0mem.c 2010-12-04 15:38:18.126549463 +0900
-@@ -94,6 +94,8 @@
+@@ -97,6 +97,8 @@
/* The number of transactions that are either waiting on the
AUTOINC lock or have been granted the lock. */
table->n_waiting_or_granted_auto_inc_locks = 0;
/* In sql_show we call with this flag: update
then statistics so that they are up-to-date */
-@@ -8429,10 +8510,18 @@
+@@ -8433,10 +8514,18 @@
THD* thd, /*!< in: connection thread handle */
HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
{
return(0);
}
-@@ -8614,6 +8703,10 @@
+@@ -8618,6 +8707,10 @@
my_error(ER_QUERY_INTERRUPTED, MYF(0));
}
DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
}
-@@ -9384,6 +9477,10 @@
+@@ -9388,6 +9481,10 @@
update_thd(thd);
if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
ut_print_timestamp(stderr);
fprintf(stderr,
-@@ -11781,6 +11878,25 @@
+@@ -11787,6 +11884,25 @@
"0 (the default) disables automatic dumps.",
NULL, NULL, 0, 0, UINT_MAX32, 0);
static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(additional_mem_pool_size),
MYSQL_SYSVAR(autoextend_increment),
-@@ -11867,6 +11983,7 @@
- MYSQL_SYSVAR(buffer_pool_restore_at_startup),
+@@ -11873,6 +11989,7 @@
MYSQL_SYSVAR(purge_threads),
MYSQL_SYSVAR(purge_batch_size),
+ MYSQL_SYSVAR(rollback_segments),
+ MYSQL_SYSVAR(corrupt_table_action),
NULL
};
/*********************************************************************//**
Gets the current size of buffer buf_pool in bytes.
@return size in bytes */
-@@ -617,6 +617,12 @@
+@@ -619,6 +619,12 @@
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
{
diff -ruN a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
--- a/storage/innobase/include/dict0dict.h 2010-12-03 17:30:16.306955940 +0900
+++ b/storage/innobase/include/dict0dict.h 2010-12-04 15:38:18.169513750 +0900
-@@ -1226,6 +1226,15 @@
+@@ -1245,6 +1245,15 @@
dict_close(void);
/*============*/
diff -ruN a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
--- a/storage/innobase/include/dict0mem.h 2010-11-03 07:01:13.000000000 +0900
+++ b/storage/innobase/include/dict0mem.h 2010-12-04 15:38:18.171513956 +0900
-@@ -625,6 +625,7 @@
+@@ -636,6 +636,7 @@
the AUTOINC lock on this table. */
/* @} */
/*----------------------*/
extern ulint srv_expand_import;
+extern ulint srv_pass_corrupt_table;
- extern ulint srv_extra_rsegments;
extern ulint srv_dict_size_limit;
+ /*-------------------------------------------*/
diff -ruN a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
--- a/storage/innobase/page/page0zip.c 2010-11-03 07:01:13.000000000 +0900
+++ b/storage/innobase/page/page0zip.c 2010-12-04 15:38:18.195515935 +0900
diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:37:50.602481253 +0900
+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:38:18.209513823 +0900
-@@ -434,6 +434,7 @@
+@@ -437,6 +437,7 @@
UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */
+UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */
- UNIV_INTERN ulint srv_extra_rsegments = 127; /* extra rseg for users */
UNIV_INTERN ulint srv_dict_size_limit = 0;
+ /*-------------------------------------------*/
diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
--- a/storage/innobase/srv/srv0start.c 2010-12-04 15:37:50.605491300 +0900
+++ b/storage/innobase/srv/srv0start.c 2010-12-04 15:38:18.212513722 +0900
-@@ -2144,6 +2144,13 @@
+@@ -2150,6 +2150,13 @@
os_fast_mutex_free(&srv_os_test_mutex);