Merge lp:~stewart/percona-server/5.5.13-merge into lp:percona-server/5.5

Proposed by Stewart Smith
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 122
Proposed branch: lp:~stewart/percona-server/5.5.13-merge
Merge into: lp:percona-server/5.5
Diff against target: 11671 lines (+7079/-693)
63 files modified
Makefile (+2/-2)
control_online_alter_index.patch (+1/-1)
innodb_adaptive_hash_index_partitions.patch (+45/-27)
innodb_admin_command_base.patch (+1/-1)
innodb_buffer_pool_pages_i_s.patch (+3/-3)
innodb_buffer_pool_shm.patch (+7/-7)
innodb_deadlock_count.patch (+3/-3)
innodb_dict_size_limit.patch (+10/-10)
innodb_expand_import.patch (+597/-87)
innodb_extend_slow.patch (+35/-34)
innodb_extra_rseg.patch (+1/-1)
innodb_fake_changes.patch (+614/-0)
innodb_fast_checksum.patch (+33/-46)
innodb_files_extend.patch (+15/-24)
innodb_fix_misc.patch (+39/-39)
innodb_io_patches.patch (+39/-38)
innodb_lru_dump_restore.patch (+8/-8)
innodb_overwrite_relay_log_info.patch (+17/-18)
innodb_pass_corrupt_table.patch (+106/-100)
innodb_recovery_patches.patch (+10/-10)
innodb_separate_doublewrite.patch (+34/-34)
innodb_show_lock_name.patch (+6/-6)
innodb_show_status.patch (+15/-15)
innodb_show_status_extend.patch (+8/-8)
innodb_show_sys_tables.patch (+1/-1)
innodb_split_buf_pool_mutex.patch (+37/-26)
innodb_stats.patch (+31/-25)
innodb_thread_concurrency_timer_based.patch (+7/-7)
install_tests.sh.THIS (+35/-0)
log_connection_error.patch (+3/-3)
log_warnings_suppress.patch (+3/-3)
memory_dynamic_rows.patch (+2865/-0)
microsec_process.patch (+1/-1)
mysql-test/memory_dynamic_rows.patch/percona_heap_blob.result (+952/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_blob.test.disabled (+642/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug783366.result (+14/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug783366.test.disabled (+19/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug783451.result (+132/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug783451.test.disabled (+16/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug784464.result (+70/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug784464.test.disabled (+67/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug784468.result (+15/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug784468.test.disabled (+16/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug788544.result (+9/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug788544.test.disabled (+15/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug788576.result (+19/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug788576.test.disabled (+19/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug788722.result (+18/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug788722.test.disabled (+20/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug789131.result (+7/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_bug789131.test.disabled (+14/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_var.result (+194/-0)
mysql-test/memory_dynamic_rows.patch/percona_heap_var.test.disabled (+84/-0)
normalize_patches.sh (+1/-1)
optimizer_fix.patch (+2/-2)
processlist_row_stats.patch (+2/-2)
query_cache_enhance.patch (+2/-2)
response_time_distribution.patch (+8/-8)
show_slave_status_nolock.patch (+1/-1)
show_temp.patch (+6/-6)
slow_extended.patch (+17/-17)
sql_no_fcache.patch (+8/-8)
userstat.patch (+58/-58)
To merge this branch: bzr merge lp:~stewart/percona-server/5.5.13-merge
Reviewer Review Type Date Requested Status
Oleg Tsarev (community) dev Needs Fixing
Percona developers Pending
Review via email: mp+65167@code.launchpad.net

Description of the change

Merge of Yasufumi and Oleg merging patches to MySQL 5.5.13 base. Only patches that already in 5.5.12

http://jenkins.percona.com/job/percona-server-5.5-param/4/

passes as well as lp:percona-server does (better really)

To post a comment you must log in.
Revision history for this message
Oleg Tsarev (tsarev) wrote :
review: Needs Fixing (dev)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2011-05-18 00:03:53 +0000
+++ Makefile 2011-06-20 09:04:39 +0000
@@ -1,7 +1,7 @@
1FETCH_CMD=wget1FETCH_CMD=wget
2MASTER_SITE=http://www.percona.com/downloads/community2MASTER_SITE=http://www.percona.com/downloads/community
3MYSQL_VERSION=5.5.123MYSQL_VERSION=5.5.13
4PERCONA_SERVER_VERSION=rel20.34PERCONA_SERVER_VERSION=rel20.4
5PERCONA_SERVER ?=Percona-Server-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)5PERCONA_SERVER ?=Percona-Server-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)
6DEBUG_DIR ?= $(PERCONA_SERVER)-debug6DEBUG_DIR ?= $(PERCONA_SERVER)-debug
7RELEASE_DIR ?= $(PERCONA_SERVER)-release7RELEASE_DIR ?= $(PERCONA_SERVER)-release
88
=== modified file 'control_online_alter_index.patch'
--- control_online_alter_index.patch 2011-05-10 11:57:42 +0000
+++ control_online_alter_index.patch 2011-06-20 09:04:39 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/sql/handler.h b/sql/handler.h8diff -ruN a/sql/handler.h b/sql/handler.h
9--- a/sql/handler.h 2010-11-03 07:01:14.000000000 +09009--- a/sql/handler.h 2010-11-03 07:01:14.000000000 +0900
10+++ b/sql/handler.h 2010-12-03 13:51:04.727293058 +090010+++ b/sql/handler.h 2010-12-03 13:51:04.727293058 +0900
11@@ -203,6 +203,8 @@11@@ -205,6 +205,8 @@
12 #define HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE (1L << 9)12 #define HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE (1L << 9)
13 #define HA_INPLACE_ADD_PK_INDEX_NO_WRITE (1L << 10)13 #define HA_INPLACE_ADD_PK_INDEX_NO_WRITE (1L << 10)
14 #define HA_INPLACE_DROP_PK_INDEX_NO_WRITE (1L << 11)14 #define HA_INPLACE_DROP_PK_INDEX_NO_WRITE (1L << 11)
1515
=== modified file 'innodb_adaptive_hash_index_partitions.patch'
--- innodb_adaptive_hash_index_partitions.patch 2011-06-03 13:00:05 +0000
+++ innodb_adaptive_hash_index_partitions.patch 2011-06-20 09:04:39 +0000
@@ -516,7 +516,7 @@
516+ }516+ }
517+ if (UNIV_LIKELY(!block->is_hashed)) {517+ if (UNIV_LIKELY(!block->is_hashed)) {
518+ rw_lock_s_unlock(btr_search_latch);518+ rw_lock_s_unlock(btr_search_latch);
519+ return;519+ goto retry;
520+ }520+ }
521+ index = block->index;521+ index = block->index;
522+ ut_a(btr_search_latch == btr_search_get_latch(index->id));522+ ut_a(btr_search_latch == btr_search_get_latch(index->id));
@@ -1008,7 +1008,7 @@
1008 #endif /* UNIV_SYNC_DEBUG */1008 #endif /* UNIV_SYNC_DEBUG */
1009 ut_ad(!btr_search_enabled);1009 ut_ad(!btr_search_enabled);
1010 1010
1011@@ -2633,6 +2638,7 @@1011@@ -2632,6 +2637,7 @@
1012 {1012 {
1013 block->check_index_page_at_flush = FALSE;1013 block->check_index_page_at_flush = FALSE;
1014 block->index = NULL;1014 block->index = NULL;
@@ -1019,7 +1019,7 @@
1019diff -ruN a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c1019diff -ruN a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
1020--- a/storage/innobase/buf/buf0lru.c 2010-12-04 15:35:29.137347521 +09001020--- a/storage/innobase/buf/buf0lru.c 2010-12-04 15:35:29.137347521 +0900
1021+++ b/storage/innobase/buf/buf0lru.c 2010-12-04 16:12:48.658550840 +09001021+++ b/storage/innobase/buf/buf0lru.c 2010-12-04 16:12:48.658550840 +0900
1022@@ -1796,7 +1796,7 @@1022@@ -1798,7 +1798,7 @@
1023 1023
1024 UNIV_MEM_VALID(((buf_block_t*) bpage)->frame,1024 UNIV_MEM_VALID(((buf_block_t*) bpage)->frame,
1025 UNIV_PAGE_SIZE);1025 UNIV_PAGE_SIZE);
@@ -1031,7 +1031,7 @@
1031diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c1031diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
1032--- a/storage/innobase/dict/dict0dict.c 2010-12-04 15:52:23.398513916 +09001032--- a/storage/innobase/dict/dict0dict.c 2010-12-04 15:52:23.398513916 +0900
1033+++ b/storage/innobase/dict/dict0dict.c 2010-12-04 16:12:48.662550715 +09001033+++ b/storage/innobase/dict/dict0dict.c 2010-12-04 16:12:48.662550715 +0900
1034@@ -1812,7 +1812,7 @@1034@@ -1811,7 +1811,7 @@
1035 zero. */1035 zero. */
1036 1036
1037 for (;;) {1037 for (;;) {
@@ -1056,19 +1056,19 @@
1056diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc1056diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
1057--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 16:12:20.185850734 +09001057--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 16:12:20.185850734 +0900
1058+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 16:12:48.674552412 +09001058+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 16:12:48.674552412 +0900
1059@@ -11695,6 +11695,11 @@1059@@ -11702,6 +11702,11 @@
1060 "Disable with --skip-innodb-adaptive-hash-index.",1060 "Disable with --skip-innodb-adaptive-hash-index.",
1061 NULL, innodb_adaptive_hash_index_update, TRUE);1061 NULL, innodb_adaptive_hash_index_update, TRUE);
1062 1062
1063+static MYSQL_SYSVAR_ULONG(adaptive_hash_index_partitions, btr_search_index_num,1063+static MYSQL_SYSVAR_ULONG(adaptive_hash_index_partitions, btr_search_index_num,
1064+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,1064+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
1065+ "Number of InnoDB adaptive hash index partitions (default 1: disable partitioning)",1065+ "Number of InnoDB adaptive hash index partitions (default 1: disable partitioning)",
1066+ NULL, NULL, 1, 1, 32, 0);1066+ NULL, NULL, 1, 1, sizeof(ulint) * 8, 0);
1067+1067+
1068 static MYSQL_SYSVAR_ULONG(replication_delay, srv_replication_delay,1068 static MYSQL_SYSVAR_ULONG(replication_delay, srv_replication_delay,
1069 PLUGIN_VAR_RQCMDARG,1069 PLUGIN_VAR_RQCMDARG,
1070 "Replication thread delay (ms) on the slave server if "1070 "Replication thread delay (ms) on the slave server if "
1071@@ -12060,6 +12065,7 @@1071@@ -12068,6 +12073,7 @@
1072 MYSQL_SYSVAR(use_sys_stats_table),1072 MYSQL_SYSVAR(use_sys_stats_table),
1073 MYSQL_SYSVAR(stats_sample_pages),1073 MYSQL_SYSVAR(stats_sample_pages),
1074 MYSQL_SYSVAR(adaptive_hash_index),1074 MYSQL_SYSVAR(adaptive_hash_index),
@@ -1264,7 +1264,7 @@
1264diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h1264diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
1265--- a/storage/innobase/include/buf0buf.h 2010-12-15 19:00:07.713604580 +09001265--- a/storage/innobase/include/buf0buf.h 2010-12-15 19:00:07.713604580 +0900
1266+++ b/storage/innobase/include/buf0buf.h 2010-12-15 20:58:03.546839883 +09001266+++ b/storage/innobase/include/buf0buf.h 2010-12-15 20:58:03.546839883 +0900
1267@@ -1547,7 +1547,7 @@1267@@ -1546,7 +1546,7 @@
1268 pointers in the adaptive hash index1268 pointers in the adaptive hash index
1269 pointing to this frame */1269 pointing to this frame */
1270 #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */1270 #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
@@ -1273,7 +1273,7 @@
1273 already been built on this1273 already been built on this
1274 page; note that it does not1274 page; note that it does not
1275 guarantee that the index is1275 guarantee that the index is
1276@@ -1561,6 +1561,7 @@1276@@ -1560,6 +1560,7 @@
1277 unsigned curr_left_side:1;/*!< TRUE or FALSE in hash indexing */1277 unsigned curr_left_side:1;/*!< TRUE or FALSE in hash indexing */
1278 dict_index_t* index; /*!< Index for which the adaptive1278 dict_index_t* index; /*!< Index for which the adaptive
1279 hash index has been created. */1279 hash index has been created. */
@@ -1389,7 +1389,7 @@
1389 #ifdef UNIV_SEARCH_DEBUG1389 #ifdef UNIV_SEARCH_DEBUG
1390 ulint cnt = 0;1390 ulint cnt = 0;
1391 #endif /* UNIV_SEARCH_DEBUG */1391 #endif /* UNIV_SEARCH_DEBUG */
1392@@ -3441,18 +3443,32 @@1392@@ -3446,18 +3448,33 @@
1393 /* PHASE 0: Release a possible s-latch we are holding on the1393 /* PHASE 0: Release a possible s-latch we are holding on the
1394 adaptive hash index latch if there is someone waiting behind */1394 adaptive hash index latch if there is someone waiting behind */
1395 1395
@@ -1397,9 +1397,9 @@
1397- && trx->has_search_latch) {1397- && trx->has_search_latch) {
1398+ should_release = 0;1398+ should_release = 0;
1399+ for (i = 0; i < btr_search_index_num; i++) {1399+ for (i = 0; i < btr_search_index_num; i++) {
1400+ if ((trx->has_search_latch & ((ulint)1 << i))1400+ /* we should check all latches (fix Bug#791030) */
1401+ && rw_lock_get_writer(btr_search_latch_part[i])1401+ if (rw_lock_get_writer(btr_search_latch_part[i])
1402+ != RW_LOCK_NOT_LOCKED) {1402+ != RW_LOCK_NOT_LOCKED) {
1403+ should_release |= ((ulint)1 << i);1403+ should_release |= ((ulint)1 << i);
1404+ }1404+ }
1405+ }1405+ }
@@ -1414,9 +1414,10 @@
1414- rw_lock_s_unlock(&btr_search_latch);1414- rw_lock_s_unlock(&btr_search_latch);
1415- trx->has_search_latch = FALSE;1415- trx->has_search_latch = FALSE;
1416+ for (i = 0; i < btr_search_index_num; i++) {1416+ for (i = 0; i < btr_search_index_num; i++) {
1417+ if (should_release & ((ulint)1 << i)) {1417+ /* we should release all s-latches (fix Bug#791030) */
1418+ if (trx->has_search_latch & ((ulint)1 << i)) {
1418+ rw_lock_s_unlock(btr_search_latch_part[i]);1419+ rw_lock_s_unlock(btr_search_latch_part[i]);
1419+ trx->has_search_latch &= ~((ulint)1 << i);1420+ trx->has_search_latch &= (~((ulint)1 << i));
1420+ }1421+ }
1421+ }1422+ }
1422 1423
@@ -1426,7 +1427,7 @@
1426 }1427 }
1427 1428
1428 /* Reset the new record lock info if srv_locks_unsafe_for_binlog1429 /* Reset the new record lock info if srv_locks_unsafe_for_binlog
1429@@ -3603,9 +3619,11 @@1430@@ -3608,9 +3625,28 @@
1430 hash index semaphore! */1431 hash index semaphore! */
1431 1432
1432 #ifndef UNIV_SEARCH_DEBUG1433 #ifndef UNIV_SEARCH_DEBUG
@@ -1435,13 +1436,30 @@
1435- trx->has_search_latch = TRUE;1436- trx->has_search_latch = TRUE;
1436+ if (!(trx->has_search_latch1437+ if (!(trx->has_search_latch
1437+ & ((ulint)1 << (index->id % btr_search_index_num)))) {1438+ & ((ulint)1 << (index->id % btr_search_index_num)))) {
1438+ rw_lock_s_lock(btr_search_get_latch(index->id));1439+ if (trx->has_search_latch
1439+ trx->has_search_latch |=1440+ < ((ulint)1 << (index->id % btr_search_index_num))) {
1440+ (ulint)1 << (index->id % btr_search_index_num);1441+ rw_lock_s_lock(btr_search_get_latch(index->id));
1442+ trx->has_search_latch |=
1443+ ((ulint)1 << (index->id % btr_search_index_num));
1444+ } else {
1445+ /* should re-lock to obay latch-order */
1446+ for (i = 0; i < btr_search_index_num; i++) {
1447+ if (trx->has_search_latch & ((ulint)1 << i)) {
1448+ rw_lock_s_unlock(btr_search_latch_part[i]);
1449+ }
1450+ }
1451+ trx->has_search_latch |=
1452+ ((ulint)1 << (index->id % btr_search_index_num));
1453+ for (i = 0; i < btr_search_index_num; i++) {
1454+ if (trx->has_search_latch & ((ulint)1 << i)) {
1455+ rw_lock_s_lock(btr_search_latch_part[i]);
1456+ }
1457+ }
1458+ }
1441 }1459 }
1442 #endif1460 #endif
1443 switch (row_sel_try_search_shortcut_for_mysql(1461 switch (row_sel_try_search_shortcut_for_mysql(
1444@@ -3666,7 +3684,11 @@1462@@ -3671,7 +3707,11 @@
1445 1463
1446 trx->search_latch_timeout--;1464 trx->search_latch_timeout--;
1447 1465
@@ -1454,7 +1472,7 @@
1454 trx->has_search_latch = FALSE;1472 trx->has_search_latch = FALSE;
1455 }1473 }
1456 1474
1457@@ -3690,7 +3712,12 @@1475@@ -3695,7 +3735,12 @@
1458 /* PHASE 3: Open or restore index cursor position */1476 /* PHASE 3: Open or restore index cursor position */
1459 1477
1460 if (trx->has_search_latch) {1478 if (trx->has_search_latch) {
@@ -1471,7 +1489,7 @@
1471diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c1489diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
1472--- a/storage/innobase/srv/srv0srv.c 2010-12-04 16:12:20.231484679 +09001490--- a/storage/innobase/srv/srv0srv.c 2010-12-04 16:12:20.231484679 +0900
1473+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 16:12:48.726551018 +09001491+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 16:12:48.726551018 +0900
1474@@ -2035,7 +2035,9 @@1492@@ -2045,7 +2045,9 @@
1475 "-------------------------------------\n", file);1493 "-------------------------------------\n", file);
1476 ibuf_print(file);1494 ibuf_print(file);
1477 1495
@@ -1482,7 +1500,7 @@
1482 1500
1483 fprintf(file,1501 fprintf(file,
1484 "%.2f hash searches/s, %.2f non-hash searches/s\n",1502 "%.2f hash searches/s, %.2f non-hash searches/s\n",
1485@@ -2060,14 +2062,15 @@1503@@ -2070,14 +2072,15 @@
1486 ut_total_allocated_memory,1504 ut_total_allocated_memory,
1487 mem_pool_get_reserved(mem_comm_pool));1505 mem_pool_get_reserved(mem_comm_pool));
1488 /* Calcurate reserved memories */1506 /* Calcurate reserved memories */
@@ -1502,7 +1520,7 @@
1502 1520
1503 lock_sys_subtotal = 0;1521 lock_sys_subtotal = 0;
1504 if (trx_sys) {1522 if (trx_sys) {
1505@@ -2093,10 +2096,10 @@1523@@ -2103,10 +2106,10 @@
1506 " Recovery system %lu \t(%lu + %lu)\n",1524 " Recovery system %lu \t(%lu + %lu)\n",
1507 1525
1508 (ulong) (btr_search_sys1526 (ulong) (btr_search_sys
@@ -1518,7 +1536,7 @@
1518diff -ruN a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c1536diff -ruN a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
1519--- a/storage/innobase/sync/sync0sync.c 2010-12-03 17:36:44.300986571 +09001537--- a/storage/innobase/sync/sync0sync.c 2010-12-03 17:36:44.300986571 +0900
1520+++ b/storage/innobase/sync/sync0sync.c 2010-12-04 16:12:48.729513564 +09001538+++ b/storage/innobase/sync/sync0sync.c 2010-12-04 16:12:48.729513564 +0900
1521@@ -1178,7 +1178,6 @@1539@@ -1223,7 +1223,6 @@
1522 case SYNC_OUTER_ANY_LATCH:1540 case SYNC_OUTER_ANY_LATCH:
1523 case SYNC_FILE_FORMAT_TAG:1541 case SYNC_FILE_FORMAT_TAG:
1524 case SYNC_DOUBLEWRITE:1542 case SYNC_DOUBLEWRITE:
@@ -1526,7 +1544,7 @@
1526 case SYNC_SEARCH_SYS_CONF:1544 case SYNC_SEARCH_SYS_CONF:
1527 case SYNC_TRX_LOCK_HEAP:1545 case SYNC_TRX_LOCK_HEAP:
1528 case SYNC_KERNEL:1546 case SYNC_KERNEL:
1529@@ -1199,6 +1198,7 @@1547@@ -1244,6 +1243,7 @@
1530 ut_error;1548 ut_error;
1531 }1549 }
1532 break;1550 break;
@@ -1537,7 +1555,7 @@
1537diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c1555diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
1538--- a/storage/innobase/trx/trx0trx.c 2010-12-03 17:49:11.623953784 +09001556--- a/storage/innobase/trx/trx0trx.c 2010-12-03 17:49:11.623953784 +0900
1539+++ b/storage/innobase/trx/trx0trx.c 2010-12-04 16:12:48.731513275 +09001557+++ b/storage/innobase/trx/trx0trx.c 2010-12-04 16:12:48.731513275 +0900
1540@@ -266,8 +266,14 @@1558@@ -265,8 +265,14 @@
1541 /*=================================*/1559 /*=================================*/
1542 trx_t* trx) /*!< in: transaction */1560 trx_t* trx) /*!< in: transaction */
1543 {1561 {
15441562
=== modified file 'innodb_admin_command_base.patch'
--- innodb_admin_command_base.patch 2011-05-23 03:13:18 +0000
+++ innodb_admin_command_base.patch 2011-06-20 09:04:39 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc8diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
9--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:32:15.624039043 +09009--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:32:15.624039043 +0900
10+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:32:35.424957827 +090010+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:32:35.424957827 +0900
11@@ -11856,7 +11856,8 @@11@@ -11863,7 +11863,8 @@
12 i_s_innodb_sys_foreign_cols,12 i_s_innodb_sys_foreign_cols,
13 i_s_innodb_sys_stats,13 i_s_innodb_sys_stats,
14 i_s_innodb_table_stats,14 i_s_innodb_table_stats,
1515
=== modified file 'innodb_buffer_pool_pages_i_s.patch'
--- innodb_buffer_pool_pages_i_s.patch 2011-05-23 03:13:18 +0000
+++ innodb_buffer_pool_pages_i_s.patch 2011-06-20 09:04:39 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c8diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
9--- a/storage/innobase/buf/buf0buf.c 2010-12-04 20:20:44.595483291 +09009--- a/storage/innobase/buf/buf0buf.c 2010-12-04 20:20:44.595483291 +0900
10+++ b/storage/innobase/buf/buf0buf.c 2010-12-06 19:28:04.055227506 +090010+++ b/storage/innobase/buf/buf0buf.c 2010-12-06 19:28:04.055227506 +0900
11@@ -4536,6 +4536,36 @@11@@ -4537,6 +4537,36 @@
12 mutex_exit(block_mutex);12 mutex_exit(block_mutex);
13 }13 }
14 14
@@ -48,7 +48,7 @@
48diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc48diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
49--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 20:20:44.614551139 +090049--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 20:20:44.614551139 +0900
50+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-06 19:23:47.622195800 +090050+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-06 19:23:47.622195800 +0900
51@@ -12140,6 +12140,9 @@51@@ -12148,6 +12148,9 @@
52 i_s_innodb_sys_stats,52 i_s_innodb_sys_stats,
53 i_s_innodb_table_stats,53 i_s_innodb_table_stats,
54 i_s_innodb_index_stats,54 i_s_innodb_index_stats,
@@ -786,7 +786,7 @@
786diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h786diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
787--- a/storage/innobase/include/buf0buf.h 2010-12-04 19:46:40.197471531 +0900787--- a/storage/innobase/include/buf0buf.h 2010-12-04 19:46:40.197471531 +0900
788+++ b/storage/innobase/include/buf0buf.h 2010-12-06 19:23:47.638195824 +0900788+++ b/storage/innobase/include/buf0buf.h 2010-12-06 19:23:47.638195824 +0900
789@@ -1145,6 +1145,14 @@789@@ -1144,6 +1144,14 @@
790 /*===========*/790 /*===========*/
791 const buf_pool_t* buf_pool) /*!< in: buffer pool */791 const buf_pool_t* buf_pool) /*!< in: buffer pool */
792 __attribute__((nonnull, const));792 __attribute__((nonnull, const));
793793
=== modified file 'innodb_buffer_pool_shm.patch'
--- innodb_buffer_pool_shm.patch 2011-05-10 11:57:42 +0000
+++ innodb_buffer_pool_shm.patch 2011-06-20 09:04:39 +0000
@@ -742,7 +742,7 @@
742 742
743 743
744 static char* internal_innobase_data_file_path = NULL;744 static char* internal_innobase_data_file_path = NULL;
745@@ -2656,6 +2657,14 @@745@@ -2670,6 +2671,14 @@
746 srv_buf_pool_size = (ulint) innobase_buffer_pool_size;746 srv_buf_pool_size = (ulint) innobase_buffer_pool_size;
747 srv_buf_pool_instances = (ulint) innobase_buffer_pool_instances;747 srv_buf_pool_instances = (ulint) innobase_buffer_pool_instances;
748 748
@@ -757,7 +757,7 @@
757 srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;757 srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
758 758
759 srv_n_file_io_threads = (ulint) innobase_file_io_threads;759 srv_n_file_io_threads = (ulint) innobase_file_io_threads;
760@@ -2672,6 +2681,7 @@760@@ -2686,6 +2695,7 @@
761 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;761 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
762 srv_use_checksums = (ibool) innobase_use_checksums;762 srv_use_checksums = (ibool) innobase_use_checksums;
763 srv_fast_checksum = (ibool) innobase_fast_checksum;763 srv_fast_checksum = (ibool) innobase_fast_checksum;
@@ -765,7 +765,7 @@
765 765
766 #ifdef HAVE_LARGE_PAGES766 #ifdef HAVE_LARGE_PAGES
767 if ((os_use_large_pages = (ibool) my_use_large_pages))767 if ((os_use_large_pages = (ibool) my_use_large_pages))
768@@ -11726,6 +11736,16 @@768@@ -11733,6 +11743,16 @@
769 "Number of buffer pool instances, set to higher value on high-end machines to increase scalability",769 "Number of buffer pool instances, set to higher value on high-end machines to increase scalability",
770 NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L);770 NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L);
771 771
@@ -782,7 +782,7 @@
782 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,782 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
783 PLUGIN_VAR_RQCMDARG,783 PLUGIN_VAR_RQCMDARG,
784 "Helps in performance tuning in heavily concurrent environments.",784 "Helps in performance tuning in heavily concurrent environments.",
785@@ -12019,6 +12039,8 @@785@@ -12027,6 +12047,8 @@
786 MYSQL_SYSVAR(autoextend_increment),786 MYSQL_SYSVAR(autoextend_increment),
787 MYSQL_SYSVAR(buffer_pool_size),787 MYSQL_SYSVAR(buffer_pool_size),
788 MYSQL_SYSVAR(buffer_pool_instances),788 MYSQL_SYSVAR(buffer_pool_instances),
@@ -802,7 +802,7 @@
802 802
803 /** @name Modes for buf_page_get_gen */803 /** @name Modes for buf_page_get_gen */
804 /* @{ */804 /* @{ */
805@@ -1594,9 +1595,12 @@805@@ -1593,9 +1594,12 @@
806 /**********************************************************************//**806 /**********************************************************************//**
807 Compute the hash fold value for blocks in buf_pool->zip_hash. */807 Compute the hash fold value for blocks in buf_pool->zip_hash. */
808 /* @{ */808 /* @{ */
@@ -950,7 +950,7 @@
950diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h950diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
951--- a/storage/innobase/include/srv0srv.h 2011-04-09 18:48:45.000000000 +0400951--- a/storage/innobase/include/srv0srv.h 2011-04-09 18:48:45.000000000 +0400
952+++ b/storage/innobase/include/srv0srv.h 2011-04-09 18:48:48.000000000 +0400952+++ b/storage/innobase/include/srv0srv.h 2011-04-09 18:48:48.000000000 +0400
953@@ -171,6 +171,10 @@953@@ -168,6 +168,10 @@
954 extern ulint srv_mem_pool_size;954 extern ulint srv_mem_pool_size;
955 extern ulint srv_lock_table_size;955 extern ulint srv_lock_table_size;
956 956
@@ -1204,7 +1204,7 @@
1204diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c1204diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
1205--- a/storage/innobase/srv/srv0srv.c 2011-04-09 18:48:46.000000000 +04001205--- a/storage/innobase/srv/srv0srv.c 2011-04-09 18:48:46.000000000 +0400
1206+++ b/storage/innobase/srv/srv0srv.c 2011-04-09 18:48:48.000000000 +04001206+++ b/storage/innobase/srv/srv0srv.c 2011-04-09 18:48:48.000000000 +0400
1207@@ -234,6 +234,11 @@1207@@ -228,6 +228,11 @@
1208 UNIV_INTERN ulint srv_mem_pool_size = ULINT_MAX;1208 UNIV_INTERN ulint srv_mem_pool_size = ULINT_MAX;
1209 UNIV_INTERN ulint srv_lock_table_size = ULINT_MAX;1209 UNIV_INTERN ulint srv_lock_table_size = ULINT_MAX;
1210 1210
12111211
=== modified file 'innodb_deadlock_count.patch'
--- innodb_deadlock_count.patch 2011-05-10 11:57:42 +0000
+++ innodb_deadlock_count.patch 2011-06-20 09:04:39 +0000
@@ -31,7 +31,7 @@
31diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h31diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
32--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:55:21.378480843 +090032--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:55:21.378480843 +0900
33+++ b/storage/innobase/include/srv0srv.h 2010-12-04 16:10:24.606550983 +090033+++ b/storage/innobase/include/srv0srv.h 2010-12-04 16:10:24.606550983 +0900
34@@ -761,6 +761,7 @@34@@ -758,6 +758,7 @@
35 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/35 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
36 ulint innodb_dblwr_pages_written; /*!< srv_dblwr_pages_written */36 ulint innodb_dblwr_pages_written; /*!< srv_dblwr_pages_written */
37 ulint innodb_dblwr_writes; /*!< srv_dblwr_writes */37 ulint innodb_dblwr_writes; /*!< srv_dblwr_writes */
@@ -53,7 +53,7 @@
53diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c53diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
54--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:57:13.069513371 +090054--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:57:13.069513371 +0900
55+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 16:10:24.610593039 +090055+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 16:10:24.610593039 +0900
56@@ -474,6 +474,7 @@56@@ -468,6 +468,7 @@
57 static ulint srv_n_rows_deleted_old = 0;57 static ulint srv_n_rows_deleted_old = 0;
58 static ulint srv_n_rows_read_old = 0;58 static ulint srv_n_rows_read_old = 0;
59 59
@@ -61,7 +61,7 @@
61 UNIV_INTERN ulint srv_n_lock_wait_count = 0;61 UNIV_INTERN ulint srv_n_lock_wait_count = 0;
62 UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;62 UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;
63 UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;63 UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;
64@@ -2272,6 +2273,7 @@64@@ -2282,6 +2283,7 @@
65 export_vars.innodb_buffer_pool_pages_data = LRU_len;65 export_vars.innodb_buffer_pool_pages_data = LRU_len;
66 export_vars.innodb_buffer_pool_pages_dirty = flush_list_len;66 export_vars.innodb_buffer_pool_pages_dirty = flush_list_len;
67 export_vars.innodb_buffer_pool_pages_free = free_len;67 export_vars.innodb_buffer_pool_pages_free = free_len;
6868
=== modified file 'innodb_dict_size_limit.patch'
--- innodb_dict_size_limit.patch 2011-05-10 11:57:42 +0000
+++ innodb_dict_size_limit.patch 2011-06-20 09:04:39 +0000
@@ -277,7 +277,7 @@
277diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c277diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
278--- a/storage/innobase/dict/dict0dict.c 2010-11-03 07:01:13.000000000 +0900278--- a/storage/innobase/dict/dict0dict.c 2010-11-03 07:01:13.000000000 +0900
279+++ b/storage/innobase/dict/dict0dict.c 2010-12-03 15:45:47.525953769 +0900279+++ b/storage/innobase/dict/dict0dict.c 2010-12-03 15:45:47.525953769 +0900
280@@ -627,6 +627,8 @@280@@ -626,6 +626,8 @@
281 281
282 table = dict_table_get_on_id_low(table_id);282 table = dict_table_get_on_id_low(table_id);
283 283
@@ -286,7 +286,7 @@
286 mutex_exit(&(dict_sys->mutex));286 mutex_exit(&(dict_sys->mutex));
287 287
288 return(table);288 return(table);
289@@ -745,6 +747,8 @@289@@ -744,6 +746,8 @@
290 table->n_mysql_handles_opened++;290 table->n_mysql_handles_opened++;
291 }291 }
292 292
@@ -295,7 +295,7 @@
295 mutex_exit(&(dict_sys->mutex));295 mutex_exit(&(dict_sys->mutex));
296 296
297 if (table != NULL) {297 if (table != NULL) {
298@@ -1260,6 +1264,64 @@298@@ -1259,6 +1263,64 @@
299 dict_mem_table_free(table);299 dict_mem_table_free(table);
300 }300 }
301 301
@@ -360,7 +360,7 @@
360 /****************************************************************//**360 /****************************************************************//**
361 If the given column name is reserved for InnoDB system columns, return361 If the given column name is reserved for InnoDB system columns, return
362 TRUE.362 TRUE.
363@@ -1729,6 +1791,11 @@363@@ -1728,6 +1790,11 @@
364 ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);364 ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
365 ut_ad(mutex_own(&(dict_sys->mutex)));365 ut_ad(mutex_own(&(dict_sys->mutex)));
366 366
@@ -384,7 +384,7 @@
384 {"have_atomic_builtins",384 {"have_atomic_builtins",
385 (char*) &export_vars.innodb_have_atomic_builtins, SHOW_BOOL},385 (char*) &export_vars.innodb_have_atomic_builtins, SHOW_BOOL},
386 {"log_waits",386 {"log_waits",
387@@ -11635,6 +11637,11 @@387@@ -11642,6 +11644,11 @@
388 "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)",388 "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)",
389 NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib);389 NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib);
390 390
@@ -396,7 +396,7 @@
396 static struct st_mysql_sys_var* innobase_system_variables[]= {396 static struct st_mysql_sys_var* innobase_system_variables[]= {
397 MYSQL_SYSVAR(additional_mem_pool_size),397 MYSQL_SYSVAR(additional_mem_pool_size),
398 MYSQL_SYSVAR(autoextend_increment),398 MYSQL_SYSVAR(autoextend_increment),
399@@ -11702,6 +11709,7 @@399@@ -11709,6 +11716,7 @@
400 MYSQL_SYSVAR(flush_neighbor_pages),400 MYSQL_SYSVAR(flush_neighbor_pages),
401 MYSQL_SYSVAR(read_ahead),401 MYSQL_SYSVAR(read_ahead),
402 MYSQL_SYSVAR(adaptive_flushing_method),402 MYSQL_SYSVAR(adaptive_flushing_method),
@@ -500,7 +500,7 @@
500diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h500diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
501--- a/storage/innobase/include/srv0srv.h 2010-12-03 15:43:57.297067100 +0900501--- a/storage/innobase/include/srv0srv.h 2010-12-03 15:43:57.297067100 +0900
502+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:45:47.562024404 +0900502+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:45:47.562024404 +0900
503@@ -232,6 +232,7 @@503@@ -229,6 +229,7 @@
504 extern ulint srv_read_ahead;504 extern ulint srv_read_ahead;
505 extern ulint srv_adaptive_flushing_method;505 extern ulint srv_adaptive_flushing_method;
506 506
@@ -508,7 +508,7 @@
508 /*-------------------------------------------*/508 /*-------------------------------------------*/
509 509
510 extern ulint srv_n_rows_inserted;510 extern ulint srv_n_rows_inserted;
511@@ -712,6 +713,7 @@511@@ -709,6 +710,7 @@
512 ulint innodb_data_writes; /*!< I/O write requests */512 ulint innodb_data_writes; /*!< I/O write requests */
513 ulint innodb_data_written; /*!< Data bytes written */513 ulint innodb_data_written; /*!< Data bytes written */
514 ulint innodb_data_reads; /*!< I/O read requests */514 ulint innodb_data_reads; /*!< I/O read requests */
@@ -519,7 +519,7 @@
519diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c519diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
520--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:43:57.301024390 +0900520--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:43:57.301024390 +0900
521+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:45:47.565023830 +0900521+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:45:47.565023830 +0900
522@@ -421,6 +421,8 @@522@@ -415,6 +415,8 @@
523 UNIV_INTERN ulint srv_enable_unsafe_group_commit = 0; /* 0:disable 1:enable */523 UNIV_INTERN ulint srv_enable_unsafe_group_commit = 0; /* 0:disable 1:enable */
524 UNIV_INTERN ulint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */524 UNIV_INTERN ulint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */
525 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */525 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
@@ -528,7 +528,7 @@
528 /*-------------------------------------------*/528 /*-------------------------------------------*/
529 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;529 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
530 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;530 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
531@@ -2211,6 +2213,7 @@531@@ -2220,6 +2222,7 @@
532 export_vars.innodb_data_reads = os_n_file_reads;532 export_vars.innodb_data_reads = os_n_file_reads;
533 export_vars.innodb_data_writes = os_n_file_writes;533 export_vars.innodb_data_writes = os_n_file_writes;
534 export_vars.innodb_data_written = srv_data_written;534 export_vars.innodb_data_written = srv_data_written;
535535
=== modified file 'innodb_expand_import.patch'
--- innodb_expand_import.patch 2011-05-10 11:57:42 +0000
+++ innodb_expand_import.patch 2011-06-20 09:04:39 +0000
@@ -5,10 +5,40 @@
5#!!! notice !!!5#!!! notice !!!
6# Any small change to this file in the main branch6# Any small change to this file in the main branch
7# should be done or reviewed by the maintainer!7# should be done or reviewed by the maintainer!
8diff -ruN a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
9--- a/storage/innobase/btr/btr0btr.c 2011-04-11 19:44:03.000000000 +0900
10+++ b/storage/innobase/btr/btr0btr.c 2011-05-24 20:30:12.455852287 +0900
11@@ -837,7 +837,7 @@
12 /**************************************************************//**
13 Creates a new index page (not the root, and also not
14 used in page reorganization). @see btr_page_empty(). */
15-static
16+UNIV_INTERN
17 void
18 btr_page_create(
19 /*============*/
20@@ -1707,7 +1707,7 @@
21 #ifndef UNIV_HOTBACKUP
22 /*************************************************************//**
23 Empties an index page. @see btr_page_create(). */
24-static
25+UNIV_INTERN
26 void
27 btr_page_empty(
28 /*===========*/
29@@ -2269,7 +2269,7 @@
30 /**************************************************************//**
31 Attaches the halves of an index page on the appropriate level in an
32 index tree. */
33-static
34+UNIV_INTERN
35 void
36 btr_attach_half_pages(
37 /*==================*/
8diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c38diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
9--- a/storage/innobase/fil/fil0fil.c 2010-12-03 15:09:51.274957577 +090039--- a/storage/innobase/fil/fil0fil.c 2010-12-03 15:09:51.274957577 +0900
10+++ b/storage/innobase/fil/fil0fil.c 2010-12-03 15:52:23.553986552 +090040+++ b/storage/innobase/fil/fil0fil.c 2010-12-03 15:52:23.553986552 +0900
11@@ -40,6 +40,12 @@41@@ -40,6 +40,14 @@
12 #include "dict0dict.h"42 #include "dict0dict.h"
13 #include "page0page.h"43 #include "page0page.h"
14 #include "page0zip.h"44 #include "page0zip.h"
@@ -18,10 +48,97 @@
18+#include "row0mysql.h"48+#include "row0mysql.h"
19+#include "row0row.h"49+#include "row0row.h"
20+#include "que0que.h"50+#include "que0que.h"
51+#include "btr0btr.h"
52+#include "btr0sea.h"
21 #ifndef UNIV_HOTBACKUP53 #ifndef UNIV_HOTBACKUP
22 # include "buf0lru.h"54 # include "buf0lru.h"
23 # include "ibuf0ibuf.h"55 # include "ibuf0ibuf.h"
24@@ -3078,7 +3084,7 @@56@@ -3032,6 +3040,84 @@
57 }
58
59 /********************************************************************//**
60+Checks if a page is corrupt. (for offline page)
61+*/
62+static
63+ibool
64+fil_page_buf_page_is_corrupted_offline(
65+/*===================================*/
66+ const byte* page, /*!< in: a database page */
67+ ulint zip_size) /*!< in: size of compressed page;
68+ 0 for uncompressed pages */
69+{
70+ ulint checksum_field;
71+ ulint old_checksum_field;
72+
73+ if (!zip_size
74+ && memcmp(page + FIL_PAGE_LSN + 4,
75+ page + UNIV_PAGE_SIZE
76+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) {
77+ return(TRUE);
78+ }
79+
80+ checksum_field = mach_read_from_4(page
81+ + FIL_PAGE_SPACE_OR_CHKSUM);
82+
83+ if (zip_size) {
84+ return(checksum_field != BUF_NO_CHECKSUM_MAGIC
85+ && checksum_field
86+ != page_zip_calc_checksum(page, zip_size));
87+ }
88+
89+ old_checksum_field = mach_read_from_4(
90+ page + UNIV_PAGE_SIZE
91+ - FIL_PAGE_END_LSN_OLD_CHKSUM);
92+
93+ if (old_checksum_field != mach_read_from_4(page
94+ + FIL_PAGE_LSN)
95+ && old_checksum_field != BUF_NO_CHECKSUM_MAGIC
96+ && old_checksum_field
97+ != buf_calc_page_old_checksum(page)) {
98+ return(TRUE);
99+ }
100+
101+ if (checksum_field != 0
102+ && checksum_field != BUF_NO_CHECKSUM_MAGIC
103+ && checksum_field
104+ != buf_calc_page_new_checksum(page)) {
105+ return(TRUE);
106+ }
107+
108+ return(FALSE);
109+}
110+
111+/********************************************************************//**
112+*/
113+static
114+void
115+fil_page_buf_page_store_checksum(
116+/*=============================*/
117+ byte* page,
118+ ulint zip_size)
119+{
120+ if (!zip_size) {
121+ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
122+ srv_use_checksums
123+ ? buf_calc_page_new_checksum(page)
124+ : BUF_NO_CHECKSUM_MAGIC);
125+ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
126+ srv_use_checksums
127+ ? buf_calc_page_old_checksum(page)
128+ : BUF_NO_CHECKSUM_MAGIC);
129+ } else {
130+ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
131+ srv_use_checksums
132+ ? page_zip_calc_checksum(page, zip_size)
133+ : BUF_NO_CHECKSUM_MAGIC);
134+ }
135+}
136+
137+/********************************************************************//**
138 Tries to open a single-table tablespace and optionally checks the space id is
139 right in it. If does not succeed, prints an error message to the .err log. This
140 function is used to open a tablespace when we start up mysqld, and also in
141@@ -3078,7 +3164,7 @@
25 142
26 file = os_file_create_simple_no_error_handling(143 file = os_file_create_simple_no_error_handling(
27 innodb_file_data_key, filepath, OS_FILE_OPEN,144 innodb_file_data_key, filepath, OS_FILE_OPEN,
@@ -30,7 +147,7 @@
30 if (!success) {147 if (!success) {
31 /* The following call prints an error message */148 /* The following call prints an error message */
32 os_file_get_last_error(TRUE);149 os_file_get_last_error(TRUE);
33@@ -3125,6 +3131,466 @@150@@ -3125,6 +3211,445 @@
34 space_id = fsp_header_get_space_id(page);151 space_id = fsp_header_get_space_id(page);
35 space_flags = fsp_header_get_flags(page);152 space_flags = fsp_header_get_flags(page);
36 153
@@ -56,6 +173,7 @@
56+ fil_system_t* system;173+ fil_system_t* system;
57+ fil_node_t* node = NULL;174+ fil_node_t* node = NULL;
58+ fil_space_t* space;175+ fil_space_t* space;
176+ ulint zip_size;
59+177+
60+ buf3 = ut_malloc(2 * UNIV_PAGE_SIZE);178+ buf3 = ut_malloc(2 * UNIV_PAGE_SIZE);
61+ descr_page = ut_align(buf3, UNIV_PAGE_SIZE);179+ descr_page = ut_align(buf3, UNIV_PAGE_SIZE);
@@ -73,12 +191,15 @@
73+ /* store as first descr page */191+ /* store as first descr page */
74+ memcpy(descr_page, page, UNIV_PAGE_SIZE);192+ memcpy(descr_page, page, UNIV_PAGE_SIZE);
75+193+
194+ zip_size = dict_table_flags_to_zip_size(flags);
195+ ut_a(zip_size == dict_table_flags_to_zip_size(space_flags));
196+
76+ /* get free limit (page number) of the table space */197+ /* get free limit (page number) of the table space */
77+/* these should be same to the definition in fsp0fsp.c */198+/* these should be same to the definition in fsp0fsp.c */
78+#define FSP_HEADER_OFFSET FIL_PAGE_DATA199+#define FSP_HEADER_OFFSET FIL_PAGE_DATA
79+#define FSP_FREE_LIMIT 12200+#define FSP_FREE_LIMIT 12
80+ free_limit = mach_read_from_4(FSP_HEADER_OFFSET + FSP_FREE_LIMIT + page);201+ free_limit = mach_read_from_4(FSP_HEADER_OFFSET + FSP_FREE_LIMIT + page);
81+ free_limit_bytes = (ib_int64_t)free_limit * (ib_int64_t)UNIV_PAGE_SIZE;202+ free_limit_bytes = (ib_int64_t)free_limit * (ib_int64_t)(zip_size ? zip_size : UNIV_PAGE_SIZE);
82+203+
83+ /* overwrite fsp header */204+ /* overwrite fsp header */
84+ fsp_header_init_fields(page, id, flags);205+ fsp_header_init_fields(page, id, flags);
@@ -87,14 +208,9 @@
87+ space_flags = flags;208+ space_flags = flags;
88+ if (mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN) > current_lsn)209+ if (mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN) > current_lsn)
89+ mach_write_to_8(page + FIL_PAGE_FILE_FLUSH_LSN, current_lsn);210+ mach_write_to_8(page + FIL_PAGE_FILE_FLUSH_LSN, current_lsn);
90+ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,211+
91+ srv_use_checksums212+ fil_page_buf_page_store_checksum(page, zip_size);
92+ ? buf_calc_page_new_checksum(page)213+
93+ : BUF_NO_CHECKSUM_MAGIC);
94+ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
95+ srv_use_checksums
96+ ? buf_calc_page_old_checksum(page)
97+ : BUF_NO_CHECKSUM_MAGIC);
98+ success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE);214+ success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE);
99+215+
100+ /* get file size */216+ /* get file size */
@@ -104,7 +220,7 @@
104+220+
105+ if (size_bytes < free_limit_bytes) {221+ if (size_bytes < free_limit_bytes) {
106+ free_limit_bytes = size_bytes;222+ free_limit_bytes = size_bytes;
107+ if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {223+ if (size_bytes >= (lint)FSP_EXTENT_SIZE * (lint)(zip_size ? zip_size : UNIV_PAGE_SIZE)) {
108+ fprintf(stderr, "InnoDB: free limit of %s is larger than its real size.\n", filepath);224+ fprintf(stderr, "InnoDB: free limit of %s is larger than its real size.\n", filepath);
109+ file_is_corrupt = TRUE;225+ file_is_corrupt = TRUE;
110+ }226+ }
@@ -168,63 +284,41 @@
168+ size_bytes = ut_2pow_round(size_bytes, 1024 * 1024);284+ size_bytes = ut_2pow_round(size_bytes, 1024 * 1024);
169+ }285+ }
170+ */286+ */
171+ if (!(flags & DICT_TF_ZSSIZE_MASK)) {287+
288+ if (zip_size) {
289+ fprintf(stderr, "InnoDB: Warning: importing compressed table is still EXPERIMENTAL, currently.\n");
290+ }
291+
292+ {
172+ mem_heap_t* heap = NULL;293+ mem_heap_t* heap = NULL;
173+ ulint offsets_[REC_OFFS_NORMAL_SIZE];294+ ulint offsets_[REC_OFFS_NORMAL_SIZE];
174+ ulint* offsets = offsets_;295+ ulint* offsets = offsets_;
175+ ib_int64_t offset;296+ ib_int64_t offset;
176+297+
177+ size = (ulint) (size_bytes / UNIV_PAGE_SIZE);298+ size = (ulint) (size_bytes / (zip_size ? zip_size : UNIV_PAGE_SIZE));
178+ /* over write space id of all pages */299+ /* over write space id of all pages */
179+ rec_offs_init(offsets_);300+ rec_offs_init(offsets_);
180+301+
181+ fprintf(stderr, "InnoDB: Progress in %%:");302+ fprintf(stderr, "InnoDB: Progress in %%:");
182+303+
183+ for (offset = 0; offset < free_limit_bytes; offset += UNIV_PAGE_SIZE) {304+ for (offset = 0; offset < free_limit_bytes;
184+ ulint checksum_field;305+ offset += zip_size ? zip_size : UNIV_PAGE_SIZE) {
185+ ulint old_checksum_field;
186+ ibool page_is_corrupt;306+ ibool page_is_corrupt;
187+307+
188+ success = os_file_read(file, page,308+ success = os_file_read(file, page,
189+ (ulint)(offset & 0xFFFFFFFFUL),309+ (ulint)(offset & 0xFFFFFFFFUL),
190+ (ulint)(offset >> 32), UNIV_PAGE_SIZE);310+ (ulint)(offset >> 32),
311+ zip_size ? zip_size : UNIV_PAGE_SIZE);
191+312+
192+ page_is_corrupt = FALSE;313+ page_is_corrupt = FALSE;
193+314+
194+ /* check consistency */315+ /* check consistency */
195+ if (memcmp(page + FIL_PAGE_LSN + 4,316+ if (fil_page_buf_page_is_corrupted_offline(page, zip_size)) {
196+ page + UNIV_PAGE_SIZE
197+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) {
198+
199+ page_is_corrupt = TRUE;317+ page_is_corrupt = TRUE;
200+ }318+ }
201+319+
202+ if (mach_read_from_4(page + FIL_PAGE_OFFSET)320+ if (mach_read_from_4(page + FIL_PAGE_OFFSET)
203+ != offset / UNIV_PAGE_SIZE) {321+ != offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)) {
204+
205+ page_is_corrupt = TRUE;
206+ }
207+
208+ checksum_field = mach_read_from_4(page
209+ + FIL_PAGE_SPACE_OR_CHKSUM);
210+
211+ old_checksum_field = mach_read_from_4(
212+ page + UNIV_PAGE_SIZE
213+ - FIL_PAGE_END_LSN_OLD_CHKSUM);
214+
215+ if (old_checksum_field != mach_read_from_4(page
216+ + FIL_PAGE_LSN)
217+ && old_checksum_field != BUF_NO_CHECKSUM_MAGIC
218+ && old_checksum_field
219+ != buf_calc_page_old_checksum(page)) {
220+
221+ page_is_corrupt = TRUE;
222+ }
223+
224+ if (checksum_field != 0
225+ && checksum_field != BUF_NO_CHECKSUM_MAGIC
226+ && checksum_field
227+ != buf_calc_page_new_checksum(page)) {
228+322+
229+ page_is_corrupt = TRUE;323+ page_is_corrupt = TRUE;
230+ }324+ }
@@ -235,7 +329,8 @@
235+ /* it should be overwritten already */329+ /* it should be overwritten already */
236+ ut_a(!page_is_corrupt);330+ ut_a(!page_is_corrupt);
237+331+
238+ } else if (!((offset / UNIV_PAGE_SIZE) % UNIV_PAGE_SIZE)) {332+ } else if (!((offset / (zip_size ? zip_size : UNIV_PAGE_SIZE))
333+ % (zip_size ? zip_size : UNIV_PAGE_SIZE))) {
239+ /* descr page (not header) */334+ /* descr page (not header) */
240+ if (page_is_corrupt) {335+ if (page_is_corrupt) {
241+ file_is_corrupt = TRUE;336+ file_is_corrupt = TRUE;
@@ -246,7 +341,7 @@
246+ }341+ }
247+342+
248+ /* store as descr page */343+ /* store as descr page */
249+ memcpy(descr_page, page, UNIV_PAGE_SIZE);344+ memcpy(descr_page, page, (zip_size ? zip_size : UNIV_PAGE_SIZE));
250+345+
251+ } else if (descr_is_corrupt) {346+ } else if (descr_is_corrupt) {
252+ /* unknown state of the page */347+ /* unknown state of the page */
@@ -274,9 +369,12 @@
274+ ulint bit_index;369+ ulint bit_index;
275+370+
276+ descr = descr_page + XDES_ARR_OFFSET371+ descr = descr_page + XDES_ARR_OFFSET
277+ + XDES_SIZE * (ut_2pow_remainder((offset / UNIV_PAGE_SIZE), UNIV_PAGE_SIZE) / FSP_EXTENT_SIZE);372+ + XDES_SIZE * (ut_2pow_remainder(
373+ (offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)),
374+ (zip_size ? zip_size : UNIV_PAGE_SIZE)) / FSP_EXTENT_SIZE);
278+375+
279+ index = XDES_FREE_BIT + XDES_BITS_PER_PAGE * ((offset / UNIV_PAGE_SIZE) % FSP_EXTENT_SIZE);376+ index = XDES_FREE_BIT
377+ + XDES_BITS_PER_PAGE * ((offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)) % FSP_EXTENT_SIZE);
280+ byte_index = index / 8;378+ byte_index = index / 8;
281+ bit_index = index % 8;379+ bit_index = index % 8;
282+380+
@@ -294,7 +392,7 @@
294+ }392+ }
295+393+
296+ if (page_is_corrupt) {394+ if (page_is_corrupt) {
297+ fprintf(stderr, " [errp:%lld]", offset / UNIV_PAGE_SIZE);395+ fprintf(stderr, " [errp:%lld]", offset / (zip_size ? zip_size : UNIV_PAGE_SIZE));
298+396+
299+ /* cannot treat corrupt page */397+ /* cannot treat corrupt page */
300+ goto skip_write;398+ goto skip_write;
@@ -304,7 +402,13 @@
304+ mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, id);402+ mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, id);
305+403+
306+ for (i = 0; i < n_index; i++) {404+ for (i = 0; i < n_index; i++) {
307+ if (offset / UNIV_PAGE_SIZE == root_page[i]) {405+ if (offset / (zip_size ? zip_size : UNIV_PAGE_SIZE) == root_page[i]) {
406+ if (fil_page_get_type(page) != FIL_PAGE_INDEX) {
407+ file_is_corrupt = TRUE;
408+ fprintf(stderr, " [etyp:%lld]",
409+ offset / (zip_size ? zip_size : UNIV_PAGE_SIZE));
410+ goto skip_write;
411+ }
308+ /* this is index root page */412+ /* this is index root page */
309+ mach_write_to_4(page + FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF413+ mach_write_to_4(page + FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
310+ + FSEG_HDR_SPACE, id);414+ + FSEG_HDR_SPACE, id);
@@ -317,7 +421,14 @@
317+ if (fil_page_get_type(page) == FIL_PAGE_INDEX) {421+ if (fil_page_get_type(page) == FIL_PAGE_INDEX) {
318+ index_id_t tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));422+ index_id_t tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
319+423+
320+ if (mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0424+ for (i = 0; i < n_index; i++) {
425+ if (old_id[i] == tmp) {
426+ mach_write_to_8(page + (PAGE_HEADER + PAGE_INDEX_ID), new_id[i]);
427+ break;
428+ }
429+ }
430+
431+ if (!zip_size && mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
321+ && old_id[0] == tmp) {432+ && old_id[0] == tmp) {
322+ /* leaf page of cluster index, reset trx_id of records */433+ /* leaf page of cluster index, reset trx_id of records */
323+ rec_t* rec;434+ rec_t* rec;
@@ -356,42 +467,34 @@
356+ rec = page_rec_get_next(rec);467+ rec = page_rec_get_next(rec);
357+ n_recs--;468+ n_recs--;
358+ }469+ }
359+ }470+ } else if (mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
360+471+ && old_id[0] != tmp) {
361+ for (i = 0; i < n_index; i++) {472+ mach_write_to_8(page + (PAGE_HEADER + PAGE_MAX_TRX_ID), 1);
362+ if (old_id[i] == tmp) {
363+ mach_write_to_8(page + (PAGE_HEADER + PAGE_INDEX_ID), new_id[i]);
364+ break;
365+ }
366+ }473+ }
367+ }474+ }
368+475+
369+ if (mach_read_from_8(page + FIL_PAGE_LSN) > current_lsn) {476+ if (mach_read_from_8(page + FIL_PAGE_LSN) > current_lsn) {
370+ mach_write_to_8(page + FIL_PAGE_LSN, current_lsn);477+ mach_write_to_8(page + FIL_PAGE_LSN, current_lsn);
371+ mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,478+ if (!zip_size) {
372+ current_lsn);479+ mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
480+ current_lsn);
481+ }
373+ }482+ }
374+483+
375+ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,484+ fil_page_buf_page_store_checksum(page, zip_size);
376+ srv_use_checksums
377+ ? buf_calc_page_new_checksum(page)
378+ : BUF_NO_CHECKSUM_MAGIC);
379+ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
380+ srv_use_checksums
381+ ? buf_calc_page_old_checksum(page)
382+ : BUF_NO_CHECKSUM_MAGIC);
383+485+
384+ success = os_file_write(filepath, file, page,486+ success = os_file_write(filepath, file, page,
385+ (ulint)(offset & 0xFFFFFFFFUL),487+ (ulint)(offset & 0xFFFFFFFFUL),
386+ (ulint)(offset >> 32), UNIV_PAGE_SIZE);488+ (ulint)(offset >> 32),
489+ zip_size ? zip_size : UNIV_PAGE_SIZE);
387+ }490+ }
388+491+
389+skip_write:492+skip_write:
390+ if (free_limit_bytes493+ if (free_limit_bytes
391+ && ((ib_int64_t)((offset + UNIV_PAGE_SIZE) * 100) / free_limit_bytes)494+ && ((ib_int64_t)((offset + (zip_size ? zip_size : UNIV_PAGE_SIZE)) * 100) / free_limit_bytes)
392+ != ((offset * 100) / free_limit_bytes)) {495+ != ((offset * 100) / free_limit_bytes)) {
393+ fprintf(stderr, " %lu",496+ fprintf(stderr, " %lu",
394+ (ulong)((ib_int64_t)((offset + UNIV_PAGE_SIZE) * 100) / free_limit_bytes));497+ (ulong)((ib_int64_t)((offset + (zip_size ? zip_size : UNIV_PAGE_SIZE)) * 100) / free_limit_bytes));
395+ }498+ }
396+ }499+ }
397+500+
@@ -447,13 +550,6 @@
447+ if (UNIV_LIKELY_NULL(heap)) {550+ if (UNIV_LIKELY_NULL(heap)) {
448+ mem_heap_free(heap);551+ mem_heap_free(heap);
449+ }552+ }
450+ } else {
451+ /* zip page? */
452+ size = (ulint)
453+ (size_bytes
454+ / dict_table_flags_to_zip_size(flags));
455+ fprintf(stderr, "InnoDB: Import: The table %s seems to be in a newer format."
456+ " It may not be possible to process it.\n", name);
457+ }553+ }
458+ /* .exp file should be removed */554+ /* .exp file should be removed */
459+ success = os_file_delete(info_file_path);555+ success = os_file_delete(info_file_path);
@@ -497,10 +593,282 @@
497 ut_free(buf2);593 ut_free(buf2);
498 594
499 if (UNIV_UNLIKELY(space_id != id595 if (UNIV_UNLIKELY(space_id != id
596@@ -3166,6 +3691,271 @@
597 os_file_close(file);
598 mem_free(filepath);
599
600+ if (srv_expand_import && dict_table_flags_to_zip_size(flags)) {
601+ ulint page_no;
602+ ulint zip_size;
603+ ulint height;
604+ ulint root_height = 0;
605+ rec_t* node_ptr;
606+ dict_table_t* table;
607+ dict_index_t* index;
608+ buf_block_t* block;
609+ page_t* page;
610+ page_zip_des_t* page_zip;
611+ mtr_t mtr;
612+
613+ mem_heap_t* heap = NULL;
614+ ulint offsets_[REC_OFFS_NORMAL_SIZE];
615+ ulint* offsets = offsets_;
616+
617+ rec_offs_init(offsets_);
618+
619+ zip_size = dict_table_flags_to_zip_size(flags);
620+
621+ table = dict_table_get_low(name);
622+ index = dict_table_get_first_index(table);
623+ page_no = dict_index_get_page(index);
624+ ut_a(page_no == 3);
625+
626+ fprintf(stderr, "InnoDB: It is compressed .ibd file. need to convert additionaly on buffer pool.\n");
627+
628+ /* down to leaf */
629+ mtr_start(&mtr);
630+ mtr_set_log_mode(&mtr, MTR_LOG_NONE);
631+
632+ height = ULINT_UNDEFINED;
633+
634+ for (;;) {
635+ block = buf_page_get(space_id, zip_size, page_no,
636+ RW_NO_LATCH, &mtr);
637+ page = buf_block_get_frame(block);
638+
639+ block->check_index_page_at_flush = TRUE;
640+
641+ if (height == ULINT_UNDEFINED) {
642+ height = btr_page_get_level(page, &mtr);
643+ root_height = height;
644+ }
645+
646+ if (height == 0) {
647+ break;
648+ }
649+
650+ node_ptr = page_rec_get_next(page_get_infimum_rec(page));
651+
652+ height--;
653+
654+ offsets = rec_get_offsets(node_ptr, index, offsets, ULINT_UNDEFINED, &heap);
655+ page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
656+ }
657+
658+ mtr_commit(&mtr);
659+
660+ fprintf(stderr, "InnoDB: pages needs split are ...");
661+
662+ /* scan reaf pages */
663+ while (page_no != FIL_NULL) {
664+ rec_t* rec;
665+ rec_t* supremum;
666+ ulint n_recs;
667+
668+ mtr_start(&mtr);
669+
670+ block = buf_page_get(space_id, zip_size, page_no,
671+ RW_X_LATCH, &mtr);
672+ page = buf_block_get_frame(block);
673+ page_zip = buf_block_get_page_zip(block);
674+
675+ if (!page_zip) {
676+ /*something wrong*/
677+ fprintf(stderr, "InnoDB: Something wrong with reading page %lu.\n", page_no);
678+convert_err_exit:
679+ mtr_commit(&mtr);
680+ mutex_enter(&fil_system->mutex);
681+ fil_space_free(space_id, FALSE);
682+ mutex_exit(&fil_system->mutex);
683+ success = FALSE;
684+ goto convert_exit;
685+ }
686+
687+ supremum = page_get_supremum_rec(page);
688+ rec = page_rec_get_next(page_get_infimum_rec(page));
689+ n_recs = page_get_n_recs(page);
690+
691+ /* illegal operation as InnoDB online system. so not logged */
692+ while (rec && rec != supremum && n_recs > 0) {
693+ ulint n_fields;
694+ ulint i;
695+ ulint offset = index->trx_id_offset;
696+
697+ offsets = rec_get_offsets(rec, index, offsets,
698+ ULINT_UNDEFINED, &heap);
699+ n_fields = rec_offs_n_fields(offsets);
700+ if (!offset) {
701+ offset = row_get_trx_id_offset(rec, index, offsets);
702+ }
703+ trx_write_trx_id(rec + offset, 1);
704+
705+ for (i = 0; i < n_fields; i++) {
706+ if (rec_offs_nth_extern(offsets, i)) {
707+ ulint local_len;
708+ byte* data;
709+
710+ data = rec_get_nth_field(rec, offsets, i, &local_len);
711+
712+ local_len -= BTR_EXTERN_FIELD_REF_SIZE;
713+
714+ mach_write_to_4(data + local_len + BTR_EXTERN_SPACE_ID, id);
715+ }
716+ }
717+
718+ rec = page_rec_get_next(rec);
719+ n_recs--;
720+ }
721+
722+ /* dummy logged update for along with modified page path */
723+ if (index->id != btr_page_get_index_id(page)) {
724+ /* this should be adjusted already */
725+ fprintf(stderr, "InnoDB: The page %lu seems to be converted wrong.\n", page_no);
726+ goto convert_err_exit;
727+ }
728+ btr_page_set_index_id(page, page_zip, index->id, &mtr);
729+
730+ /* confirm whether fits to the page size or not */
731+ if (!page_zip_compress(page_zip, page, index, &mtr)
732+ && !btr_page_reorganize(block, index, &mtr)) {
733+ buf_block_t* new_block;
734+ page_t* new_page;
735+ page_zip_des_t* new_page_zip;
736+ rec_t* split_rec;
737+ ulint n_uniq;
738+
739+ /* split page is needed */
740+ fprintf(stderr, " %lu", page_no);
741+
742+ mtr_x_lock(dict_index_get_lock(index), &mtr);
743+
744+ n_uniq = dict_index_get_n_unique_in_tree(index);
745+
746+ if(page_get_n_recs(page) < 2) {
747+ /* no way to make smaller */
748+ fprintf(stderr, "InnoDB: The page %lu cannot be store to the page size.\n", page_no);
749+ goto convert_err_exit;
750+ }
751+
752+ if (UNIV_UNLIKELY(page_no == dict_index_get_page(index))) {
753+ ulint new_page_no;
754+ dtuple_t* node_ptr;
755+ ulint level;
756+ rec_t* node_ptr_rec;
757+ page_cur_t page_cursor;
758+
759+ /* it is root page, need to raise before split */
760+
761+ level = btr_page_get_level(page, &mtr);
762+
763+ new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, &mtr);
764+ new_page = buf_block_get_frame(new_block);
765+ new_page_zip = buf_block_get_page_zip(new_block);
766+ btr_page_create(new_block, new_page_zip, index, level, &mtr);
767+
768+ btr_page_set_next(new_page, new_page_zip, FIL_NULL, &mtr);
769+ btr_page_set_prev(new_page, new_page_zip, FIL_NULL, &mtr);
770+
771+ page_zip_copy_recs(new_page_zip, new_page,
772+ page_zip, page, index, &mtr);
773+ btr_search_move_or_delete_hash_entries(new_block, block, index);
774+
775+ rec = page_rec_get_next(page_get_infimum_rec(new_page));
776+ new_page_no = buf_block_get_page_no(new_block);
777+
778+ node_ptr = dict_index_build_node_ptr(index, rec, new_page_no, heap,
779+ level);
780+ dtuple_set_info_bits(node_ptr,
781+ dtuple_get_info_bits(node_ptr)
782+ | REC_INFO_MIN_REC_FLAG);
783+ btr_page_empty(block, page_zip, index, level + 1, &mtr);
784+
785+ btr_page_set_next(page, page_zip, FIL_NULL, &mtr);
786+ btr_page_set_prev(page, page_zip, FIL_NULL, &mtr);
787+
788+ page_cur_set_before_first(block, &page_cursor);
789+
790+ node_ptr_rec = page_cur_tuple_insert(&page_cursor, node_ptr,
791+ index, 0, &mtr);
792+ ut_a(node_ptr_rec);
793+
794+ if (!btr_page_reorganize(block, index, &mtr)) {
795+ fprintf(stderr, "InnoDB: failed to store the page %lu.\n", page_no);
796+ goto convert_err_exit;
797+ }
798+
799+ /* move to the raised page */
800+ page_no = new_page_no;
801+ block = new_block;
802+ page = new_page;
803+ page_zip = new_page_zip;
804+
805+ fprintf(stderr, "(raise_to:%lu)", page_no);
806+ }
807+
808+ split_rec = page_get_middle_rec(page);
809+
810+ new_block = btr_page_alloc(index, page_no + 1, FSP_UP,
811+ btr_page_get_level(page, &mtr), &mtr);
812+ new_page = buf_block_get_frame(new_block);
813+ new_page_zip = buf_block_get_page_zip(new_block);
814+ btr_page_create(new_block, new_page_zip, index,
815+ btr_page_get_level(page, &mtr), &mtr);
816+
817+ offsets = rec_get_offsets(split_rec, index, offsets, n_uniq, &heap);
818+
819+ btr_attach_half_pages(index, block,
820+ split_rec, new_block, FSP_UP, &mtr);
821+
822+ page_zip_copy_recs(new_page_zip, new_page,
823+ page_zip, page, index, &mtr);
824+ page_delete_rec_list_start(split_rec - page + new_page,
825+ new_block, index, &mtr);
826+ btr_search_move_or_delete_hash_entries(new_block, block, index);
827+ page_delete_rec_list_end(split_rec, block, index,
828+ ULINT_UNDEFINED, ULINT_UNDEFINED, &mtr);
829+
830+ fprintf(stderr, "(new:%lu)", buf_block_get_page_no(new_block));
831+
832+ /* Are they needed? */
833+ if (!btr_page_reorganize(block, index, &mtr)) {
834+ fprintf(stderr, "InnoDB: failed to store the page %lu.\n", page_no);
835+ goto convert_err_exit;
836+ }
837+ if (!btr_page_reorganize(new_block, index, &mtr)) {
838+ fprintf(stderr, "InnoDB: failed to store the page %lu.\n", buf_block_get_page_no(new_block));
839+ goto convert_err_exit;
840+ }
841+ }
842+
843+ page_no = btr_page_get_next(page, &mtr);
844+
845+ mtr_commit(&mtr);
846+
847+ if (heap) {
848+ mem_heap_empty(heap);
849+ }
850+ }
851+
852+ fprintf(stderr, "...done.\nInnoDB: waiting the flush batch of the additional conversion.\n");
853+
854+ /* should wait for the not-logged changes are all flushed */
855+ buf_flush_list(ULINT_MAX, mtr.end_lsn + 1);
856+ buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST);
857+
858+ fprintf(stderr, "InnoDB: done.\n");
859+convert_exit:
860+ if (UNIV_LIKELY_NULL(heap)) {
861+ mem_heap_free(heap);
862+ }
863+ }
864+
865 return(success);
866 }
867 #endif /* !UNIV_HOTBACKUP */
500diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc868diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
501--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:49:59.195023983 +0900869--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:49:59.195023983 +0900
502+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:52:23.555957062 +0900870+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:52:23.555957062 +0900
503@@ -7368,6 +7368,14 @@871@@ -7377,6 +7377,14 @@
504 err = row_discard_tablespace_for_mysql(dict_table->name, trx);872 err = row_discard_tablespace_for_mysql(dict_table->name, trx);
505 } else {873 } else {
506 err = row_import_tablespace_for_mysql(dict_table->name, trx);874 err = row_import_tablespace_for_mysql(dict_table->name, trx);
@@ -515,7 +883,7 @@
515 }883 }
516 884
517 err = convert_error_code_to_mysql(err, dict_table->flags, NULL);885 err = convert_error_code_to_mysql(err, dict_table->flags, NULL);
518@@ -11642,6 +11650,11 @@886@@ -11649,6 +11657,11 @@
519 "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)",887 "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)",
520 NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib);888 NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib);
521 889
@@ -527,7 +895,7 @@
527 static MYSQL_SYSVAR_ULONG(dict_size_limit, srv_dict_size_limit,895 static MYSQL_SYSVAR_ULONG(dict_size_limit, srv_dict_size_limit,
528 PLUGIN_VAR_RQCMDARG,896 PLUGIN_VAR_RQCMDARG,
529 "Limit the allocated memory for dictionary cache. (0: unlimited)",897 "Limit the allocated memory for dictionary cache. (0: unlimited)",
530@@ -11714,6 +11727,7 @@898@@ -11721,6 +11734,7 @@
531 MYSQL_SYSVAR(flush_neighbor_pages),899 MYSQL_SYSVAR(flush_neighbor_pages),
532 MYSQL_SYSVAR(read_ahead),900 MYSQL_SYSVAR(read_ahead),
533 MYSQL_SYSVAR(adaptive_flushing_method),901 MYSQL_SYSVAR(adaptive_flushing_method),
@@ -535,10 +903,125 @@
535 MYSQL_SYSVAR(dict_size_limit),903 MYSQL_SYSVAR(dict_size_limit),
536 MYSQL_SYSVAR(use_sys_malloc),904 MYSQL_SYSVAR(use_sys_malloc),
537 MYSQL_SYSVAR(use_native_aio),905 MYSQL_SYSVAR(use_native_aio),
906diff -ruN a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
907--- a/storage/innobase/include/btr0btr.h 2011-04-11 19:44:03.000000000 +0900
908+++ b/storage/innobase/include/btr0btr.h 2011-05-24 20:30:12.459853343 +0900
909@@ -219,6 +219,17 @@
910 @return the uncompressed page frame */
911 # define btr_page_get(space,zip_size,page_no,mode,mtr) \
912 buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,mtr))
913+/**************************************************************//**
914+Sets the index id field of a page. */
915+UNIV_INLINE
916+void
917+btr_page_set_index_id(
918+/*==================*/
919+ page_t* page, /*!< in: page to be created */
920+ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
921+ part will be updated, or NULL */
922+ index_id_t id, /*!< in: index id */
923+ mtr_t* mtr); /*!< in: mtr */
924 #endif /* !UNIV_HOTBACKUP */
925 /**************************************************************//**
926 Gets the index id field of a page.
927@@ -256,6 +267,17 @@
928 const page_t* page, /*!< in: index page */
929 mtr_t* mtr); /*!< in: mini-transaction handle */
930 /********************************************************//**
931+Sets the next index page field. */
932+UNIV_INLINE
933+void
934+btr_page_set_next(
935+/*==============*/
936+ page_t* page, /*!< in: index page */
937+ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
938+ part will be updated, or NULL */
939+ ulint next, /*!< in: next page number */
940+ mtr_t* mtr); /*!< in: mini-transaction handle */
941+/********************************************************//**
942 Gets the previous index page number.
943 @return prev page number */
944 UNIV_INLINE
945@@ -264,6 +286,17 @@
946 /*==============*/
947 const page_t* page, /*!< in: index page */
948 mtr_t* mtr); /*!< in: mini-transaction handle */
949+/********************************************************//**
950+Sets the previous index page field. */
951+UNIV_INLINE
952+void
953+btr_page_set_prev(
954+/*==============*/
955+ page_t* page, /*!< in: index page */
956+ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
957+ part will be updated, or NULL */
958+ ulint prev, /*!< in: previous page number */
959+ mtr_t* mtr); /*!< in: mini-transaction handle */
960 /*************************************************************//**
961 Gets pointer to the previous user record in the tree. It is assumed
962 that the caller has appropriate latches on the page and its neighbor.
963@@ -309,6 +342,18 @@
964 /*===========================*/
965 const rec_t* rec, /*!< in: node pointer record */
966 const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
967+/**************************************************************//**
968+Creates a new index page (not the root, and also not
969+used in page reorganization). @see btr_page_empty(). */
970+UNIV_INTERN
971+void
972+btr_page_create(
973+/*============*/
974+ buf_block_t* block, /*!< in/out: page to be created */
975+ page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
976+ dict_index_t* index, /*!< in: index */
977+ ulint level, /*!< in: the B-tree level of the page */
978+ mtr_t* mtr); /*!< in: mtr */
979 /************************************************************//**
980 Creates the root node for a new index tree.
981 @return page number of the created root, FIL_NULL if did not succeed */
982@@ -379,6 +424,17 @@
983 dict_index_t* index, /*!< in: record descriptor */
984 mtr_t* mtr); /*!< in: mtr */
985 /*************************************************************//**
986+Empties an index page. @see btr_page_create(). */
987+UNIV_INTERN
988+void
989+btr_page_empty(
990+/*===========*/
991+ buf_block_t* block, /*!< in: page to be emptied */
992+ page_zip_des_t* page_zip,/*!< out: compressed page, or NULL */
993+ dict_index_t* index, /*!< in: index of the page */
994+ ulint level, /*!< in: the B-tree level of the page */
995+ mtr_t* mtr); /*!< in: mtr */
996+/*************************************************************//**
997 Decides if the page should be split at the convergence point of
998 inserts converging to left.
999 @return TRUE if split recommended */
1000@@ -437,6 +493,20 @@
1001 # define btr_insert_on_non_leaf_level(i,l,t,m) \
1002 btr_insert_on_non_leaf_level_func(i,l,t,__FILE__,__LINE__,m)
1003 #endif /* !UNIV_HOTBACKUP */
1004+/**************************************************************//**
1005+Attaches the halves of an index page on the appropriate level in an
1006+index tree. */
1007+UNIV_INTERN
1008+void
1009+btr_attach_half_pages(
1010+/*==================*/
1011+ dict_index_t* index, /*!< in: the index tree */
1012+ buf_block_t* block, /*!< in/out: page to be split */
1013+ rec_t* split_rec, /*!< in: first record on upper
1014+ half page */
1015+ buf_block_t* new_block, /*!< in/out: the new half page */
1016+ ulint direction, /*!< in: FSP_UP or FSP_DOWN */
1017+ mtr_t* mtr); /*!< in: mtr */
1018 /****************************************************************//**
1019 Sets a record as the predefined minimum record. */
1020 UNIV_INTERN
538diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h1021diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
539--- a/storage/innobase/include/srv0srv.h 2010-12-03 15:48:03.077954270 +09001022--- a/storage/innobase/include/srv0srv.h 2010-12-03 15:48:03.077954270 +0900
540+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:52:23.561986996 +09001023+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:52:23.561986996 +0900
541@@ -232,6 +232,8 @@1024@@ -229,6 +229,8 @@
542 extern ulint srv_read_ahead;1025 extern ulint srv_read_ahead;
543 extern ulint srv_adaptive_flushing_method;1026 extern ulint srv_adaptive_flushing_method;
544 1027
@@ -547,10 +1030,37 @@
547 extern ulint srv_dict_size_limit;1030 extern ulint srv_dict_size_limit;
548 /*-------------------------------------------*/1031 /*-------------------------------------------*/
549 1032
1033diff -ruN a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
1034--- a/storage/innobase/row/row0mysql.c 2011-04-11 19:44:03.000000000 +0900
1035+++ b/storage/innobase/row/row0mysql.c 2011-06-06 11:53:18.395764565 +0900
1036@@ -2568,6 +2568,11 @@
1037
1038 current_lsn = log_get_lsn();
1039
1040+ /* Enlarge the fatal lock wait timeout during import. */
1041+ mutex_enter(&kernel_mutex);
1042+ srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */
1043+ mutex_exit(&kernel_mutex);
1044+
1045 /* It is possible, though very improbable, that the lsn's in the
1046 tablespace to be imported have risen above the current system lsn, if
1047 a lengthy purge, ibuf merge, or rollback was performed on a backup
1048@@ -2679,6 +2684,11 @@
1049
1050 trx->op_info = "";
1051
1052+ /* Restore the fatal semaphore wait timeout */
1053+ mutex_enter(&kernel_mutex);
1054+ srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */
1055+ mutex_exit(&kernel_mutex);
1056+
1057 return((int) err);
1058 }
1059
550diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c1060diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
551--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:49:59.230956118 +09001061--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:49:59.230956118 +0900
552+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:52:23.562954411 +09001062+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:52:23.562954411 +0900
553@@ -422,6 +422,8 @@1063@@ -416,6 +416,8 @@
554 UNIV_INTERN ulint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */1064 UNIV_INTERN ulint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */
555 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */1065 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
556 1066
5571067
=== modified file 'innodb_extend_slow.patch'
--- innodb_extend_slow.patch 2011-05-10 11:57:42 +0000
+++ innodb_extend_slow.patch 2011-06-20 09:04:39 +0000
@@ -335,7 +335,7 @@
335diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c335diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
336--- a/storage/innobase/fil/fil0fil.c 2010-12-03 15:53:54.610037199 +0900336--- a/storage/innobase/fil/fil0fil.c 2010-12-03 15:53:54.610037199 +0900
337+++ b/storage/innobase/fil/fil0fil.c 2010-12-03 17:42:42.079064198 +0900337+++ b/storage/innobase/fil/fil0fil.c 2010-12-03 17:42:42.079064198 +0900
338@@ -4423,7 +4423,7 @@338@@ -4747,7 +4747,7 @@
339 node->name, node->handle, buf,339 node->name, node->handle, buf,
340 offset_low, offset_high,340 offset_low, offset_high,
341 page_size * n_pages,341 page_size * n_pages,
@@ -344,7 +344,7 @@
344 #endif344 #endif
345 if (success) {345 if (success) {
346 node->size += n_pages;346 node->size += n_pages;
347@@ -4750,7 +4750,7 @@347@@ -5074,7 +5074,7 @@
348 i/o on a tablespace which does not exist */348 i/o on a tablespace which does not exist */
349 UNIV_INTERN349 UNIV_INTERN
350 ulint350 ulint
@@ -353,7 +353,7 @@
353 /*===*/353 /*===*/
354 ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,354 ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,
355 ORed to OS_FILE_LOG, if a log i/o355 ORed to OS_FILE_LOG, if a log i/o
356@@ -4775,8 +4775,9 @@356@@ -5099,8 +5099,9 @@
357 void* buf, /*!< in/out: buffer where to store read data357 void* buf, /*!< in/out: buffer where to store read data
358 or from where to write; in aio this must be358 or from where to write; in aio this must be
359 appropriately aligned */359 appropriately aligned */
@@ -364,7 +364,7 @@
364 {364 {
365 ulint mode;365 ulint mode;
366 fil_space_t* space;366 fil_space_t* space;
367@@ -4944,7 +4945,7 @@367@@ -5268,7 +5269,7 @@
368 #else368 #else
369 /* Queue the aio request */369 /* Queue the aio request */
370 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,370 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
@@ -376,7 +376,7 @@
376diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc376diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
377--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:36:44.293955189 +0900377--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:36:44.293955189 +0900
378+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:42:42.090024586 +0900378+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:42:42.090024586 +0900
379@@ -1559,6 +1559,16 @@379@@ -1573,6 +1573,16 @@
380 trx->check_unique_secondary = !thd_test_options(380 trx->check_unique_secondary = !thd_test_options(
381 thd, OPTION_RELAXED_UNIQUE_CHECKS);381 thd, OPTION_RELAXED_UNIQUE_CHECKS);
382 382
@@ -393,7 +393,7 @@
393 DBUG_VOID_RETURN;393 DBUG_VOID_RETURN;
394 }394 }
395 395
396@@ -1613,6 +1623,32 @@396@@ -1627,6 +1637,32 @@
397 return(trx);397 return(trx);
398 }398 }
399 399
@@ -426,7 +426,7 @@
426 /*********************************************************************//**426 /*********************************************************************//**
427 Note that a transaction has been registered with MySQL.427 Note that a transaction has been registered with MySQL.
428 @return true if transaction is registered with MySQL 2PC coordinator */428 @return true if transaction is registered with MySQL 2PC coordinator */
429@@ -9296,6 +9332,25 @@429@@ -9301,6 +9337,25 @@
430 statement has ended */430 statement has ended */
431 431
432 if (trx->n_mysql_tables_in_use == 0) {432 if (trx->n_mysql_tables_in_use == 0) {
@@ -648,13 +648,13 @@
648+/* prototypes for new functions added to ha_innodb.cc */648+/* prototypes for new functions added to ha_innodb.cc */
649+ibool innobase_get_slow_log();649+ibool innobase_get_slow_log();
650+650+
651 /* This is set to the MySQL server value for this variable. */651 /* Mutex for locking srv_monitor_file */
652 extern uint srv_lower_case_table_names;652 extern mutex_t srv_monitor_file_mutex;
653 653 /* Temporary file for innodb monitor output */
654diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h654diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
655--- a/storage/innobase/include/trx0trx.h 2010-12-03 15:41:52.049372966 +0900655--- a/storage/innobase/include/trx0trx.h 2010-12-03 15:41:52.049372966 +0900
656+++ b/storage/innobase/include/trx0trx.h 2010-12-03 17:42:42.107024532 +0900656+++ b/storage/innobase/include/trx0trx.h 2010-12-03 17:42:42.107024532 +0900
657@@ -738,6 +738,17 @@657@@ -743,6 +743,17 @@
658 /*------------------------------*/658 /*------------------------------*/
659 char detailed_error[256]; /*!< detailed error message for last659 char detailed_error[256]; /*!< detailed error message for last
660 error, or empty. */660 error, or empty. */
@@ -843,8 +843,8 @@
843 }843 }
844 844
845 ut_a(type == OS_FILE_WRITE);845 ut_a(type == OS_FILE_WRITE);
846@@ -4099,6 +4131,11 @@846@@ -4101,6 +4133,11 @@
847 ut_error;847 array = NULL; /* Eliminate compiler warning */
848 }848 }
849 849
850+ if (trx && type == OS_FILE_READ)850+ if (trx && type == OS_FILE_READ)
@@ -865,10 +865,10 @@
865+/* prototypes for new functions added to ha_innodb.cc */865+/* prototypes for new functions added to ha_innodb.cc */
866+ibool innobase_get_slow_log();866+ibool innobase_get_slow_log();
867+867+
868 /* This is set to the MySQL server value for this variable. It is only868 /* The following counter is incremented whenever there is some user activity
869 needed for FOREIGN KEY definition parsing since FOREIGN KEY names are not869 in the server */
870 stored in the server metadata. The server stores and enforces it for870 UNIV_INTERN ulint srv_activity_count = 0;
871@@ -1244,6 +1247,10 @@871@@ -1232,6 +1235,10 @@
872 ibool has_slept = FALSE;872 ibool has_slept = FALSE;
873 srv_conc_slot_t* slot = NULL;873 srv_conc_slot_t* slot = NULL;
874 ulint i;874 ulint i;
@@ -877,9 +877,9 @@
877+ ulint sec;877+ ulint sec;
878+ ulint ms;878+ ulint ms;
879 879
880 if (trx->mysql_thd != NULL880 #ifdef UNIV_SYNC_DEBUG
881 && thd_is_replication_slave_thread(trx->mysql_thd)) {881 ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
882@@ -1320,6 +1327,7 @@882@@ -1312,6 +1319,7 @@
883 switches. */883 switches. */
884 if (SRV_THREAD_SLEEP_DELAY > 0) {884 if (SRV_THREAD_SLEEP_DELAY > 0) {
885 os_thread_sleep(SRV_THREAD_SLEEP_DELAY);885 os_thread_sleep(SRV_THREAD_SLEEP_DELAY);
@@ -887,10 +887,11 @@
887 }887 }
888 888
889 trx->op_info = "";889 trx->op_info = "";
890@@ -1375,6 +1383,13 @@890@@ -1371,6 +1379,14 @@
891 /* Go to wait for the event; when a thread leaves InnoDB it will891 #ifdef UNIV_SYNC_DEBUG
892 release this thread */892 ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
893 893 #endif /* UNIV_SYNC_DEBUG */
894+
894+ if (innobase_get_slow_log() && trx->take_stats) {895+ if (innobase_get_slow_log() && trx->take_stats) {
895+ ut_usectime(&sec, &ms);896+ ut_usectime(&sec, &ms);
896+ start_time = (ib_uint64_t)sec * 1000000 + ms;897+ start_time = (ib_uint64_t)sec * 1000000 + ms;
@@ -901,7 +902,7 @@
901 trx->op_info = "waiting in InnoDB queue";902 trx->op_info = "waiting in InnoDB queue";
902 903
903 thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);904 thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
904@@ -1383,6 +1398,12 @@905@@ -1379,6 +1395,12 @@
905 906
906 trx->op_info = "";907 trx->op_info = "";
907 908
@@ -917,7 +918,7 @@
917diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c918diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
918--- a/storage/innobase/trx/trx0trx.c 2010-12-03 15:41:52.053955669 +0900919--- a/storage/innobase/trx/trx0trx.c 2010-12-03 15:41:52.053955669 +0900
919+++ b/storage/innobase/trx/trx0trx.c 2010-12-03 17:42:42.127023410 +0900920+++ b/storage/innobase/trx/trx0trx.c 2010-12-03 17:42:42.127023410 +0900
920@@ -185,6 +185,15 @@921@@ -188,6 +188,15 @@
921 trx->global_read_view = NULL;922 trx->global_read_view = NULL;
922 trx->read_view = NULL;923 trx->read_view = NULL;
923 924
@@ -933,9 +934,9 @@
933 /* Set X/Open XA transaction identification to NULL */934 /* Set X/Open XA transaction identification to NULL */
934 memset(&trx->xid, 0, sizeof(trx->xid));935 memset(&trx->xid, 0, sizeof(trx->xid));
935 trx->xid.formatID = -1;936 trx->xid.formatID = -1;
936@@ -222,6 +231,11 @@937@@ -221,6 +230,11 @@
937 938
938 trx->mysql_process_no = os_proc_get_number();939 mutex_exit(&kernel_mutex);
939 940
940+ if (innobase_get_slow_log() && trx->take_stats) {941+ if (innobase_get_slow_log() && trx->take_stats) {
941+ trx->distinct_page_access_hash = mem_alloc(DPAH_SIZE);942+ trx->distinct_page_access_hash = mem_alloc(DPAH_SIZE);
@@ -945,7 +946,7 @@
945 return(trx);946 return(trx);
946 }947 }
947 948
948@@ -353,6 +367,12 @@949@@ -406,6 +420,12 @@
949 /*===============*/950 /*===============*/
950 trx_t* trx) /*!< in, own: trx object */951 trx_t* trx) /*!< in, own: trx object */
951 {952 {
@@ -958,7 +959,7 @@
958 mutex_enter(&kernel_mutex);959 mutex_enter(&kernel_mutex);
959 960
960 UT_LIST_REMOVE(mysql_trx_list, trx_sys->mysql_trx_list, trx);961 UT_LIST_REMOVE(mysql_trx_list, trx_sys->mysql_trx_list, trx);
961@@ -374,6 +394,12 @@962@@ -427,6 +447,12 @@
962 /*====================*/963 /*====================*/
963 trx_t* trx) /*!< in, own: trx object */964 trx_t* trx) /*!< in, own: trx object */
964 {965 {
@@ -971,7 +972,7 @@
971 mutex_enter(&kernel_mutex);972 mutex_enter(&kernel_mutex);
972 973
973 trx_free(trx);974 trx_free(trx);
974@@ -1152,6 +1178,9 @@975@@ -1212,6 +1238,9 @@
975 trx_t* trx) /*!< in: transaction */976 trx_t* trx) /*!< in: transaction */
976 {977 {
977 que_thr_t* thr;978 que_thr_t* thr;
@@ -981,7 +982,7 @@
981 982
982 ut_ad(mutex_own(&kernel_mutex));983 ut_ad(mutex_own(&kernel_mutex));
983 ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);984 ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
984@@ -1166,6 +1195,11 @@985@@ -1226,6 +1255,11 @@
985 thr = UT_LIST_GET_FIRST(trx->wait_thrs);986 thr = UT_LIST_GET_FIRST(trx->wait_thrs);
986 }987 }
987 988
@@ -993,7 +994,7 @@
993 trx->que_state = TRX_QUE_RUNNING;994 trx->que_state = TRX_QUE_RUNNING;
994 }995 }
995 996
996@@ -1179,6 +1213,9 @@997@@ -1239,6 +1273,9 @@
997 trx_t* trx) /*!< in: transaction in the TRX_QUE_LOCK_WAIT state */998 trx_t* trx) /*!< in: transaction in the TRX_QUE_LOCK_WAIT state */
998 {999 {
999 que_thr_t* thr;1000 que_thr_t* thr;
@@ -1003,7 +1004,7 @@
1003 1004
1004 ut_ad(mutex_own(&kernel_mutex));1005 ut_ad(mutex_own(&kernel_mutex));
1005 ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);1006 ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
1006@@ -1193,6 +1230,11 @@1007@@ -1253,6 +1290,11 @@
1007 thr = UT_LIST_GET_FIRST(trx->wait_thrs);1008 thr = UT_LIST_GET_FIRST(trx->wait_thrs);
1008 }1009 }
1009 1010
10101011
=== modified file 'innodb_extra_rseg.patch'
--- innodb_extra_rseg.patch 2011-05-23 03:13:18 +0000
+++ innodb_extra_rseg.patch 2011-06-20 09:04:39 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc8diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
9--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:18:48.879955903 +09009--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:18:48.879955903 +0900
10+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:22:53.779955671 +090010+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:22:53.779955671 +0900
11@@ -11521,6 +11521,7 @@11@@ -11528,6 +11528,7 @@
12 innobase_system_variables, /* system variables */12 innobase_system_variables, /* system variables */
13 NULL /* reserved */13 NULL /* reserved */
14 },14 },
1515
=== added file 'innodb_fake_changes.patch'
--- innodb_fake_changes.patch 1970-01-01 00:00:00 +0000
+++ innodb_fake_changes.patch 2011-06-20 09:04:39 +0000
@@ -0,0 +1,614 @@
1# name : innodb_fake_changes.patch
2# introduced : 5.5.12
3# maintainer : Yasufumi
4#
5#!!! notice !!!
6# Any small change to this file in the main branch
7# should be done or reviewed by the maintainer!
8diff -ruN a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
9--- a/storage/innobase/btr/btr0cur.c 2011-06-01 21:04:26.346416429 +0900
10+++ b/storage/innobase/btr/btr0cur.c 2011-06-01 21:04:53.718415294 +0900
11@@ -1167,6 +1167,11 @@
12 rec_t* rec;
13 roll_ptr_t roll_ptr;
14
15+ if (thr && thr_get_trx(thr)->fake_changes) {
16+ /* skip LOCK, UNDO */
17+ return(DB_SUCCESS);
18+ }
19+
20 /* Check if we have to wait for a lock: enqueue an explicit lock
21 request if yes */
22
23@@ -1298,7 +1303,7 @@
24 }
25 #endif /* UNIV_DEBUG */
26
27- ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
28+ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
29 max_size = page_get_max_insert_size_after_reorganize(page, 1);
30 leaf = page_is_leaf(page);
31
32@@ -1393,6 +1398,12 @@
33 goto fail_err;
34 }
35
36+ if (thr && thr_get_trx(thr)->fake_changes) {
37+ /* skip CHANGE, LOG */
38+ *big_rec = big_rec_vec;
39+ return(err); /* == DB_SUCCESS */
40+ }
41+
42 page_cursor = btr_cur_get_page_cur(cursor);
43
44 /* Now, try the insert */
45@@ -1535,10 +1546,10 @@
46
47 *big_rec = NULL;
48
49- ut_ad(mtr_memo_contains(mtr,
50+ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr,
51 dict_index_get_lock(btr_cur_get_index(cursor)),
52 MTR_MEMO_X_LOCK));
53- ut_ad(mtr_memo_contains(mtr, btr_cur_get_block(cursor),
54+ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, btr_cur_get_block(cursor),
55 MTR_MEMO_PAGE_X_FIX));
56
57 /* Try first an optimistic insert; reset the cursor flag: we do not
58@@ -1604,6 +1615,16 @@
59 }
60 }
61
62+ if (thr && thr_get_trx(thr)->fake_changes) {
63+ /* skip CHANGE, LOG */
64+ if (n_extents > 0) {
65+ fil_space_release_free_extents(index->space,
66+ n_reserved);
67+ }
68+ *big_rec = big_rec_vec;
69+ return(DB_SUCCESS);
70+ }
71+
72 if (dict_index_get_page(index)
73 == buf_block_get_page_no(btr_cur_get_block(cursor))) {
74
75@@ -1660,6 +1681,11 @@
76
77 ut_ad(cursor && update && thr && roll_ptr);
78
79+ if (thr && thr_get_trx(thr)->fake_changes) {
80+ /* skip LOCK, UNDO */
81+ return(DB_SUCCESS);
82+ }
83+
84 rec = btr_cur_get_rec(cursor);
85 index = cursor->index;
86
87@@ -1958,6 +1984,14 @@
88 return(err);
89 }
90
91+ if (trx->fake_changes) {
92+ /* skip CHANGE, LOG */
93+ if (UNIV_LIKELY_NULL(heap)) {
94+ mem_heap_free(heap);
95+ }
96+ return(err); /* == DB_SUCCESS */
97+ }
98+
99 if (block->is_hashed) {
100 /* The function row_upd_changes_ord_field_binary works only
101 if the update vector was built for a clustered index, we must
102@@ -2061,7 +2095,7 @@
103 rec = btr_cur_get_rec(cursor);
104 index = cursor->index;
105 ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
106- ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
107+ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
108 /* The insert buffer tree should never be updated in place. */
109 ut_ad(!dict_index_is_ibuf(index));
110
111@@ -2171,6 +2205,11 @@
112 goto err_exit;
113 }
114
115+ if (thr && thr_get_trx(thr)->fake_changes) {
116+ /* skip CHANGE, LOG */
117+ goto err_exit; /* == DB_SUCCESS */
118+ }
119+
120 /* Ok, we may do the replacement. Store on the page infimum the
121 explicit locks on rec, before deleting rec (see the comment in
122 btr_cur_pessimistic_update). */
123@@ -2321,9 +2360,9 @@
124 rec = btr_cur_get_rec(cursor);
125 index = cursor->index;
126
127- ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
128+ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, dict_index_get_lock(index),
129 MTR_MEMO_X_LOCK));
130- ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
131+ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
132 #ifdef UNIV_ZIP_DEBUG
133 ut_a(!page_zip || page_zip_validate(page_zip, page));
134 #endif /* UNIV_ZIP_DEBUG */
135@@ -2411,6 +2450,9 @@
136
137 ut_ad(big_rec_vec == NULL);
138
139+ /* fake_changes should not cause undo. so never reaches here */
140+ ut_ad(!(trx->fake_changes));
141+
142 btr_rec_free_updated_extern_fields(
143 index, rec, page_zip, offsets, update,
144 trx_is_recv(trx) ? RB_RECOVERY : RB_NORMAL, mtr);
145@@ -2445,6 +2487,12 @@
146 }
147 }
148
149+ if (trx->fake_changes) {
150+ /* skip CHANGE, LOG */
151+ err = DB_SUCCESS;
152+ goto return_after_reservations;
153+ }
154+
155 /* Store state of explicit locks on rec on the page infimum record,
156 before deleting rec. The page infimum acts as a dummy carrier of the
157 locks, taking care also of lock releases, before we can move the locks
158@@ -2746,6 +2794,11 @@
159 ut_ad(dict_index_is_clust(index));
160 ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
161
162+ if (thr && thr_get_trx(thr)->fake_changes) {
163+ /* skip LOCK, UNDO, CHANGE, LOG */
164+ return(DB_SUCCESS);
165+ }
166+
167 err = lock_clust_rec_modify_check_and_lock(flags, block,
168 rec, index, offsets, thr);
169
170@@ -2883,6 +2936,11 @@
171 rec_t* rec;
172 ulint err;
173
174+ if (thr && thr_get_trx(thr)->fake_changes) {
175+ /* skip LOCK, CHANGE, LOG */
176+ return(DB_SUCCESS);
177+ }
178+
179 block = btr_cur_get_block(cursor);
180 rec = btr_cur_get_rec(cursor);
181
182diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
183--- a/storage/innobase/handler/ha_innodb.cc 2011-06-01 21:04:26.511385596 +0900
184+++ b/storage/innobase/handler/ha_innodb.cc 2011-06-01 21:04:53.723390828 +0900
185@@ -484,6 +484,12 @@
186 " or 2 (write at commit, flush once per second).",
187 NULL, NULL, 1, 0, 2, 0);
188
189+static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
190+ "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "
191+ "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "
192+ "ATTENTION: the transaction started after enabled is affected.",
193+ NULL, NULL, FALSE);
194+
195
196 static handler *innobase_create_handler(handlerton *hton,
197 TABLE_SHARE *table,
198@@ -1675,6 +1681,8 @@
199 trx->check_unique_secondary = !thd_test_options(
200 thd, OPTION_RELAXED_UNIQUE_CHECKS);
201
202+ trx->fake_changes = THDVAR(thd, fake_changes);
203+
204 #ifdef EXTENDED_SLOWLOG
205 if (thd_log_slow_verbosity(thd) & SLOG_V_INNODB) {
206 trx->take_stats = TRUE;
207@@ -7486,12 +7494,20 @@
208
209 parent_trx = check_trx_exists(thd);
210
211+
212+ if (parent_trx->fake_changes
213+ && thd_sql_command(thd) != SQLCOM_CREATE_TABLE) {
214+ sql_print_error("innodb_fake_changes cannot treat new table during other than CREATE TABLE. (%s)\n", name);
215+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
216+ }
217+
218 /* In case MySQL calls this in the middle of a SELECT query, release
219 possible adaptive hash latch to avoid deadlocks of threads */
220
221 trx_search_latch_release_if_reserved(parent_trx);
222
223 trx = innobase_trx_allocate(thd);
224+ trx->fake_changes = FALSE;
225
226 /* Latch the InnoDB data dictionary exclusively so that no deadlocks
227 or lock waits can happen in it during a table create operation.
228@@ -7701,6 +7717,7 @@
229 /*==============================*/
230 {
231 int error;
232+ ibool fake_changes_reserved = FALSE;
233
234 DBUG_ENTER("ha_innobase::truncate");
235
236@@ -7713,10 +7730,21 @@
237 DBUG_RETURN(HA_ERR_CRASHED);
238 }
239
240+ if (prebuilt->trx->fake_changes) {
241+ /* disable temporally */
242+ prebuilt->trx->fake_changes = FALSE;
243+ fake_changes_reserved = TRUE;
244+ }
245+
246 /* Truncate the table in InnoDB */
247
248 error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
249
250+ if (fake_changes_reserved) {
251+ prebuilt->trx->fake_changes = TRUE;
252+ fake_changes_reserved = FALSE;
253+ }
254+
255 if (share->ib_table->is_corrupt) {
256 DBUG_RETURN(HA_ERR_CRASHED);
257 }
258@@ -7768,6 +7796,7 @@
259 trx_search_latch_release_if_reserved(parent_trx);
260
261 trx = innobase_trx_allocate(thd);
262+ trx->fake_changes = FALSE;
263
264 name_len = strlen(name);
265
266@@ -7855,6 +7884,7 @@
267 trx->mysql_thd = NULL;
268 #else
269 trx = innobase_trx_allocate(thd);
270+ trx->fake_changes = FALSE;
271 #endif
272 row_drop_database_for_mysql(namebuf, trx);
273 my_free(namebuf);
274@@ -7960,6 +7990,7 @@
275 trx_search_latch_release_if_reserved(parent_trx);
276
277 trx = innobase_trx_allocate(thd);
278+ trx->fake_changes = FALSE;
279
280 error = innobase_rename_table(trx, from, to, TRUE);
281
282@@ -12228,6 +12259,7 @@
283 MYSQL_SYSVAR(rollback_segments),
284 MYSQL_SYSVAR(corrupt_table_action),
285 MYSQL_SYSVAR(lazy_drop_table),
286+ MYSQL_SYSVAR(fake_changes),
287 NULL
288 };
289
290diff -ruN a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
291--- a/storage/innobase/handler/handler0alter.cc 2011-04-11 19:44:03.000000000 +0900
292+++ b/storage/innobase/handler/handler0alter.cc 2011-06-01 21:04:53.728495636 +0900
293@@ -641,6 +641,7 @@
294 ibool dict_locked = FALSE;
295 ulint new_primary;
296 int error;
297+ ulint should_fake_changes = FALSE;
298
299 DBUG_ENTER("ha_innobase::add_index");
300 ut_a(table);
301@@ -677,11 +678,17 @@
302 }
303
304 heap = mem_heap_create(1024);
305+
306+ if (prebuilt->trx->fake_changes) {
307+ prebuilt->trx->fake_changes = FALSE;
308+ should_fake_changes = TRUE;
309+ }
310 trx_start_if_not_started(prebuilt->trx);
311
312 /* Create a background transaction for the operations on
313 the data dictionary tables. */
314 trx = innobase_trx_allocate(user_thd);
315+ trx->fake_changes = FALSE;
316 trx_start_if_not_started(trx);
317
318 /* Create table containing all indexes to be built in this
319@@ -760,6 +767,9 @@
320 row_mysql_unlock_data_dictionary(trx);
321 trx_free_for_mysql(trx);
322 trx_commit_for_mysql(prebuilt->trx);
323+ if (should_fake_changes) {
324+ prebuilt->trx->fake_changes = TRUE;
325+ }
326 DBUG_RETURN(error);
327 }
328
329@@ -925,6 +935,9 @@
330 trx_commit_for_mysql(trx);
331 if (prebuilt->trx) {
332 trx_commit_for_mysql(prebuilt->trx);
333+ if (should_fake_changes) {
334+ prebuilt->trx->fake_changes = TRUE;
335+ }
336 }
337
338 if (dict_locked) {
339@@ -1172,6 +1185,7 @@
340 /* Create a background transaction for the operations on
341 the data dictionary tables. */
342 trx = innobase_trx_allocate(user_thd);
343+ trx->fake_changes = FALSE;
344 trx_start_if_not_started(trx);
345
346 /* Flag this transaction as a dictionary operation, so that
347diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
348--- a/storage/innobase/ibuf/ibuf0ibuf.c 2011-06-01 21:04:26.529383815 +0900
349+++ b/storage/innobase/ibuf/ibuf0ibuf.c 2011-06-01 21:04:53.732416483 +0900
350@@ -3496,6 +3496,8 @@
351
352 ut_a(trx_sys_multiple_tablespace_format);
353
354+ ut_ad(!(thr_get_trx(thr)->fake_changes));
355+
356 do_merge = FALSE;
357
358 /* Perform dirty reads of ibuf->size and ibuf->max_size, to
359diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
360--- a/storage/innobase/include/trx0trx.h 2011-06-01 21:04:25.762416618 +0900
361+++ b/storage/innobase/include/trx0trx.h 2011-06-01 21:04:53.736387944 +0900
362@@ -512,6 +512,7 @@
363 FALSE, one can save CPU time and about
364 150 bytes in the undo log size as then
365 we skip XA steps */
366+ ulint fake_changes;
367 ulint flush_log_later;/* In 2PC, we hold the
368 prepare_commit mutex across
369 both phases. In that case, we
370diff -ruN a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
371--- a/storage/innobase/lock/lock0lock.c 2011-06-01 21:04:26.543396960 +0900
372+++ b/storage/innobase/lock/lock0lock.c 2011-06-01 21:04:53.739416526 +0900
373@@ -3909,6 +3909,10 @@
374
375 trx = thr_get_trx(thr);
376
377+ if (trx->fake_changes && mode == LOCK_IX) {
378+ mode = LOCK_IS;
379+ }
380+
381 lock_mutex_enter_kernel();
382
383 /* Look for stronger locks the same trx already has on the table */
384@@ -5107,6 +5111,11 @@
385 }
386
387 trx = thr_get_trx(thr);
388+
389+ if (trx->fake_changes) {
390+ return(DB_SUCCESS);
391+ }
392+
393 next_rec = page_rec_get_next_const(rec);
394 next_rec_heap_no = page_rec_get_heap_no(next_rec);
395
396@@ -5275,6 +5284,10 @@
397 return(DB_SUCCESS);
398 }
399
400+ if (thr && thr_get_trx(thr)->fake_changes) {
401+ return(DB_SUCCESS);
402+ }
403+
404 heap_no = rec_offs_comp(offsets)
405 ? rec_get_heap_no_new(rec)
406 : rec_get_heap_no_old(rec);
407@@ -5333,6 +5346,10 @@
408 return(DB_SUCCESS);
409 }
410
411+ if (thr && thr_get_trx(thr)->fake_changes) {
412+ return(DB_SUCCESS);
413+ }
414+
415 heap_no = page_rec_get_heap_no(rec);
416
417 /* Another transaction cannot have an implicit lock on the record,
418@@ -5420,6 +5437,10 @@
419 return(DB_SUCCESS);
420 }
421
422+ if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) {
423+ mode = LOCK_S;
424+ }
425+
426 heap_no = page_rec_get_heap_no(rec);
427
428 lock_mutex_enter_kernel();
429@@ -5496,6 +5517,10 @@
430 return(DB_SUCCESS);
431 }
432
433+ if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) {
434+ mode = LOCK_S;
435+ }
436+
437 heap_no = page_rec_get_heap_no(rec);
438
439 lock_mutex_enter_kernel();
440diff -ruN a/storage/innobase/que/que0que.c b/storage/innobase/que/que0que.c
441--- a/storage/innobase/que/que0que.c 2011-06-01 21:04:25.553416889 +0900
442+++ b/storage/innobase/que/que0que.c 2011-06-01 21:04:53.743419001 +0900
443@@ -1417,6 +1417,12 @@
444
445 ut_a(trx->error_state == DB_SUCCESS);
446
447+ if (trx->fake_changes) {
448+ /* fake_changes should not access to system tables */
449+ fprintf(stderr, "InnoDB: ERROR: innodb_fake_changes tried to access to system tables.\n");
450+ return(DB_ERROR);
451+ }
452+
453 if (reserve_dict_mutex) {
454 mutex_enter(&dict_sys->mutex);
455 }
456diff -ruN a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
457--- a/storage/innobase/row/row0ins.c 2011-06-01 21:04:26.099449453 +0900
458+++ b/storage/innobase/row/row0ins.c 2011-06-01 21:04:53.746383371 +0900
459@@ -1499,6 +1499,11 @@
460 if (UNIV_LIKELY_NULL(heap)) {
461 mem_heap_free(heap);
462 }
463+
464+ if (trx->fake_changes) {
465+ err = DB_SUCCESS;
466+ }
467+
468 return(err);
469 }
470
471@@ -2004,7 +2009,7 @@
472 }
473
474 btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
475- search_mode,
476+ thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : search_mode,
477 &cursor, 0, __FILE__, __LINE__, &mtr);
478
479 if (cursor.flag == BTR_CUR_INSERT_TO_IBUF) {
480@@ -2065,7 +2070,7 @@
481
482 btr_cur_search_to_nth_level(index, 0, entry,
483 PAGE_CUR_LE,
484- mode | BTR_INSERT,
485+ thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : (mode | BTR_INSERT),
486 &cursor, 0,
487 __FILE__, __LINE__, &mtr);
488 }
489@@ -2119,6 +2124,22 @@
490 if (UNIV_LIKELY_NULL(big_rec)) {
491 rec_t* rec;
492 ulint* offsets;
493+
494+ if (thr_get_trx(thr)->fake_changes) {
495+ /* skip store extern */
496+ if (modify) {
497+ dtuple_big_rec_free(big_rec);
498+ } else {
499+ dtuple_convert_back_big_rec(index, entry, big_rec);
500+ }
501+
502+ if (UNIV_LIKELY_NULL(heap)) {
503+ mem_heap_free(heap);
504+ }
505+
506+ return(err);
507+ }
508+
509 mtr_start(&mtr);
510
511 btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
512diff -ruN a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
513--- a/storage/innobase/row/row0mysql.c 2011-06-01 21:04:26.287385626 +0900
514+++ b/storage/innobase/row/row0mysql.c 2011-06-01 21:04:53.749372325 +0900
515@@ -1245,6 +1245,7 @@
516 prebuilt->table->stat_n_rows--;
517 }
518
519+ if (!(trx->fake_changes))
520 row_update_statistics_if_needed(prebuilt->table);
521 trx->op_info = "";
522
523@@ -1504,6 +1505,7 @@
524 that changes indexed columns, UPDATEs that change only non-indexed
525 columns would not affect statistics. */
526 if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
527+ if (!(trx->fake_changes))
528 row_update_statistics_if_needed(prebuilt->table);
529 }
530
531@@ -1721,6 +1723,7 @@
532 srv_n_rows_updated++;
533 }
534
535+ if (!(trx->fake_changes))
536 row_update_statistics_if_needed(table);
537
538 return(err);
539diff -ruN a/storage/innobase/row/row0upd.c b/storage/innobase/row/row0upd.c
540--- a/storage/innobase/row/row0upd.c 2011-06-01 21:04:25.588384975 +0900
541+++ b/storage/innobase/row/row0upd.c 2011-06-01 21:04:53.753385366 +0900
542@@ -1603,7 +1603,8 @@
543 mode |= BTR_DELETE_MARK;
544 }
545
546- search_result = row_search_index_entry(index, entry, mode,
547+ search_result = row_search_index_entry(index, entry,
548+ trx->fake_changes ? BTR_SEARCH_LEAF : mode,
549 &pcur, &mtr);
550
551 btr_cur = btr_pcur_get_btr_cur(&pcur);
552@@ -1850,9 +1851,11 @@
553 the previous invocation of this function. Mark the
554 off-page columns in the entry inherited. */
555
556+ if (!(trx->fake_changes)) {
557 change_ownership = row_upd_clust_rec_by_insert_inherit(
558 NULL, NULL, entry, node->update);
559 ut_a(change_ownership);
560+ }
561 /* fall through */
562 case UPD_NODE_INSERT_CLUSTERED:
563 /* A lock wait occurred in row_ins_index_entry() in
564@@ -1882,7 +1885,7 @@
565 delete-marked old record, mark them disowned by the
566 old record and owned by the new entry. */
567
568- if (rec_offs_any_extern(offsets)) {
569+ if (rec_offs_any_extern(offsets) && !(trx->fake_changes)) {
570 change_ownership = row_upd_clust_rec_by_insert_inherit(
571 rec, offsets, entry, node->update);
572
573@@ -2012,7 +2015,8 @@
574 the same transaction do not modify the record in the meantime.
575 Therefore we can assert that the restoration of the cursor succeeds. */
576
577- ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
578+ ut_a(btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : BTR_MODIFY_TREE,
579+ pcur, mtr));
580
581 ut_ad(!rec_get_deleted_flag(btr_pcur_get_rec(pcur),
582 dict_table_is_comp(index->table)));
583@@ -2022,7 +2026,8 @@
584 node->cmpl_info, thr, mtr);
585 mtr_commit(mtr);
586
587- if (err == DB_SUCCESS && big_rec) {
588+ /* skip store extern for fake_changes */
589+ if (err == DB_SUCCESS && big_rec && !(thr_get_trx(thr)->fake_changes)) {
590 ulint offsets_[REC_OFFS_NORMAL_SIZE];
591 rec_t* rec;
592 rec_offs_init(offsets_);
593@@ -2146,7 +2151,8 @@
594
595 ut_a(pcur->rel_pos == BTR_PCUR_ON);
596
597- success = btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur, mtr);
598+ success = btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : BTR_MODIFY_LEAF,
599+ pcur, mtr);
600
601 if (!success) {
602 err = DB_RECORD_NOT_FOUND;
603diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
604--- a/storage/innobase/trx/trx0trx.c 2011-06-01 21:04:26.411537237 +0900
605+++ b/storage/innobase/trx/trx0trx.c 2011-06-01 21:04:53.756415956 +0900
606@@ -121,6 +121,8 @@
607
608 trx->support_xa = TRUE;
609
610+ trx->fake_changes = FALSE;
611+
612 trx->check_foreigns = TRUE;
613 trx->check_unique_secondary = TRUE;
614
0615
=== modified file 'innodb_fast_checksum.patch'
--- innodb_fast_checksum.patch 2011-05-10 11:57:42 +0000
+++ innodb_fast_checksum.patch 2011-06-20 09:04:39 +0000
@@ -109,8 +109,34 @@
109diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c109diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
110--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:52:23.406513743 +0900110--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:52:23.406513743 +0900
111+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:53:45.020513800 +0900111+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:53:45.020513800 +0900
112@@ -3199,7 +3199,9 @@112@@ -3094,13 +3094,24 @@
113 mach_write_to_8(page + FIL_PAGE_FILE_FLUSH_LSN, current_lsn);113 return(TRUE);
114 }
115
116- if (checksum_field != 0
117+ if (!srv_fast_checksum
118+ && checksum_field != 0
119 && checksum_field != BUF_NO_CHECKSUM_MAGIC
120 && checksum_field
121 != buf_calc_page_new_checksum(page)) {
122 return(TRUE);
123 }
124
125+ if (srv_fast_checksum
126+ && checksum_field != 0
127+ && checksum_field != BUF_NO_CHECKSUM_MAGIC
128+ && checksum_field
129+ != buf_calc_page_new_checksum_32(page)
130+ && checksum_field
131+ != buf_calc_page_new_checksum(page)) {
132+ return(TRUE);
133+ }
134+
135 return(FALSE);
136 }
137
138@@ -3116,7 +3127,9 @@
139 if (!zip_size) {
114 mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,140 mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
115 srv_use_checksums141 srv_use_checksums
116- ? buf_calc_page_new_checksum(page)142- ? buf_calc_page_new_checksum(page)
@@ -120,45 +146,6 @@
120 : BUF_NO_CHECKSUM_MAGIC);146 : BUF_NO_CHECKSUM_MAGIC);
121 mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,147 mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
122 srv_use_checksums148 srv_use_checksums
123@@ -3331,7 +3333,8 @@
124 page_is_corrupt = TRUE;
125 }
126
127- if (checksum_field != 0
128+ if (!srv_fast_checksum
129+ && checksum_field != 0
130 && checksum_field != BUF_NO_CHECKSUM_MAGIC
131 && checksum_field
132 != buf_calc_page_new_checksum(page)) {
133@@ -3339,6 +3342,17 @@
134 page_is_corrupt = TRUE;
135 }
136
137+ if (srv_fast_checksum
138+ && checksum_field != 0
139+ && checksum_field != BUF_NO_CHECKSUM_MAGIC
140+ && checksum_field
141+ != buf_calc_page_new_checksum_32(page)
142+ && checksum_field
143+ != buf_calc_page_new_checksum(page)) {
144+
145+ page_is_corrupt = TRUE;
146+ }
147+
148 /* if it is free page, inconsistency is acceptable */
149 if (!offset) {
150 /* header page*/
151@@ -3484,7 +3498,9 @@
152
153 mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
154 srv_use_checksums
155- ? buf_calc_page_new_checksum(page)
156+ ? (!srv_fast_checksum
157+ ? buf_calc_page_new_checksum(page)
158+ : buf_calc_page_new_checksum_32(page))
159 : BUF_NO_CHECKSUM_MAGIC);
160 mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
161 srv_use_checksums
162diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc149diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
163--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:52:23.420480329 +0900150--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:52:23.420480329 +0900
164+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:53:45.029551892 +0900151+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:53:45.029551892 +0900
@@ -170,7 +157,7 @@
170 static my_bool innobase_recovery_stats = TRUE;157 static my_bool innobase_recovery_stats = TRUE;
171 static my_bool innobase_locks_unsafe_for_binlog = FALSE;158 static my_bool innobase_locks_unsafe_for_binlog = FALSE;
172 static my_bool innobase_overwrite_relay_log_info = FALSE;159 static my_bool innobase_overwrite_relay_log_info = FALSE;
173@@ -2606,6 +2607,7 @@160@@ -2620,6 +2621,7 @@
174 161
175 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;162 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
176 srv_use_checksums = (ibool) innobase_use_checksums;163 srv_use_checksums = (ibool) innobase_use_checksums;
@@ -178,7 +165,7 @@
178 165
179 #ifdef HAVE_LARGE_PAGES166 #ifdef HAVE_LARGE_PAGES
180 if ((os_use_large_pages = (ibool) my_use_large_pages))167 if ((os_use_large_pages = (ibool) my_use_large_pages))
181@@ -11414,6 +11416,15 @@168@@ -11421,6 +11423,15 @@
182 "Disable with --skip-innodb-checksums.",169 "Disable with --skip-innodb-checksums.",
183 NULL, NULL, TRUE);170 NULL, NULL, TRUE);
184 171
@@ -194,7 +181,7 @@
194 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,181 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
195 PLUGIN_VAR_READONLY,182 PLUGIN_VAR_READONLY,
196 "The common part for InnoDB table spaces.",183 "The common part for InnoDB table spaces.",
197@@ -11922,6 +11933,7 @@184@@ -11930,6 +11941,7 @@
198 MYSQL_SYSVAR(buffer_pool_size),185 MYSQL_SYSVAR(buffer_pool_size),
199 MYSQL_SYSVAR(buffer_pool_instances),186 MYSQL_SYSVAR(buffer_pool_instances),
200 MYSQL_SYSVAR(checksums),187 MYSQL_SYSVAR(checksums),
@@ -231,7 +218,7 @@
231diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h218diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
232--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:52:23.474482590 +0900219--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:52:23.474482590 +0900
233+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:53:45.048512100 +0900220+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:53:45.048512100 +0900
234@@ -227,6 +227,7 @@221@@ -224,6 +224,7 @@
235 222
236 extern ibool srv_use_doublewrite_buf;223 extern ibool srv_use_doublewrite_buf;
237 extern ibool srv_use_checksums;224 extern ibool srv_use_checksums;
@@ -291,7 +278,7 @@
291diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c278diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
292--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:52:23.498513634 +0900279--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:52:23.498513634 +0900
293+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:53:45.053550283 +0900280+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:53:45.053550283 +0900
294@@ -420,6 +420,7 @@281@@ -414,6 +414,7 @@
295 282
296 UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE;283 UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE;
297 UNIV_INTERN ibool srv_use_checksums = TRUE;284 UNIV_INTERN ibool srv_use_checksums = TRUE;
298285
=== modified file 'innodb_files_extend.patch'
--- innodb_files_extend.patch 2011-05-10 11:57:42 +0000
+++ innodb_files_extend.patch 2011-06-20 09:04:39 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c8diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
9--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:21.358513751 +09009--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:21.358513751 +0900
10+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:58.243481131 +090010+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:58.243481131 +0900
11@@ -729,7 +729,7 @@11@@ -731,7 +731,7 @@
12 ut_a(space->purpose != FIL_LOG);12 ut_a(space->purpose != FIL_LOG);
13 ut_a(!trx_sys_sys_space(space->id));13 ut_a(!trx_sys_sys_space(space->id));
14 14
@@ -17,16 +17,7 @@
17 fprintf(stderr,17 fprintf(stderr,
18 "InnoDB: Error: the size of single-table"18 "InnoDB: Error: the size of single-table"
19 " tablespace file %s\n"19 " tablespace file %s\n"
20@@ -3216,7 +3216,7 @@20@@ -4151,7 +4151,7 @@
21
22 if (size_bytes < free_limit_bytes) {
23 free_limit_bytes = size_bytes;
24- if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
25+ if (size_bytes >= (lint)FSP_EXTENT_SIZE * (lint)UNIV_PAGE_SIZE) {
26 fprintf(stderr, "InnoDB: free limit of %s is larger than its real size.\n", filepath);
27 file_is_corrupt = TRUE;
28 }
29@@ -3830,7 +3830,7 @@
30 21
31 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;22 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
32 #ifndef UNIV_HOTBACKUP23 #ifndef UNIV_HOTBACKUP
@@ -35,7 +26,7 @@
35 fprintf(stderr,26 fprintf(stderr,
36 "InnoDB: Error: the size of single-table tablespace"27 "InnoDB: Error: the size of single-table tablespace"
37 " file %s\n"28 " file %s\n"
38@@ -3850,7 +3850,7 @@29@@ -4171,7 +4171,7 @@
39 /* Align the memory for file i/o if we might have O_DIRECT set */30 /* Align the memory for file i/o if we might have O_DIRECT set */
40 page = ut_align(buf2, UNIV_PAGE_SIZE);31 page = ut_align(buf2, UNIV_PAGE_SIZE);
41 32
@@ -44,7 +35,7 @@
44 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);35 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
45 36
46 /* We have to read the tablespace id from the file */37 /* We have to read the tablespace id from the file */
47@@ -4828,9 +4828,9 @@38@@ -5149,9 +5149,9 @@
48 ut_ad(ut_is_2pow(zip_size));39 ut_ad(ut_is_2pow(zip_size));
49 ut_ad(buf);40 ut_ad(buf);
50 ut_ad(len > 0);41 ut_ad(len > 0);
@@ -121,7 +112,7 @@
121 static my_bool innobase_thread_concurrency_timer_based;112 static my_bool innobase_thread_concurrency_timer_based;
122 static long long innobase_buffer_pool_size, innobase_log_file_size;113 static long long innobase_buffer_pool_size, innobase_log_file_size;
123 114
124@@ -2302,6 +2305,65 @@115@@ -2316,6 +2319,65 @@
125 }116 }
126 #endif /* DBUG_OFF */117 #endif /* DBUG_OFF */
127 118
@@ -187,7 +178,7 @@
187 #ifndef MYSQL_SERVER178 #ifndef MYSQL_SERVER
188 innodb_overwrite_relay_log_info = FALSE;179 innodb_overwrite_relay_log_info = FALSE;
189 #endif180 #endif
190@@ -7253,9 +7315,9 @@181@@ -7241,9 +7303,9 @@
191 | DICT_TF_COMPACT182 | DICT_TF_COMPACT
192 | DICT_TF_FORMAT_ZIP183 | DICT_TF_FORMAT_ZIP
193 << DICT_TF_FORMAT_SHIFT;184 << DICT_TF_FORMAT_SHIFT;
@@ -200,7 +191,7 @@
200 }191 }
201 }192 }
202 193
203@@ -11425,6 +11487,16 @@194@@ -11432,6 +11494,16 @@
204 "#### Attention: The checksum is not compatible for normal or disabled version! ####",195 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
205 NULL, NULL, FALSE);196 NULL, NULL, FALSE);
206 197
@@ -217,7 +208,7 @@
217 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,208 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
218 PLUGIN_VAR_READONLY,209 PLUGIN_VAR_READONLY,
219 "The common part for InnoDB table spaces.",210 "The common part for InnoDB table spaces.",
220@@ -11928,6 +12000,8 @@211@@ -11936,6 +12008,8 @@
221 NULL, NULL, 0, &corrupt_table_action_typelib);212 NULL, NULL, 0, &corrupt_table_action_typelib);
222 213
223 static struct st_mysql_sys_var* innobase_system_variables[]= {214 static struct st_mysql_sys_var* innobase_system_variables[]= {
@@ -229,7 +220,7 @@
229diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h220diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
230--- a/storage/innobase/include/buf0buf.h 2010-12-04 15:55:21.375482937 +0900221--- a/storage/innobase/include/buf0buf.h 2010-12-04 15:55:21.375482937 +0900
231+++ b/storage/innobase/include/buf0buf.h 2010-12-04 15:55:58.258469088 +0900222+++ b/storage/innobase/include/buf0buf.h 2010-12-04 15:55:58.258469088 +0900
232@@ -1684,7 +1684,7 @@223@@ -1683,7 +1683,7 @@
233 time_t last_printout_time;224 time_t last_printout_time;
234 /*!< when buf_print_io was last time225 /*!< when buf_print_io was last time
235 called */226 called */
@@ -238,7 +229,7 @@
238 /*!< Statistics of buddy system,229 /*!< Statistics of buddy system,
239 indexed by block size */230 indexed by block size */
240 buf_pool_stat_t stat; /*!< current statistics */231 buf_pool_stat_t stat; /*!< current statistics */
241@@ -1780,7 +1780,7 @@232@@ -1779,7 +1779,7 @@
242 /* @{ */233 /* @{ */
243 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;234 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
244 /*!< unmodified compressed pages */235 /*!< unmodified compressed pages */
@@ -247,7 +238,7 @@
247 /*!< buddy free lists */238 /*!< buddy free lists */
248 239
249 buf_page_t watch[BUF_POOL_WATCH_SIZE];240 buf_page_t watch[BUF_POOL_WATCH_SIZE];
250@@ -1788,9 +1788,9 @@241@@ -1787,9 +1787,9 @@
251 pool watches. Protected by242 pool watches. Protected by
252 buf_pool->mutex. */243 buf_pool->mutex. */
253 244
@@ -379,7 +370,7 @@
379diff -ruN a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i370diff -ruN a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
380--- a/storage/innobase/include/univ.i 2010-11-03 07:01:13.000000000 +0900371--- a/storage/innobase/include/univ.i 2010-11-03 07:01:13.000000000 +0900
381+++ b/storage/innobase/include/univ.i 2010-12-04 15:55:58.263549721 +0900372+++ b/storage/innobase/include/univ.i 2010-12-04 15:55:58.263549721 +0900
382@@ -298,9 +298,13 @@373@@ -311,9 +311,13 @@
383 */374 */
384 375
385 /* The 2-logarithm of UNIV_PAGE_SIZE: */376 /* The 2-logarithm of UNIV_PAGE_SIZE: */
@@ -395,7 +386,7 @@
395 386
396 /* Maximum number of parallel threads in a parallelized operation */387 /* Maximum number of parallel threads in a parallelized operation */
397 #define UNIV_MAX_PARALLELISM 32388 #define UNIV_MAX_PARALLELISM 32
398@@ -419,7 +423,7 @@389@@ -432,7 +436,7 @@
399 stored part of the field in the tablespace. The length field then390 stored part of the field in the tablespace. The length field then
400 contains the sum of the following flag and the locally stored len. */391 contains the sum of the following flag and the locally stored len. */
401 392
@@ -404,7 +395,7 @@
404 395
405 /* Some macros to improve branch prediction and reduce cache misses */396 /* Some macros to improve branch prediction and reduce cache misses */
406 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)397 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
407@@ -522,4 +526,6 @@398@@ -535,4 +539,6 @@
408 UNIV_MEM_ALLOC(addr, size); \399 UNIV_MEM_ALLOC(addr, size); \
409 } while (0)400 } while (0)
410 401
@@ -547,7 +538,7 @@
547diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c538diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
548--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:21.384486344 +0900539--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:21.384486344 +0900
549+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:58.282550845 +0900540+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:58.282550845 +0900
550@@ -240,6 +240,13 @@541@@ -234,6 +234,13 @@
551 UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;542 UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;
552 UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;543 UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;
553 544
554545
=== modified file 'innodb_fix_misc.patch'
--- innodb_fix_misc.patch 2011-05-18 00:03:53 +0000
+++ innodb_fix_misc.patch 2011-06-20 09:04:39 +0000
@@ -13,7 +13,7 @@
13diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c13diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
14--- a/storage/innobase/buf/buf0buf.c 2011-02-23 19:00:48.178696354 +090014--- a/storage/innobase/buf/buf0buf.c 2011-02-23 19:00:48.178696354 +0900
15+++ b/storage/innobase/buf/buf0buf.c 2011-02-23 19:01:19.138826278 +090015+++ b/storage/innobase/buf/buf0buf.c 2011-02-23 19:01:19.138826278 +0900
16@@ -4063,6 +4063,7 @@16@@ -4061,6 +4061,7 @@
17 bpage->state = BUF_BLOCK_ZIP_PAGE;17 bpage->state = BUF_BLOCK_ZIP_PAGE;
18 bpage->space = space;18 bpage->space = space;
19 bpage->offset = offset;19 bpage->offset = offset;
@@ -102,7 +102,7 @@
102diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c102diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
103--- a/storage/innobase/fil/fil0fil.c 2011-02-23 19:00:48.223696428 +0900103--- a/storage/innobase/fil/fil0fil.c 2011-02-23 19:00:48.223696428 +0900
104+++ b/storage/innobase/fil/fil0fil.c 2011-02-23 19:01:19.147655510 +0900104+++ b/storage/innobase/fil/fil0fil.c 2011-02-23 19:01:19.147655510 +0900
105@@ -252,6 +252,7 @@105@@ -254,6 +254,7 @@
106 struct fil_system_struct {106 struct fil_system_struct {
107 #ifndef UNIV_HOTBACKUP107 #ifndef UNIV_HOTBACKUP
108 mutex_t mutex; /*!< The mutex protecting the cache */108 mutex_t mutex; /*!< The mutex protecting the cache */
@@ -110,7 +110,7 @@
110 #endif /* !UNIV_HOTBACKUP */110 #endif /* !UNIV_HOTBACKUP */
111 hash_table_t* spaces; /*!< The hash table of spaces in the111 hash_table_t* spaces; /*!< The hash table of spaces in the
112 system; they are hashed on the space112 system; they are hashed on the space
113@@ -861,7 +862,7 @@113@@ -863,7 +864,7 @@
114 ut_ad(node && system);114 ut_ad(node && system);
115 ut_ad(mutex_own(&(system->mutex)));115 ut_ad(mutex_own(&(system->mutex)));
116 ut_a(node->open);116 ut_a(node->open);
@@ -119,7 +119,7 @@
119 ut_a(node->n_pending_flushes == 0);119 ut_a(node->n_pending_flushes == 0);
120 ut_a(node->modification_counter == node->flush_counter);120 ut_a(node->modification_counter == node->flush_counter);
121 121
122@@ -874,7 +875,7 @@122@@ -876,7 +877,7 @@
123 ut_a(system->n_open > 0);123 ut_a(system->n_open > 0);
124 system->n_open--;124 system->n_open--;
125 125
@@ -128,7 +128,7 @@
128 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);128 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);
129 129
130 /* The node is in the LRU list, remove it */130 /* The node is in the LRU list, remove it */
131@@ -1073,7 +1074,7 @@131@@ -1075,7 +1076,7 @@
132 ut_ad(node && system && space);132 ut_ad(node && system && space);
133 ut_ad(mutex_own(&(system->mutex)));133 ut_ad(mutex_own(&(system->mutex)));
134 ut_a(node->magic_n == FIL_NODE_MAGIC_N);134 ut_a(node->magic_n == FIL_NODE_MAGIC_N);
@@ -137,7 +137,7 @@
137 137
138 if (node->open) {138 if (node->open) {
139 /* We fool the assertion in fil_node_close_file() to think139 /* We fool the assertion in fil_node_close_file() to think
140@@ -1595,6 +1596,8 @@140@@ -1597,6 +1598,8 @@
141 141
142 mutex_create(fil_system_mutex_key,142 mutex_create(fil_system_mutex_key,
143 &fil_system->mutex, SYNC_ANY_LATCH);143 &fil_system->mutex, SYNC_ANY_LATCH);
@@ -146,7 +146,7 @@
146 146
147 fil_system->spaces = hash_create(hash_size);147 fil_system->spaces = hash_create(hash_size);
148 fil_system->name_hash = hash_create(hash_size);148 fil_system->name_hash = hash_create(hash_size);
149@@ -2341,7 +2344,11 @@149@@ -2343,7 +2346,11 @@
150 completely and permanently. The flag is_being_deleted also prevents150 completely and permanently. The flag is_being_deleted also prevents
151 fil_flush() from being applied to this tablespace. */151 fil_flush() from being applied to this tablespace. */
152 152
@@ -158,7 +158,7 @@
158 #endif158 #endif
159 /* printf("Deleting tablespace %s id %lu\n", space->name, id); */159 /* printf("Deleting tablespace %s id %lu\n", space->name, id); */
160 160
161@@ -4400,6 +4407,10 @@161@@ -4721,6 +4728,10 @@
162 ulint page_size;162 ulint page_size;
163 ibool success = TRUE;163 ibool success = TRUE;
164 164
@@ -169,7 +169,7 @@
169 fil_mutex_enter_and_prepare_for_io(space_id);169 fil_mutex_enter_and_prepare_for_io(space_id);
170 170
171 space = fil_space_get_by_id(space_id);171 space = fil_space_get_by_id(space_id);
172@@ -4411,6 +4422,7 @@172@@ -4732,6 +4743,7 @@
173 *actual_size = space->size;173 *actual_size = space->size;
174 174
175 mutex_exit(&fil_system->mutex);175 mutex_exit(&fil_system->mutex);
@@ -177,7 +177,7 @@
177 177
178 return(TRUE);178 return(TRUE);
179 }179 }
180@@ -4443,6 +4455,8 @@180@@ -4764,6 +4776,8 @@
181 offset_low = ((start_page_no - file_start_page_no)181 offset_low = ((start_page_no - file_start_page_no)
182 % (4096 * ((1024 * 1024) / page_size)))182 % (4096 * ((1024 * 1024) / page_size)))
183 * page_size;183 * page_size;
@@ -186,7 +186,7 @@
186 #ifdef UNIV_HOTBACKUP186 #ifdef UNIV_HOTBACKUP
187 success = os_file_write(node->name, node->handle, buf,187 success = os_file_write(node->name, node->handle, buf,
188 offset_low, offset_high,188 offset_low, offset_high,
189@@ -4452,8 +4466,10 @@189@@ -4773,8 +4787,10 @@
190 node->name, node->handle, buf,190 node->name, node->handle, buf,
191 offset_low, offset_high,191 offset_low, offset_high,
192 page_size * n_pages,192 page_size * n_pages,
@@ -198,7 +198,7 @@
198 if (success) {198 if (success) {
199 node->size += n_pages;199 node->size += n_pages;
200 space->size += n_pages;200 space->size += n_pages;
201@@ -4499,6 +4515,7 @@201@@ -4820,6 +4836,7 @@
202 printf("Extended %s to %lu, actual size %lu pages\n", space->name,202 printf("Extended %s to %lu, actual size %lu pages\n", space->name,
203 size_after_extend, *actual_size); */203 size_after_extend, *actual_size); */
204 mutex_exit(&fil_system->mutex);204 mutex_exit(&fil_system->mutex);
@@ -206,7 +206,7 @@
206 206
207 fil_flush(space_id);207 fil_flush(space_id);
208 208
209@@ -4861,6 +4878,22 @@209@@ -5182,6 +5199,22 @@
210 srv_data_written+= len;210 srv_data_written+= len;
211 }211 }
212 212
@@ -216,7 +216,7 @@
216+ && ((buf_page_t*)message)->space_was_being_deleted) {216+ && ((buf_page_t*)message)->space_was_being_deleted) {
217+217+
218+ if (mode == OS_AIO_NORMAL) {218+ if (mode == OS_AIO_NORMAL) {
219+ buf_page_io_complete(message, trx);219+ buf_page_io_complete(message);
220+ return(DB_SUCCESS); /*fake*/220+ return(DB_SUCCESS); /*fake*/
221+ }221+ }
222+ if (type == OS_FILE_READ) {222+ if (type == OS_FILE_READ) {
@@ -229,7 +229,7 @@
229 /* Reserve the fil_system mutex and make sure that we can open at229 /* Reserve the fil_system mutex and make sure that we can open at
230 least one file while holding it, if the file is not already open */230 least one file while holding it, if the file is not already open */
231 231
232@@ -4990,10 +5023,24 @@232@@ -5323,10 +5356,24 @@
233 #else233 #else
234 /* Queue the aio request */234 /* Queue the aio request */
235 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,235 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
@@ -255,7 +255,7 @@
255 ut_a(ret);255 ut_a(ret);
256 256
257 if (mode == OS_AIO_SYNC) {257 if (mode == OS_AIO_SYNC) {
258@@ -5093,6 +5140,7 @@258@@ -5426,6 +5473,7 @@
259 fil_node_t* fil_node;259 fil_node_t* fil_node;
260 void* message;260 void* message;
261 ulint type;261 ulint type;
@@ -263,7 +263,7 @@
263 263
264 ut_ad(fil_validate_skip());264 ut_ad(fil_validate_skip());
265 265
266@@ -5100,10 +5148,10 @@266@@ -5433,10 +5481,10 @@
267 srv_set_io_thread_op_info(segment, "native aio handle");267 srv_set_io_thread_op_info(segment, "native aio handle");
268 #ifdef WIN_ASYNC_IO268 #ifdef WIN_ASYNC_IO
269 ret = os_aio_windows_handle(segment, 0, &fil_node,269 ret = os_aio_windows_handle(segment, 0, &fil_node,
@@ -274,9 +274,9 @@
274- &message, &type);274- &message, &type);
275+ &message, &type, &space_id);275+ &message, &type, &space_id);
276 #else276 #else
277 ut_error;
277 ret = 0; /* Eliminate compiler warning */278 ret = 0; /* Eliminate compiler warning */
278 ut_error;279@@ -5445,7 +5493,22 @@
279@@ -5112,7 +5160,22 @@
280 srv_set_io_thread_op_info(segment, "simulated aio handle");280 srv_set_io_thread_op_info(segment, "simulated aio handle");
281 281
282 ret = os_aio_simulated_handle(segment, &fil_node,282 ret = os_aio_simulated_handle(segment, &fil_node,
@@ -295,7 +295,7 @@
295+ || buf_page_get_state(message) != BUF_BLOCK_FILE_PAGE);295+ || buf_page_get_state(message) != BUF_BLOCK_FILE_PAGE);
296+296+
297+ srv_set_io_thread_op_info(segment, "complete io for buf page");297+ srv_set_io_thread_op_info(segment, "complete io for buf page");
298+ buf_page_io_complete(message, NULL);298+ buf_page_io_complete(message);
299+ return;299+ return;
300 }300 }
301 301
@@ -303,7 +303,7 @@
303diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc303diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
304--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:57:13.035513990 +0900304--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:57:13.035513990 +0900
305+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:57:53.084513775 +0900305+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:57:53.084513775 +0900
306@@ -11999,6 +11999,12 @@306@@ -12007,6 +12007,12 @@
307 "except for the deletion.",307 "except for the deletion.",
308 NULL, NULL, 0, &corrupt_table_action_typelib);308 NULL, NULL, 0, &corrupt_table_action_typelib);
309 309
@@ -316,7 +316,7 @@
316 static struct st_mysql_sys_var* innobase_system_variables[]= {316 static struct st_mysql_sys_var* innobase_system_variables[]= {
317 MYSQL_SYSVAR(page_size),317 MYSQL_SYSVAR(page_size),
318 MYSQL_SYSVAR(log_block_size),318 MYSQL_SYSVAR(log_block_size),
319@@ -12089,6 +12095,7 @@319@@ -12097,6 +12103,7 @@
320 MYSQL_SYSVAR(purge_batch_size),320 MYSQL_SYSVAR(purge_batch_size),
321 MYSQL_SYSVAR(rollback_segments),321 MYSQL_SYSVAR(rollback_segments),
322 MYSQL_SYSVAR(corrupt_table_action),322 MYSQL_SYSVAR(corrupt_table_action),
@@ -324,7 +324,7 @@
324 NULL324 NULL
325 };325 };
326 326
327@@ -12098,7 +12105,7 @@327@@ -12106,7 +12113,7 @@
328 &innobase_storage_engine,328 &innobase_storage_engine,
329 innobase_hton_name,329 innobase_hton_name,
330 plugin_author,330 plugin_author,
@@ -336,7 +336,7 @@
336diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h336diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
337--- a/storage/innobase/include/buf0buf.h 2011-02-23 19:00:48.252696774 +0900337--- a/storage/innobase/include/buf0buf.h 2011-02-23 19:00:48.252696774 +0900
338+++ b/storage/innobase/include/buf0buf.h 2011-02-23 19:01:19.182655902 +0900338+++ b/storage/innobase/include/buf0buf.h 2011-02-23 19:01:19.182655902 +0900
339@@ -1439,6 +1439,7 @@339@@ -1438,6 +1438,7 @@
340 0 if the block was never accessed340 0 if the block was never accessed
341 in the buffer pool */341 in the buffer pool */
342 /* @} */342 /* @} */
@@ -468,7 +468,7 @@
468diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h468diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
469--- a/storage/innobase/include/srv0srv.h 2011-02-23 19:00:48.212625715 +0900469--- a/storage/innobase/include/srv0srv.h 2011-02-23 19:00:48.212625715 +0900
470+++ b/storage/innobase/include/srv0srv.h 2011-02-23 19:01:19.193655990 +0900470+++ b/storage/innobase/include/srv0srv.h 2011-02-23 19:01:19.193655990 +0900
471@@ -247,6 +247,8 @@471@@ -244,6 +244,8 @@
472 extern ulint srv_pass_corrupt_table;472 extern ulint srv_pass_corrupt_table;
473 473
474 extern ulint srv_dict_size_limit;474 extern ulint srv_dict_size_limit;
@@ -480,7 +480,7 @@
480diff -ruN a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h480diff -ruN a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
481--- a/storage/innobase/include/sync0sync.h 2011-02-23 19:00:47.875625940 +0900481--- a/storage/innobase/include/sync0sync.h 2011-02-23 19:00:47.875625940 +0900
482+++ b/storage/innobase/include/sync0sync.h 2011-02-23 19:01:19.195703856 +0900482+++ b/storage/innobase/include/sync0sync.h 2011-02-23 19:01:19.195703856 +0900
483@@ -682,6 +682,7 @@483@@ -691,6 +691,7 @@
484 #define SYNC_BUF_POOL 150 /* Buffer pool mutex */484 #define SYNC_BUF_POOL 150 /* Buffer pool mutex */
485 #define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */485 #define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */
486 #define SYNC_DOUBLEWRITE 140486 #define SYNC_DOUBLEWRITE 140
@@ -493,7 +493,7 @@
493+++ b/storage/innobase/include/univ.i 2010-12-04 15:57:53.091592933 +0900493+++ b/storage/innobase/include/univ.i 2010-12-04 15:57:53.091592933 +0900
494@@ -53,6 +53,11 @@494@@ -53,6 +53,11 @@
495 #define INNODB_VERSION_MINOR 1495 #define INNODB_VERSION_MINOR 1
496 #define INNODB_VERSION_BUGFIX 6496 #define INNODB_VERSION_BUGFIX 7
497 497
498+#ifndef PERCONA_INNODB_VERSION498+#ifndef PERCONA_INNODB_VERSION
499+#define PERCONA_INNODB_VERSION 20.1499+#define PERCONA_INNODB_VERSION 20.1
@@ -550,7 +550,7 @@
550 trx_t* trx)550 trx_t* trx)
551 {551 {
552 os_aio_array_t* array;552 os_aio_array_t* array;
553@@ -4137,7 +4141,7 @@553@@ -4139,7 +4143,7 @@
554 trx->io_read += n;554 trx->io_read += n;
555 }555 }
556 slot = os_aio_array_reserve_slot(type, array, message1, message2, file,556 slot = os_aio_array_reserve_slot(type, array, message1, message2, file,
@@ -559,7 +559,7 @@
559 if (type == OS_FILE_READ) {559 if (type == OS_FILE_READ) {
560 if (srv_use_native_aio) {560 if (srv_use_native_aio) {
561 os_n_file_reads++;561 os_n_file_reads++;
562@@ -4256,7 +4260,8 @@562@@ -4258,7 +4262,8 @@
563 parameters are valid and can be used to563 parameters are valid and can be used to
564 restart the operation, for example */564 restart the operation, for example */
565 void** message2,565 void** message2,
@@ -569,7 +569,7 @@
569 {569 {
570 ulint orig_seg = segment;570 ulint orig_seg = segment;
571 os_aio_array_t* array;571 os_aio_array_t* array;
572@@ -4329,6 +4334,7 @@572@@ -4337,6 +4342,7 @@
573 *message2 = slot->message2;573 *message2 = slot->message2;
574 574
575 *type = slot->type;575 *type = slot->type;
@@ -577,7 +577,7 @@
577 577
578 if (ret && len == slot->len) {578 if (ret && len == slot->len) {
579 ret_val = TRUE;579 ret_val = TRUE;
580@@ -4569,7 +4575,8 @@580@@ -4565,7 +4571,8 @@
581 aio operation failed, these output581 aio operation failed, these output
582 parameters are valid and can be used to582 parameters are valid and can be used to
583 restart the operation. */583 restart the operation. */
@@ -587,7 +587,7 @@
587 {587 {
588 ulint segment;588 ulint segment;
589 os_aio_array_t* array;589 os_aio_array_t* array;
590@@ -4627,6 +4634,7 @@590@@ -4638,6 +4645,7 @@
591 *message2 = slot->message2;591 *message2 = slot->message2;
592 592
593 *type = slot->type;593 *type = slot->type;
@@ -595,7 +595,7 @@
595 595
596 if ((slot->ret == 0) && (slot->n_bytes == (long)slot->len)) {596 if ((slot->ret == 0) && (slot->n_bytes == (long)slot->len)) {
597 ret = TRUE;597 ret = TRUE;
598@@ -4680,7 +4688,8 @@598@@ -4691,7 +4699,8 @@
599 parameters are valid and can be used to599 parameters are valid and can be used to
600 restart the operation, for example */600 restart the operation, for example */
601 void** message2,601 void** message2,
@@ -605,7 +605,7 @@
605 {605 {
606 os_aio_array_t* array;606 os_aio_array_t* array;
607 ulint segment;607 ulint segment;
608@@ -4958,6 +4967,7 @@608@@ -4987,6 +4996,7 @@
609 *message2 = slot->message2;609 *message2 = slot->message2;
610 610
611 *type = slot->type;611 *type = slot->type;
@@ -624,7 +624,7 @@
624 624
625 /** Provide optional 4.x backwards compatibility for 5.0 and above */625 /** Provide optional 4.x backwards compatibility for 5.0 and above */
626 UNIV_INTERN ibool row_rollback_on_timeout = FALSE;626 UNIV_INTERN ibool row_rollback_on_timeout = FALSE;
627@@ -1194,6 +1195,13 @@627@@ -1191,6 +1192,13 @@
628 628
629 thr = que_fork_get_first_thr(prebuilt->ins_graph);629 thr = que_fork_get_first_thr(prebuilt->ins_graph);
630 630
@@ -649,7 +649,7 @@
649 649
650 rec_offs_init(offsets_);650 rec_offs_init(offsets_);
651 651
652@@ -3732,6 +3733,17 @@652@@ -3737,6 +3738,17 @@
653 653
654 /* Do some start-of-statement preparations */654 /* Do some start-of-statement preparations */
655 655
@@ -667,7 +667,7 @@
667 if (!prebuilt->sql_stat_start) {667 if (!prebuilt->sql_stat_start) {
668 /* No need to set an intention lock or assign a read view */668 /* No need to set an intention lock or assign a read view */
669 669
670@@ -3742,6 +3754,18 @@670@@ -3747,6 +3759,18 @@
671 " perform a consistent read\n"671 " perform a consistent read\n"
672 "InnoDB: but the read view is not assigned!\n",672 "InnoDB: but the read view is not assigned!\n",
673 stderr);673 stderr);
@@ -689,7 +689,7 @@
689diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c689diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
690--- a/storage/innobase/srv/srv0srv.c 2011-02-23 19:00:48.283695497 +0900690--- a/storage/innobase/srv/srv0srv.c 2011-02-23 19:00:48.283695497 +0900
691+++ b/storage/innobase/srv/srv0srv.c 2011-02-23 19:01:19.204696643 +0900691+++ b/storage/innobase/srv/srv0srv.c 2011-02-23 19:01:19.204696643 +0900
692@@ -447,6 +447,8 @@692@@ -441,6 +441,8 @@
693 UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */693 UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */
694 694
695 UNIV_INTERN ulint srv_dict_size_limit = 0;695 UNIV_INTERN ulint srv_dict_size_limit = 0;
@@ -713,7 +713,7 @@
713diff -ruN a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c713diff -ruN a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
714--- a/storage/innobase/sync/sync0sync.c 2011-02-25 14:18:55.817202060 +0900714--- a/storage/innobase/sync/sync0sync.c 2011-02-25 14:18:55.817202060 +0900
715+++ b/storage/innobase/sync/sync0sync.c 2011-02-25 14:19:44.596202017 +0900715+++ b/storage/innobase/sync/sync0sync.c 2011-02-25 14:19:44.596202017 +0900
716@@ -1175,6 +1175,7 @@716@@ -1220,6 +1220,7 @@
717 case SYNC_LOG_FLUSH_ORDER:717 case SYNC_LOG_FLUSH_ORDER:
718 case SYNC_THR_LOCAL:718 case SYNC_THR_LOCAL:
719 case SYNC_ANY_LATCH:719 case SYNC_ANY_LATCH:
720720
=== modified file 'innodb_io_patches.patch'
--- innodb_io_patches.patch 2011-05-10 11:57:42 +0000
+++ innodb_io_patches.patch 2011-06-20 09:04:39 +0000
@@ -84,7 +84,7 @@
84 /********************************************************************//**84 /********************************************************************//**
85 Obtain the InnoDB transaction of a MySQL thread.85 Obtain the InnoDB transaction of a MySQL thread.
86 @return reference to transaction pointer */86 @return reference to transaction pointer */
87@@ -2423,6 +2440,9 @@87@@ -2437,6 +2454,9 @@
88 srv_n_read_io_threads = (ulint) innobase_read_io_threads;88 srv_n_read_io_threads = (ulint) innobase_read_io_threads;
89 srv_n_write_io_threads = (ulint) innobase_write_io_threads;89 srv_n_write_io_threads = (ulint) innobase_write_io_threads;
90 90
@@ -94,7 +94,7 @@
94 srv_force_recovery = (ulint) innobase_force_recovery;94 srv_force_recovery = (ulint) innobase_force_recovery;
95 95
96 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;96 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
97@@ -11018,7 +11038,7 @@97@@ -11025,7 +11045,7 @@
98 PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,98 PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
99 "Purge threads can be either 0 or 1.",99 "Purge threads can be either 0 or 1.",
100 NULL, NULL,100 NULL, NULL,
@@ -103,7 +103,7 @@
103 0, /* Minimum value */103 0, /* Minimum value */
104 1, 0); /* Maximum value */104 1, 0); /* Maximum value */
105 105
106@@ -11060,12 +11080,18 @@106@@ -11067,12 +11087,18 @@
107 innodb_file_format_max_validate,107 innodb_file_format_max_validate,
108 innodb_file_format_max_update, "Antelope");108 innodb_file_format_max_update, "Antelope");
109 109
@@ -128,7 +128,7 @@
128 128
129 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,129 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
130 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,130 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
131@@ -11160,7 +11186,7 @@131@@ -11167,7 +11193,7 @@
132 static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,132 static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
133 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,133 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
134 "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",134 "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
@@ -137,7 +137,7 @@
137 137
138 static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances,138 static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances,
139 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,139 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
140@@ -11312,6 +11338,95 @@140@@ -11319,6 +11345,95 @@
141 "trigger a readahead.",141 "trigger a readahead.",
142 NULL, NULL, 56, 0, 64, 0);142 NULL, NULL, 56, 0, 64, 0);
143 143
@@ -233,7 +233,7 @@
233 static struct st_mysql_sys_var* innobase_system_variables[]= {233 static struct st_mysql_sys_var* innobase_system_variables[]= {
234 MYSQL_SYSVAR(additional_mem_pool_size),234 MYSQL_SYSVAR(additional_mem_pool_size),
235 MYSQL_SYSVAR(autoextend_increment),235 MYSQL_SYSVAR(autoextend_increment),
236@@ -11332,6 +11447,7 @@236@@ -11339,6 +11454,7 @@
237 MYSQL_SYSVAR(file_format_check),237 MYSQL_SYSVAR(file_format_check),
238 MYSQL_SYSVAR(file_format_max),238 MYSQL_SYSVAR(file_format_max),
239 MYSQL_SYSVAR(flush_log_at_trx_commit),239 MYSQL_SYSVAR(flush_log_at_trx_commit),
@@ -241,7 +241,7 @@
241 MYSQL_SYSVAR(flush_method),241 MYSQL_SYSVAR(flush_method),
242 MYSQL_SYSVAR(force_recovery),242 MYSQL_SYSVAR(force_recovery),
243 MYSQL_SYSVAR(locks_unsafe_for_binlog),243 MYSQL_SYSVAR(locks_unsafe_for_binlog),
244@@ -11369,6 +11485,13 @@244@@ -11376,6 +11492,13 @@
245 MYSQL_SYSVAR(show_verbose_locks),245 MYSQL_SYSVAR(show_verbose_locks),
246 MYSQL_SYSVAR(show_locks_held),246 MYSQL_SYSVAR(show_locks_held),
247 MYSQL_SYSVAR(version),247 MYSQL_SYSVAR(version),
@@ -271,7 +271,7 @@
271 271
272 mutex_create(ibuf_pessimistic_insert_mutex_key,272 mutex_create(ibuf_pessimistic_insert_mutex_key,
273 &ibuf_pessimistic_insert_mutex,273 &ibuf_pessimistic_insert_mutex,
274@@ -2764,9 +2766,11 @@274@@ -2753,9 +2755,11 @@
275 size = ibuf->size;275 size = ibuf->size;
276 max_size = ibuf->max_size;276 max_size = ibuf->max_size;
277 277
@@ -299,7 +299,7 @@
299diff -ruN a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h299diff -ruN a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
300--- a/storage/innobase/include/ha_prototypes.h 2010-11-03 07:01:13.000000000 +0900300--- a/storage/innobase/include/ha_prototypes.h 2010-11-03 07:01:13.000000000 +0900
301+++ b/storage/innobase/include/ha_prototypes.h 2010-12-03 15:10:09.078026360 +0900301+++ b/storage/innobase/include/ha_prototypes.h 2010-12-03 15:10:09.078026360 +0900
302@@ -284,5 +284,12 @@302@@ -284,6 +284,13 @@
303 /*===================*/303 /*===================*/
304 void* thd, /*!< in: thread handle (THD*) */304 void* thd, /*!< in: thread handle (THD*) */
305 ulint value); /*!< in: time waited for the lock */305 ulint value); /*!< in: time waited for the lock */
@@ -311,11 +311,12 @@
311+/*================================*/311+/*================================*/
312+ void* thd);312+ void* thd);
313 313
314 #endif314 /**********************************************************************//**
315 Get the current setting of the lower_case_table_names global parameter from
315diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h316diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
316--- a/storage/innobase/include/srv0srv.h 2010-12-03 15:09:51.291955835 +0900317--- a/storage/innobase/include/srv0srv.h 2010-12-03 15:09:51.291955835 +0900
317+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:10:09.079029047 +0900318+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:10:09.079029047 +0900
318@@ -141,7 +141,8 @@319@@ -138,7 +138,8 @@
319 extern ulint srv_n_log_files;320 extern ulint srv_n_log_files;
320 extern ulint srv_log_file_size;321 extern ulint srv_log_file_size;
321 extern ulint srv_log_buffer_size;322 extern ulint srv_log_buffer_size;
@@ -325,7 +326,7 @@
325 extern char srv_adaptive_flushing;326 extern char srv_adaptive_flushing;
326 327
327 328
328@@ -219,6 +220,16 @@329@@ -216,6 +217,16 @@
329 extern ulong srv_max_purge_lag;330 extern ulong srv_max_purge_lag;
330 331
331 extern ulong srv_replication_delay;332 extern ulong srv_replication_delay;
@@ -342,7 +343,7 @@
342 /*-------------------------------------------*/343 /*-------------------------------------------*/
343 344
344 extern ulint srv_n_rows_inserted;345 extern ulint srv_n_rows_inserted;
345@@ -397,8 +408,9 @@346@@ -394,8 +405,9 @@
346 when writing data files, but do flush347 when writing data files, but do flush
347 after writing to log files */348 after writing to log files */
348 SRV_UNIX_NOSYNC, /*!< do not flush after writing */349 SRV_UNIX_NOSYNC, /*!< do not flush after writing */
@@ -540,7 +541,7 @@
540diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c541diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
541--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:09:51.301987792 +0900542--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:09:51.301987792 +0900
542+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:13:29.369986988 +0900543+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:13:29.369986988 +0900
543@@ -189,7 +189,8 @@544@@ -183,7 +183,8 @@
544 UNIV_INTERN ulint srv_log_file_size = ULINT_MAX;545 UNIV_INTERN ulint srv_log_file_size = ULINT_MAX;
545 /* size in database pages */546 /* size in database pages */
546 UNIV_INTERN ulint srv_log_buffer_size = ULINT_MAX;547 UNIV_INTERN ulint srv_log_buffer_size = ULINT_MAX;
@@ -550,7 +551,7 @@
550 551
551 /* Try to flush dirty pages so as to avoid IO bursts at552 /* Try to flush dirty pages so as to avoid IO bursts at
552 the checkpoints. */553 the checkpoints. */
553@@ -408,6 +409,17 @@554@@ -402,6 +403,17 @@
554 555
555 UNIV_INTERN ulong srv_replication_delay = 0;556 UNIV_INTERN ulong srv_replication_delay = 0;
556 557
@@ -568,7 +569,7 @@
568 /*-------------------------------------------*/569 /*-------------------------------------------*/
569 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;570 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
570 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;571 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
571@@ -2733,6 +2745,7 @@572@@ -2742,6 +2754,7 @@
572 ulint n_pages_purged = 0;573 ulint n_pages_purged = 0;
573 ulint n_bytes_merged;574 ulint n_bytes_merged;
574 ulint n_pages_flushed;575 ulint n_pages_flushed;
@@ -576,7 +577,7 @@
576 ulint n_bytes_archived;577 ulint n_bytes_archived;
577 ulint n_tables_to_drop;578 ulint n_tables_to_drop;
578 ulint n_ios;579 ulint n_ios;
579@@ -2740,7 +2753,20 @@580@@ -2749,7 +2762,20 @@
580 ulint n_ios_very_old;581 ulint n_ios_very_old;
581 ulint n_pend_ios;582 ulint n_pend_ios;
582 ulint next_itr_time;583 ulint next_itr_time;
@@ -597,7 +598,7 @@
597 598
598 #ifdef UNIV_DEBUG_THREAD_CREATION599 #ifdef UNIV_DEBUG_THREAD_CREATION
599 fprintf(stderr, "Master thread starts, id %lu\n",600 fprintf(stderr, "Master thread starts, id %lu\n",
600@@ -2762,6 +2788,9 @@601@@ -2771,6 +2797,9 @@
601 602
602 mutex_exit(&kernel_mutex);603 mutex_exit(&kernel_mutex);
603 604
@@ -607,7 +608,7 @@
607 loop:608 loop:
608 /*****************************************************************/609 /*****************************************************************/
609 /* ---- When there is database activity by users, we cycle in this610 /* ---- When there is database activity by users, we cycle in this
610@@ -2792,9 +2821,13 @@611@@ -2801,9 +2830,13 @@
611 /* Sleep for 1 second on entrying the for loop below the first time. */612 /* Sleep for 1 second on entrying the for loop below the first time. */
612 next_itr_time = ut_time_ms() + 1000;613 next_itr_time = ut_time_ms() + 1000;
613 614
@@ -621,7 +622,7 @@
621 /* ALTER TABLE in MySQL requires on Unix that the table handler622 /* ALTER TABLE in MySQL requires on Unix that the table handler
622 can drop tables lazily after there no longer are SELECT623 can drop tables lazily after there no longer are SELECT
623 queries to them. */624 queries to them. */
624@@ -2818,6 +2851,7 @@625@@ -2827,6 +2860,7 @@
625 srv_main_thread_op_info = "sleeping";626 srv_main_thread_op_info = "sleeping";
626 srv_main_1_second_loops++;627 srv_main_1_second_loops++;
627 628
@@ -629,7 +630,7 @@
629 if (next_itr_time > cur_time630 if (next_itr_time > cur_time
630 && srv_shutdown_state == SRV_SHUTDOWN_NONE) {631 && srv_shutdown_state == SRV_SHUTDOWN_NONE) {
631 632
632@@ -2828,10 +2862,26 @@633@@ -2837,10 +2871,26 @@
633 (next_itr_time - cur_time)634 (next_itr_time - cur_time)
634 * 1000));635 * 1000));
635 srv_main_sleeps++;636 srv_main_sleeps++;
@@ -656,7 +657,7 @@
656 657
657 /* Flush logs if needed */658 /* Flush logs if needed */
658 srv_sync_log_buffer_in_background();659 srv_sync_log_buffer_in_background();
659@@ -2851,7 +2901,7 @@660@@ -2860,7 +2910,7 @@
660 if (n_pend_ios < SRV_PEND_IO_THRESHOLD661 if (n_pend_ios < SRV_PEND_IO_THRESHOLD
661 && (n_ios - n_ios_old < SRV_RECENT_IO_ACTIVITY)) {662 && (n_ios - n_ios_old < SRV_RECENT_IO_ACTIVITY)) {
662 srv_main_thread_op_info = "doing insert buffer merge";663 srv_main_thread_op_info = "doing insert buffer merge";
@@ -665,7 +666,7 @@
665 666
666 /* Flush logs if needed */667 /* Flush logs if needed */
667 srv_sync_log_buffer_in_background();668 srv_sync_log_buffer_in_background();
668@@ -2868,7 +2918,11 @@669@@ -2877,7 +2927,11 @@
669 n_pages_flushed = buf_flush_list(670 n_pages_flushed = buf_flush_list(
670 PCT_IO(100), IB_ULONGLONG_MAX);671 PCT_IO(100), IB_ULONGLONG_MAX);
671 672
@@ -678,7 +679,7 @@
678 679
679 /* Try to keep the rate of flushing of dirty680 /* Try to keep the rate of flushing of dirty
680 pages such that redo log generation does not681 pages such that redo log generation does not
681@@ -2884,6 +2938,224 @@682@@ -2893,6 +2947,224 @@
682 n_flush,683 n_flush,
683 IB_ULONGLONG_MAX);684 IB_ULONGLONG_MAX);
684 }685 }
@@ -903,7 +904,7 @@
903 }904 }
904 905
905 if (srv_activity_count == old_activity_count) {906 if (srv_activity_count == old_activity_count) {
906@@ -2932,7 +3204,7 @@907@@ -2941,7 +3213,7 @@
907 even if the server were active */908 even if the server were active */
908 909
909 srv_main_thread_op_info = "doing insert buffer merge";910 srv_main_thread_op_info = "doing insert buffer merge";
@@ -912,7 +913,7 @@
912 913
913 /* Flush logs if needed */914 /* Flush logs if needed */
914 srv_sync_log_buffer_in_background();915 srv_sync_log_buffer_in_background();
915@@ -3040,7 +3312,7 @@916@@ -3049,7 +3321,7 @@
916 buf_flush_list below. Otherwise, the system favors917 buf_flush_list below. Otherwise, the system favors
917 clean pages over cleanup throughput. */918 clean pages over cleanup throughput. */
918 n_bytes_merged = ibuf_contract_for_n_pages(FALSE,919 n_bytes_merged = ibuf_contract_for_n_pages(FALSE,
@@ -921,7 +922,7 @@
921 }922 }
922 923
923 srv_main_thread_op_info = "reserving kernel mutex";924 srv_main_thread_op_info = "reserving kernel mutex";
924@@ -3184,6 +3456,7 @@925@@ -3189,6 +3461,7 @@
925 srv_slot_t* slot;926 srv_slot_t* slot;
926 ulint retries = 0;927 ulint retries = 0;
927 ulint n_total_purged = ULINT_UNDEFINED;928 ulint n_total_purged = ULINT_UNDEFINED;
@@ -929,7 +930,7 @@
929 930
930 ut_a(srv_n_purge_threads == 1);931 ut_a(srv_n_purge_threads == 1);
931 932
932@@ -3204,9 +3477,12 @@933@@ -3209,9 +3482,12 @@
933 934
934 mutex_exit(&kernel_mutex);935 mutex_exit(&kernel_mutex);
935 936
@@ -942,7 +943,7 @@
942 943
943 /* If there are very few records to purge or the last944 /* If there are very few records to purge or the last
944 purge didn't purge any records then wait for activity.945 purge didn't purge any records then wait for activity.
945@@ -3253,6 +3529,16 @@946@@ -3258,6 +3534,16 @@
946 } while (n_pages_purged > 0 && !srv_fast_shutdown);947 } while (n_pages_purged > 0 && !srv_fast_shutdown);
947 948
948 srv_sync_log_buffer_in_background();949 srv_sync_log_buffer_in_background();
@@ -991,7 +992,7 @@
991diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c992diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
992--- a/storage/innobase/trx/trx0trx.c 2010-11-03 07:01:13.000000000 +0900993--- a/storage/innobase/trx/trx0trx.c 2010-11-03 07:01:13.000000000 +0900
993+++ b/storage/innobase/trx/trx0trx.c 2010-12-03 15:10:09.106023937 +0900994+++ b/storage/innobase/trx/trx0trx.c 2010-12-03 15:10:09.106023937 +0900
994@@ -924,6 +924,7 @@995@@ -984,6 +984,7 @@
995 trx->read_view = NULL;996 trx->read_view = NULL;
996 997
997 if (lsn) {998 if (lsn) {
@@ -999,7 +1000,7 @@
999 1000
1000 mutex_exit(&kernel_mutex);1001 mutex_exit(&kernel_mutex);
1001 1002
1002@@ -932,6 +933,12 @@1003@@ -992,6 +993,12 @@
1003 trx_undo_insert_cleanup(trx);1004 trx_undo_insert_cleanup(trx);
1004 }1005 }
1005 1006
@@ -1012,7 +1013,7 @@
1012 /* NOTE that we could possibly make a group commit more1013 /* NOTE that we could possibly make a group commit more
1013 efficient here: call os_thread_yield here to allow also other1014 efficient here: call os_thread_yield here to allow also other
1014 trxs to come to commit! */1015 trxs to come to commit! */
1015@@ -963,9 +970,9 @@1016@@ -1023,9 +1030,9 @@
1016 if (trx->flush_log_later) {1017 if (trx->flush_log_later) {
1017 /* Do nothing yet */1018 /* Do nothing yet */
1018 trx->must_flush_log_later = TRUE;1019 trx->must_flush_log_later = TRUE;
@@ -1024,7 +1025,7 @@
1024 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1025 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1025 /* Write the log but do not flush it to disk */1026 /* Write the log but do not flush it to disk */
1026 1027
1027@@ -977,7 +984,7 @@1028@@ -1037,7 +1044,7 @@
1028 1029
1029 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1030 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1030 }1031 }
@@ -1033,7 +1034,7 @@
1033 1034
1034 /* Write the log but do not flush it to disk */1035 /* Write the log but do not flush it to disk */
1035 1036
1036@@ -1641,16 +1648,23 @@1037@@ -1701,16 +1708,23 @@
1037 trx_t* trx) /*!< in: trx handle */1038 trx_t* trx) /*!< in: trx handle */
1038 {1039 {
1039 ib_uint64_t lsn = trx->commit_lsn;1040 ib_uint64_t lsn = trx->commit_lsn;
@@ -1059,7 +1060,7 @@
1059 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1060 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1060 /* Write the log but do not flush it to disk */1061 /* Write the log but do not flush it to disk */
1061 1062
1062@@ -1661,7 +1675,7 @@1063@@ -1721,7 +1735,7 @@
1063 1064
1064 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1065 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1065 }1066 }
@@ -1068,7 +1069,7 @@
1068 1069
1069 /* Write the log but do not flush it to disk */1070 /* Write the log but do not flush it to disk */
1070 1071
1071@@ -1914,6 +1928,8 @@1072@@ -1969,6 +1983,8 @@
1072 /*--------------------------------------*/1073 /*--------------------------------------*/
1073 1074
1074 if (lsn) {1075 if (lsn) {
@@ -1077,7 +1078,7 @@
1077 /* Depending on the my.cnf options, we may now write the log1078 /* Depending on the my.cnf options, we may now write the log
1078 buffer to the log files, making the prepared state of the1079 buffer to the log files, making the prepared state of the
1079 transaction durable if the OS does not crash. We may also1080 transaction durable if the OS does not crash. We may also
1080@@ -1933,9 +1949,15 @@1081@@ -1988,9 +2004,15 @@
1081 1082
1082 mutex_exit(&kernel_mutex);1083 mutex_exit(&kernel_mutex);
1083 1084
@@ -1095,7 +1096,7 @@
1095 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1096 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1096 /* Write the log but do not flush it to disk */1097 /* Write the log but do not flush it to disk */
1097 1098
1098@@ -1947,7 +1969,7 @@1099@@ -2002,7 +2024,7 @@
1099 1100
1100 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1101 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1101 }1102 }
11021103
=== modified file 'innodb_lru_dump_restore.patch'
--- innodb_lru_dump_restore.patch 2011-05-10 11:57:42 +0000
+++ innodb_lru_dump_restore.patch 2011-06-20 09:04:39 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c8diff -ruN a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
9--- a/storage/innobase/buf/buf0lru.c 2010-12-03 15:49:59.185023424 +09009--- a/storage/innobase/buf/buf0lru.c 2010-12-03 15:49:59.185023424 +0900
10+++ b/storage/innobase/buf/buf0lru.c 2010-12-04 15:33:37.626482350 +090010+++ b/storage/innobase/buf/buf0lru.c 2010-12-04 15:33:37.626482350 +0900
11@@ -2245,6 +2245,284 @@11@@ -2247,6 +2247,284 @@
12 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);12 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);
13 }13 }
14 14
@@ -308,7 +308,7 @@
308diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c308diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
309--- a/storage/innobase/fil/fil0fil.c 2010-12-03 17:49:11.581025127 +0900309--- a/storage/innobase/fil/fil0fil.c 2010-12-03 17:49:11.581025127 +0900
310+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:33:37.632482885 +0900310+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:33:37.632482885 +0900
311@@ -4965,6 +4965,70 @@311@@ -5289,6 +5289,70 @@
312 return(DB_SUCCESS);312 return(DB_SUCCESS);
313 }313 }
314 314
@@ -382,7 +382,7 @@
382diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc382diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
383--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:49:11.589956135 +0900383--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:49:11.589956135 +0900
384+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:33:37.645555490 +0900384+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:33:37.645555490 +0900
385@@ -11786,6 +11786,12 @@385@@ -11793,6 +11793,12 @@
386 "Limit the allocated memory for dictionary cache. (0: unlimited)",386 "Limit the allocated memory for dictionary cache. (0: unlimited)",
387 NULL, NULL, 0, 0, LONG_MAX, 0);387 NULL, NULL, 0, 0, LONG_MAX, 0);
388 388
@@ -395,7 +395,7 @@
395 static struct st_mysql_sys_var* innobase_system_variables[]= {395 static struct st_mysql_sys_var* innobase_system_variables[]= {
396 MYSQL_SYSVAR(additional_mem_pool_size),396 MYSQL_SYSVAR(additional_mem_pool_size),
397 MYSQL_SYSVAR(autoextend_increment),397 MYSQL_SYSVAR(autoextend_increment),
398@@ -11867,6 +11873,7 @@398@@ -11874,6 +11880,7 @@
399 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */399 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
400 MYSQL_SYSVAR(read_ahead_threshold),400 MYSQL_SYSVAR(read_ahead_threshold),
401 MYSQL_SYSVAR(io_capacity),401 MYSQL_SYSVAR(io_capacity),
@@ -535,7 +535,7 @@
535diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h535diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
536--- a/storage/innobase/include/srv0srv.h 2010-12-03 17:49:11.603969747 +0900536--- a/storage/innobase/include/srv0srv.h 2010-12-03 17:49:11.603969747 +0900
537+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:33:37.685550816 +0900537+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:33:37.685550816 +0900
538@@ -359,6 +359,9 @@538@@ -356,6 +356,9 @@
539 reading of a disk page */539 reading of a disk page */
540 extern ulint srv_buf_pool_reads;540 extern ulint srv_buf_pool_reads;
541 541
@@ -545,7 +545,7 @@
545 /** Status variables to be passed to MySQL */545 /** Status variables to be passed to MySQL */
546 typedef struct export_var_struct export_struc;546 typedef struct export_var_struct export_struc;
547 547
548@@ -664,6 +667,16 @@548@@ -661,6 +664,16 @@
549 /*=====================*/549 /*=====================*/
550 void* arg); /*!< in: a dummy parameter required by550 void* arg); /*!< in: a dummy parameter required by
551 os_thread_create */551 os_thread_create */
@@ -565,7 +565,7 @@
565diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c565diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
566--- a/storage/innobase/srv/srv0srv.c 2010-12-03 17:49:11.620986661 +0900566--- a/storage/innobase/srv/srv0srv.c 2010-12-03 17:49:11.620986661 +0900
567+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:33:37.708550811 +0900567+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:33:37.708550811 +0900
568@@ -336,6 +336,9 @@568@@ -330,6 +330,9 @@
569 reading of a disk page */569 reading of a disk page */
570 UNIV_INTERN ulint srv_buf_pool_reads = 0;570 UNIV_INTERN ulint srv_buf_pool_reads = 0;
571 571
@@ -575,7 +575,7 @@
575 /* structure to pass status variables to MySQL */575 /* structure to pass status variables to MySQL */
576 UNIV_INTERN export_struc export_vars;576 UNIV_INTERN export_struc export_vars;
577 577
578@@ -2691,6 +2694,56 @@578@@ -2701,6 +2704,56 @@
579 /* We count the number of threads in os_thread_exit(). A created579 /* We count the number of threads in os_thread_exit(). A created
580 thread should always use that to exit and not use return() to exit. */580 thread should always use that to exit and not use return() to exit. */
581 581
582582
=== modified file 'innodb_overwrite_relay_log_info.patch'
--- innodb_overwrite_relay_log_info.patch 2011-05-10 11:57:42 +0000
+++ innodb_overwrite_relay_log_info.patch 2011-06-20 09:04:39 +0000
@@ -56,7 +56,7 @@
56 static my_bool innobase_rollback_on_timeout = FALSE;56 static my_bool innobase_rollback_on_timeout = FALSE;
57 static my_bool innobase_create_status_file = FALSE;57 static my_bool innobase_create_status_file = FALSE;
58 static my_bool innobase_stats_on_metadata = TRUE;58 static my_bool innobase_stats_on_metadata = TRUE;
59@@ -2234,6 +2254,89 @@59@@ -2248,6 +2268,89 @@
60 }60 }
61 #endif /* DBUG_OFF */61 #endif /* DBUG_OFF */
62 62
@@ -146,7 +146,7 @@
146 /* Check that values don't overflow on 32-bit systems. */146 /* Check that values don't overflow on 32-bit systems. */
147 if (sizeof(ulint) == 4) {147 if (sizeof(ulint) == 4) {
148 if (innobase_buffer_pool_size > UINT_MAX32) {148 if (innobase_buffer_pool_size > UINT_MAX32) {
149@@ -2532,6 +2635,76 @@149@@ -2546,6 +2649,76 @@
150 goto mem_free_and_error;150 goto mem_free_and_error;
151 }151 }
152 152
@@ -223,7 +223,7 @@
223 innobase_old_blocks_pct = buf_LRU_old_ratio_update(223 innobase_old_blocks_pct = buf_LRU_old_ratio_update(
224 innobase_old_blocks_pct, TRUE);224 innobase_old_blocks_pct, TRUE);
225 225
226@@ -2644,6 +2817,25 @@226@@ -2658,6 +2831,25 @@
227 trx_t* trx) /*!< in: transaction handle */227 trx_t* trx) /*!< in: transaction handle */
228 {228 {
229 if (trx_is_started(trx)) {229 if (trx_is_started(trx)) {
@@ -249,7 +249,7 @@
249 249
250 trx_commit_for_mysql(trx);250 trx_commit_for_mysql(trx);
251 }251 }
252@@ -11007,6 +11199,12 @@252@@ -11014,6 +11206,12 @@
253 "The common part for InnoDB table spaces.",253 "The common part for InnoDB table spaces.",
254 NULL, NULL, NULL);254 NULL, NULL, NULL);
255 255
@@ -262,7 +262,7 @@
262 static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,262 static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
263 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,263 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
264 "Enable InnoDB doublewrite buffer (enabled by default). "264 "Enable InnoDB doublewrite buffer (enabled by default). "
265@@ -11467,6 +11665,7 @@265@@ -11474,6 +11672,7 @@
266 MYSQL_SYSVAR(old_blocks_pct),266 MYSQL_SYSVAR(old_blocks_pct),
267 MYSQL_SYSVAR(old_blocks_time),267 MYSQL_SYSVAR(old_blocks_time),
268 MYSQL_SYSVAR(open_files),268 MYSQL_SYSVAR(open_files),
@@ -312,7 +312,7 @@
312diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h312diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
313--- a/storage/innobase/include/trx0trx.h 2010-12-03 15:18:48.894955550 +0900313--- a/storage/innobase/include/trx0trx.h 2010-12-03 15:18:48.894955550 +0900
314+++ b/storage/innobase/include/trx0trx.h 2010-12-03 15:38:20.323953416 +0900314+++ b/storage/innobase/include/trx0trx.h 2010-12-03 15:38:20.323953416 +0900
315@@ -569,6 +569,21 @@315@@ -580,6 +580,20 @@
316 ib_int64_t mysql_log_offset;/* if MySQL binlog is used, this field316 ib_int64_t mysql_log_offset;/* if MySQL binlog is used, this field
317 contains the end offset of the binlog317 contains the end offset of the binlog
318 entry */318 entry */
@@ -330,14 +330,13 @@
330+ replication has processed */330+ replication has processed */
331+ const char* mysql_relay_log_file_name;331+ const char* mysql_relay_log_file_name;
332+ ib_int64_t mysql_relay_log_pos;332+ ib_int64_t mysql_relay_log_pos;
333+333 /*------------------------------*/
334 os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated334 ulint n_mysql_tables_in_use; /* number of Innobase tables
335 with this transaction object */335 used in the processing of the current
336 ulint mysql_process_no;/* since in Linux, 'top' reports
337diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c336diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
338--- a/storage/innobase/trx/trx0sys.c 2010-11-03 07:01:13.000000000 +0900337--- a/storage/innobase/trx/trx0sys.c 2010-11-03 07:01:13.000000000 +0900
339+++ b/storage/innobase/trx/trx0sys.c 2010-12-03 15:38:20.325956917 +0900338+++ b/storage/innobase/trx/trx0sys.c 2010-12-03 15:38:20.325956917 +0900
340@@ -75,13 +75,16 @@339@@ -76,13 +76,16 @@
341 file name and position here. */340 file name and position here. */
342 /* @{ */341 /* @{ */
343 /** Master binlog file name */342 /** Master binlog file name */
@@ -355,7 +354,7 @@
355 /** If this MySQL server uses binary logging, after InnoDB has been inited354 /** If this MySQL server uses binary logging, after InnoDB has been inited
356 and if it has done a crash recovery, we store the binlog file name and position355 and if it has done a crash recovery, we store the binlog file name and position
357 here. */356 here. */
358@@ -683,23 +686,25 @@357@@ -684,23 +687,25 @@
359 void358 void
360 trx_sys_update_mysql_binlog_offset(359 trx_sys_update_mysql_binlog_offset(
361 /*===============================*/360 /*===============================*/
@@ -387,7 +386,7 @@
387 if (mach_read_from_4(sys_header + field386 if (mach_read_from_4(sys_header + field
388 + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)387 + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
389 != TRX_SYS_MYSQL_LOG_MAGIC_N) {388 != TRX_SYS_MYSQL_LOG_MAGIC_N) {
390@@ -821,13 +826,26 @@389@@ -822,13 +827,26 @@
391 + TRX_SYS_MYSQL_LOG_OFFSET_LOW),390 + TRX_SYS_MYSQL_LOG_OFFSET_LOW),
392 sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO391 sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
393 + TRX_SYS_MYSQL_LOG_NAME);392 + TRX_SYS_MYSQL_LOG_NAME);
@@ -415,7 +414,7 @@
415 414
416 trx_sys_mysql_master_log_pos415 trx_sys_mysql_master_log_pos
417 = (((ib_int64_t) mach_read_from_4(416 = (((ib_int64_t) mach_read_from_4(
418@@ -836,6 +854,19 @@417@@ -837,6 +855,19 @@
419 + ((ib_int64_t) mach_read_from_4(418 + ((ib_int64_t) mach_read_from_4(
420 sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO419 sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
421 + TRX_SYS_MYSQL_LOG_OFFSET_LOW));420 + TRX_SYS_MYSQL_LOG_OFFSET_LOW));
@@ -438,7 +437,7 @@
438diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c437diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
439--- a/storage/innobase/trx/trx0trx.c 2010-12-03 15:37:45.549028990 +0900438--- a/storage/innobase/trx/trx0trx.c 2010-12-03 15:37:45.549028990 +0900
440+++ b/storage/innobase/trx/trx0trx.c 2010-12-03 15:38:20.328957217 +0900439+++ b/storage/innobase/trx/trx0trx.c 2010-12-03 15:38:20.328957217 +0900
441@@ -135,6 +135,10 @@440@@ -138,6 +138,10 @@
442 441
443 trx->mysql_log_file_name = NULL;442 trx->mysql_log_file_name = NULL;
444 trx->mysql_log_offset = 0;443 trx->mysql_log_offset = 0;
@@ -449,7 +448,7 @@
449 448
450 mutex_create(trx_undo_mutex_key, &trx->undo_mutex, SYNC_TRX_UNDO);449 mutex_create(trx_undo_mutex_key, &trx->undo_mutex, SYNC_TRX_UNDO);
451 450
452@@ -765,6 +769,7 @@451@@ -820,6 +824,7 @@
453 {452 {
454 mtr_t mtr;453 mtr_t mtr;
455 trx_rseg_t* rseg;454 trx_rseg_t* rseg;
@@ -457,7 +456,7 @@
457 456
458 ut_ad(!mutex_own(&kernel_mutex));457 ut_ad(!mutex_own(&kernel_mutex));
459 458
460@@ -818,8 +823,12 @@459@@ -873,8 +878,12 @@
461 460
462 if (trx->mysql_log_file_name461 if (trx->mysql_log_file_name
463 && trx->mysql_log_file_name[0] != '\0') {462 && trx->mysql_log_file_name[0] != '\0') {
@@ -470,7 +469,7 @@
470 trx->mysql_log_file_name,469 trx->mysql_log_file_name,
471 trx->mysql_log_offset,470 trx->mysql_log_offset,
472 TRX_SYS_MYSQL_LOG_INFO, &mtr);471 TRX_SYS_MYSQL_LOG_INFO, &mtr);
473@@ -827,6 +836,27 @@472@@ -882,6 +891,27 @@
474 trx->mysql_log_file_name = NULL;473 trx->mysql_log_file_name = NULL;
475 }474 }
476 475
477476
=== modified file 'innodb_pass_corrupt_table.patch'
--- innodb_pass_corrupt_table.patch 2011-05-10 11:57:42 +0000
+++ innodb_pass_corrupt_table.patch 2011-06-20 09:04:39 +0000
@@ -343,37 +343,35 @@
343 if (!ready) {343 if (!ready) {
344 344
345 return(block);345 return(block);
346@@ -2475,6 +2481,14 @@346@@ -2475,6 +2481,13 @@
347 return(NULL);347 return(NULL);
348 }348 }
349 349
350+ if (srv_pass_corrupt_table) {350+ if (srv_pass_corrupt_table <= 1) {
351+ if (bpage->is_corrupt) {351+ if (bpage->is_corrupt) {
352+ rw_lock_s_unlock(&buf_pool->page_hash_latch);352+ rw_lock_s_unlock(&buf_pool->page_hash_latch);
353+ return(NULL);353+ return(NULL);
354+ }354+ }
355+ }355+ }
356+ ut_a(!(bpage->is_corrupt));
357+356+
358 block_mutex = buf_page_get_mutex_enter(bpage);357 block_mutex = buf_page_get_mutex_enter(bpage);
359 358
360 rw_lock_s_unlock(&buf_pool->page_hash_latch);359 rw_lock_s_unlock(&buf_pool->page_hash_latch);
361@@ -3036,6 +3050,14 @@360@@ -3036,6 +3049,13 @@
362 return(NULL);361 return(NULL);
363 }362 }
364 363
365+ if (srv_pass_corrupt_table) {364+ if (srv_pass_corrupt_table <= 1) {
366+ if (block->page.is_corrupt) {365+ if (block->page.is_corrupt) {
367+ mutex_exit(block_mutex);366+ mutex_exit(block_mutex);
368+ return(NULL);367+ return(NULL);
369+ }368+ }
370+ }369+ }
371+ ut_a(!(block->page.is_corrupt));
372+370+
373 switch (buf_block_get_state(block)) {371 switch (buf_block_get_state(block)) {
374 buf_page_t* bpage;372 buf_page_t* bpage;
375 ibool success;373 ibool success;
376@@ -3710,6 +3732,7 @@374@@ -3710,6 +3730,7 @@
377 bpage->newest_modification = 0;375 bpage->newest_modification = 0;
378 bpage->oldest_modification = 0;376 bpage->oldest_modification = 0;
379 HASH_INVALIDATE(bpage, hash);377 HASH_INVALIDATE(bpage, hash);
@@ -381,17 +379,7 @@
381 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG379 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
382 bpage->file_page_was_freed = FALSE;380 bpage->file_page_was_freed = FALSE;
383 #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */381 #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
384@@ -4220,7 +4243,8 @@382@@ -4299,6 +4320,7 @@
385 void
386 buf_page_io_complete(
387 /*=================*/
388- buf_page_t* bpage) /*!< in: pointer to the block in question */
389+ buf_page_t* bpage, /*!< in: pointer to the block in question */
390+ trx_t* trx)
391 {
392 enum buf_io_fix io_type;
393 buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
394@@ -4299,6 +4323,7 @@
395 (ulong) bpage->offset);383 (ulong) bpage->offset);
396 }384 }
397 385
@@ -399,27 +387,31 @@
399 /* From version 3.23.38 up we store the page checksum387 /* From version 3.23.38 up we store the page checksum
400 to the 4 first bytes of the page end lsn field */388 to the 4 first bytes of the page end lsn field */
401 389
402@@ -4340,6 +4365,19 @@390@@ -4340,6 +4362,23 @@
403 REFMAN "forcing-innodb-recovery.html\n"391 REFMAN "forcing-innodb-recovery.html\n"
404 "InnoDB: about forcing recovery.\n", stderr);392 "InnoDB: about forcing recovery.\n", stderr);
405 393
406+ if (srv_pass_corrupt_table && !trx_sys_sys_space(bpage->space)394+ if (srv_pass_corrupt_table && !trx_sys_sys_space(bpage->space)
407+ && bpage->space < SRV_LOG_SPACE_FIRST_ID) {395+ && bpage->space < SRV_LOG_SPACE_FIRST_ID) {
396+ trx_t* trx;
397+
408+ fprintf(stderr,398+ fprintf(stderr,
409+ "InnoDB: space %u will be treated as corrupt.\n",399+ "InnoDB: space %u will be treated as corrupt.\n",
410+ bpage->space);400+ bpage->space);
411+ fil_space_set_corrupt(bpage->space);401+ fil_space_set_corrupt(bpage->space);
412+ if (trx && trx->dict_operation_lock_mode == 0) {402+
403+ trx = innobase_get_trx();
404+ if (trx && trx->dict_operation_lock_mode == RW_X_LATCH) {
405+ dict_table_set_corrupt_by_space(bpage->space, FALSE);
406+ } else {
413+ dict_table_set_corrupt_by_space(bpage->space, TRUE);407+ dict_table_set_corrupt_by_space(bpage->space, TRUE);
414+ } else {
415+ dict_table_set_corrupt_by_space(bpage->space, FALSE);
416+ }408+ }
417+ bpage->is_corrupt = TRUE;409+ bpage->is_corrupt = TRUE;
418+ } else410+ } else
419 if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {411 if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
420 fputs("InnoDB: Ending processing because of"412 fputs("InnoDB: Ending processing because of"
421 " a corrupt database page.\n",413 " a corrupt database page.\n",
422@@ -4347,6 +4385,7 @@414@@ -4347,6 +4386,7 @@
423 exit(1);415 exit(1);
424 }416 }
425 }417 }
@@ -427,7 +419,7 @@
427 419
428 if (recv_recovery_is_on()) {420 if (recv_recovery_is_on()) {
429 /* Pages must be uncompressed for crash recovery. */421 /* Pages must be uncompressed for crash recovery. */
430@@ -4356,8 +4395,11 @@422@@ -4356,8 +4396,11 @@
431 423
432 if (uncompressed && !recv_no_ibuf_operations) {424 if (uncompressed && !recv_no_ibuf_operations) {
433 ibuf_merge_or_delete_for_page(425 ibuf_merge_or_delete_for_page(
@@ -442,7 +434,7 @@
442diff -ruN a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c434diff -ruN a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
443--- a/storage/innobase/buf/buf0rea.c 2010-12-04 15:37:50.557553380 +0900435--- a/storage/innobase/buf/buf0rea.c 2010-12-04 15:37:50.557553380 +0900
444+++ b/storage/innobase/buf/buf0rea.c 2010-12-04 15:41:09.784467585 +0900436+++ b/storage/innobase/buf/buf0rea.c 2010-12-04 15:41:09.784467585 +0900
445@@ -193,12 +193,19 @@437@@ -193,7 +193,14 @@
446 ((buf_block_t*) bpage)->frame, bpage, trx);438 ((buf_block_t*) bpage)->frame, bpage, trx);
447 }439 }
448 thd_wait_end(NULL);440 thd_wait_end(NULL);
@@ -457,24 +449,18 @@
457 449
458 if (sync) {450 if (sync) {
459 /* The i/o is already completed when we arrive from451 /* The i/o is already completed when we arrive from
460 fil_read */
461- buf_page_io_complete(bpage);
462+ buf_page_io_complete(bpage, trx);
463 }
464
465 return(1);
466diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c452diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
467--- a/storage/innobase/dict/dict0dict.c 2010-12-03 17:30:16.248987063 +0900453--- a/storage/innobase/dict/dict0dict.c 2010-12-03 17:30:16.248987063 +0900
468+++ b/storage/innobase/dict/dict0dict.c 2010-12-04 15:45:23.808513973 +0900454+++ b/storage/innobase/dict/dict0dict.c 2010-12-04 15:45:23.808513973 +0900
469@@ -55,6 +55,7 @@455@@ -54,6 +54,7 @@
470 #include "srv0srv.h" /* srv_lower_case_table_names */456 #include "row0merge.h"
471 #include "m_ctype.h" /* my_isspace() */457 #include "m_ctype.h" /* my_isspace() */
472 #include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/458 #include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/
473+#include "srv0start.h" /* SRV_LOG_SPACE_FIRST_ID */459+#include "srv0start.h" /* SRV_LOG_SPACE_FIRST_ID */
474 460
475 #include <ctype.h>461 #include <ctype.h>
476 462
477@@ -751,7 +752,7 @@463@@ -750,7 +751,7 @@
478 464
479 mutex_exit(&(dict_sys->mutex));465 mutex_exit(&(dict_sys->mutex));
480 466
@@ -483,7 +469,7 @@
483 /* If table->ibd_file_missing == TRUE, this will469 /* If table->ibd_file_missing == TRUE, this will
484 print an error message and return without doing470 print an error message and return without doing
485 anything. */471 anything. */
486@@ -1294,7 +1295,7 @@472@@ -1293,7 +1294,7 @@
487 + dict_sys->size) > srv_dict_size_limit ) {473 + dict_sys->size) > srv_dict_size_limit ) {
488 prev_table = UT_LIST_GET_PREV(table_LRU, table);474 prev_table = UT_LIST_GET_PREV(table_LRU, table);
489 475
@@ -492,7 +478,7 @@
492 goto next_loop;478 goto next_loop;
493 479
494 cached_foreign_tables = 0;480 cached_foreign_tables = 0;
495@@ -4333,6 +4334,12 @@481@@ -4332,6 +4333,12 @@
496 heap = mem_heap_create(1000);482 heap = mem_heap_create(1000);
497 483
498 while (index) {484 while (index) {
@@ -505,7 +491,7 @@
505 size = btr_get_size(index, BTR_TOTAL_SIZE);491 size = btr_get_size(index, BTR_TOTAL_SIZE);
506 492
507 index->stat_index_size = size;493 index->stat_index_size = size;
508@@ -4480,6 +4487,12 @@494@@ -4479,6 +4486,12 @@
509 heap = mem_heap_create(1000);495 heap = mem_heap_create(1000);
510 496
511 while (index) {497 while (index) {
@@ -518,20 +504,21 @@
518 /*===========================================*/504 /*===========================================*/
519 {505 {
520 dict_table_t* sys_stats;506 dict_table_t* sys_stats;
521@@ -4666,6 +4679,12 @@507@@ -4671,6 +4684,13 @@
522 || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO508 || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
523 && dict_index_is_clust(index)))) {509 && dict_index_is_clust(index)))) {
524 ulint size;510 ulint size;
525+511+
526+ if (table->is_corrupt) {512+ if (table->is_corrupt) {
527+ ut_a(srv_pass_corrupt_table);513+ ut_a(srv_pass_corrupt_table);
514+ dict_table_stats_unlock(table, RW_X_LATCH);
528+ return;515+ return;
529+ }516+ }
530+517+
531 size = btr_get_size(index, BTR_TOTAL_SIZE);518 size = btr_get_size(index, BTR_TOTAL_SIZE);
532 519
533 index->stat_index_size = size;520 index->stat_index_size = size;
534@@ -5462,4 +5481,42 @@521@@ -5467,4 +5487,42 @@
535 rw_lock_free(&dict_table_stats_latches[i]);522 rw_lock_free(&dict_table_stats_latches[i]);
536 }523 }
537 }524 }
@@ -577,7 +564,7 @@
577diff -ruN a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c564diff -ruN a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
578--- a/storage/innobase/dict/dict0mem.c 2010-11-03 07:01:13.000000000 +0900565--- a/storage/innobase/dict/dict0mem.c 2010-11-03 07:01:13.000000000 +0900
579+++ b/storage/innobase/dict/dict0mem.c 2010-12-04 15:38:18.126549463 +0900566+++ b/storage/innobase/dict/dict0mem.c 2010-12-04 15:38:18.126549463 +0900
580@@ -97,6 +97,8 @@567@@ -96,6 +96,8 @@
581 /* The number of transactions that are either waiting on the568 /* The number of transactions that are either waiting on the
582 AUTOINC lock or have been granted the lock. */569 AUTOINC lock or have been granted the lock. */
583 table->n_waiting_or_granted_auto_inc_locks = 0;570 table->n_waiting_or_granted_auto_inc_locks = 0;
@@ -589,7 +576,7 @@
589diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c576diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
590--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:37:50.564551587 +0900577--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:37:50.564551587 +0900
591+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:38:18.128549252 +0900578+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:38:18.128549252 +0900
592@@ -233,6 +233,7 @@579@@ -235,6 +235,7 @@
593 file we have written to */580 file we have written to */
594 ibool is_in_unflushed_spaces; /*!< TRUE if this space is581 ibool is_in_unflushed_spaces; /*!< TRUE if this space is
595 currently in unflushed_spaces */582 currently in unflushed_spaces */
@@ -597,7 +584,7 @@
597 UT_LIST_NODE_T(fil_space_t) space_list;584 UT_LIST_NODE_T(fil_space_t) space_list;
598 /*!< list of all spaces */585 /*!< list of all spaces */
599 ulint magic_n;/*!< FIL_SPACE_MAGIC_N */586 ulint magic_n;/*!< FIL_SPACE_MAGIC_N */
600@@ -1291,6 +1292,8 @@587@@ -1293,6 +1294,8 @@
601 ut_fold_string(name), space);588 ut_fold_string(name), space);
602 space->is_in_unflushed_spaces = FALSE;589 space->is_in_unflushed_spaces = FALSE;
603 590
@@ -606,18 +593,18 @@
606 UT_LIST_ADD_LAST(space_list, fil_system->space_list, space);593 UT_LIST_ADD_LAST(space_list, fil_system->space_list, space);
607 594
608 mutex_exit(&fil_system->mutex);595 mutex_exit(&fil_system->mutex);
609@@ -4943,6 +4946,22 @@596@@ -5267,6 +5270,34 @@
610 ut_a(byte_offset % OS_FILE_LOG_BLOCK_SIZE == 0);597 ut_a(byte_offset % OS_FILE_LOG_BLOCK_SIZE == 0);
611 ut_a((len % OS_FILE_LOG_BLOCK_SIZE) == 0);598 ut_a((len % OS_FILE_LOG_BLOCK_SIZE) == 0);
612 599
613+ if (srv_pass_corrupt_table && space->is_corrupt) {600+ if (srv_pass_corrupt_table == 1 && space->is_corrupt) {
614+ /* should ignore i/o for the crashed space */601+ /* should ignore i/o for the crashed space */
615+ mutex_enter(&fil_system->mutex);602+ mutex_enter(&fil_system->mutex);
616+ fil_node_complete_io(node, fil_system, type);603+ fil_node_complete_io(node, fil_system, type);
617+ mutex_exit(&fil_system->mutex);604+ mutex_exit(&fil_system->mutex);
618+ if (mode == OS_AIO_NORMAL) {605+ if (mode == OS_AIO_NORMAL) {
619+ ut_a(space->purpose == FIL_TABLESPACE);606+ ut_a(space->purpose == FIL_TABLESPACE);
620+ buf_page_io_complete(message, trx);607+ buf_page_io_complete(message);
621+ }608+ }
622+ if (type == OS_FILE_READ) {609+ if (type == OS_FILE_READ) {
623+ return(DB_TABLESPACE_DELETED);610+ return(DB_TABLESPACE_DELETED);
@@ -625,11 +612,23 @@
625+ return(DB_SUCCESS);612+ return(DB_SUCCESS);
626+ }613+ }
627+ } else {614+ } else {
628+ ut_a(!space->is_corrupt);615+ if (srv_pass_corrupt_table > 1 && space->is_corrupt) {
616+ /* should ignore write i/o for the crashed space */
617+ if (type == OS_FILE_WRITE) {
618+ mutex_enter(&fil_system->mutex);
619+ fil_node_complete_io(node, fil_system, type);
620+ mutex_exit(&fil_system->mutex);
621+ if (mode == OS_AIO_NORMAL) {
622+ ut_a(space->purpose == FIL_TABLESPACE);
623+ buf_page_io_complete(message);
624+ }
625+ return(DB_SUCCESS);
626+ }
627+ }
629 #ifdef UNIV_HOTBACKUP628 #ifdef UNIV_HOTBACKUP
630 /* In ibbackup do normal i/o, not aio */629 /* In ibbackup do normal i/o, not aio */
631 if (type == OS_FILE_READ) {630 if (type == OS_FILE_READ) {
632@@ -4957,6 +4976,8 @@631@@ -5281,6 +5312,8 @@
633 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,632 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
634 offset_low, offset_high, len, node, message, trx);633 offset_low, offset_high, len, node, message, trx);
635 #endif634 #endif
@@ -638,16 +637,7 @@
638 ut_a(ret);637 ut_a(ret);
639 638
640 if (mode == OS_AIO_SYNC) {639 if (mode == OS_AIO_SYNC) {
641@@ -5098,7 +5119,7 @@640@@ -5780,3 +5813,46 @@
642
643 if (fil_node->space->purpose == FIL_TABLESPACE) {
644 srv_set_io_thread_op_info(segment, "complete io for buf page");
645- buf_page_io_complete(message);
646+ buf_page_io_complete(message, NULL);
647 } else {
648 srv_set_io_thread_op_info(segment, "complete io for log");
649 log_io_complete(message);
650@@ -5452,3 +5473,46 @@
651 return 0;641 return 0;
652 }642 }
653 }643 }
@@ -808,11 +798,11 @@
808diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc798diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
809--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:37:50.578486593 +0900799--- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:37:50.578486593 +0900
810+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:38:18.137549396 +0900800+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:38:18.137549396 +0900
811@@ -3959,6 +3959,12 @@801@@ -3972,6 +3972,12 @@
812 DBUG_RETURN(1);802 DBUG_RETURN(1);
813 }803 }
814 804
815+ if (share->ib_table && share->ib_table->is_corrupt) {805+ if (srv_pass_corrupt_table <= 1 && share->ib_table && share->ib_table->is_corrupt) {
816+ free_share(share);806+ free_share(share);
817+807+
818+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);808+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
@@ -821,11 +811,11 @@
821 /* Create buffers for packing the fields of a record. Why811 /* Create buffers for packing the fields of a record. Why
822 table->reclength did not work here? Obviously, because char812 table->reclength did not work here? Obviously, because char
823 fields when packed actually became 1 byte longer, when we also813 fields when packed actually became 1 byte longer, when we also
824@@ -3986,6 +3992,19 @@814@@ -3999,6 +4005,19 @@
825 /* Get pointer to a table object in InnoDB dictionary cache */815 /* Get pointer to a table object in InnoDB dictionary cache */
826 ib_table = dict_table_get(norm_name, TRUE);816 ib_table = dict_table_get(norm_name, TRUE);
827 817
828+ if (ib_table && ib_table->is_corrupt) {818+ if (srv_pass_corrupt_table <= 1 && ib_table && ib_table->is_corrupt) {
829+ free_share(share);819+ free_share(share);
830+ my_free(upd_buff);820+ my_free(upd_buff);
831+821+
@@ -841,7 +831,7 @@
841 if (NULL == ib_table) {831 if (NULL == ib_table) {
842 if (is_part && retries < 10) {832 if (is_part && retries < 10) {
843 ++retries;833 ++retries;
844@@ -5150,6 +5169,10 @@834@@ -5163,6 +5182,10 @@
845 835
846 ha_statistic_increment(&SSV::ha_write_count);836 ha_statistic_increment(&SSV::ha_write_count);
847 837
@@ -852,7 +842,7 @@
852 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)842 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
853 table->timestamp_field->set_time();843 table->timestamp_field->set_time();
854 844
855@@ -5367,6 +5390,10 @@845@@ -5380,6 +5403,10 @@
856 func_exit:846 func_exit:
857 innobase_active_small();847 innobase_active_small();
858 848
@@ -863,7 +853,7 @@
863 DBUG_RETURN(error_result);853 DBUG_RETURN(error_result);
864 }854 }
865 855
866@@ -5543,6 +5570,10 @@856@@ -5556,6 +5583,10 @@
867 857
868 ha_statistic_increment(&SSV::ha_update_count);858 ha_statistic_increment(&SSV::ha_update_count);
869 859
@@ -874,7 +864,7 @@
874 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)864 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
875 table->timestamp_field->set_time();865 table->timestamp_field->set_time();
876 866
877@@ -5632,6 +5663,10 @@867@@ -5645,6 +5676,10 @@
878 868
879 innobase_active_small();869 innobase_active_small();
880 870
@@ -885,7 +875,7 @@
885 DBUG_RETURN(error);875 DBUG_RETURN(error);
886 }876 }
887 877
888@@ -5653,6 +5688,10 @@878@@ -5666,6 +5701,10 @@
889 879
890 ha_statistic_increment(&SSV::ha_delete_count);880 ha_statistic_increment(&SSV::ha_delete_count);
891 881
@@ -896,7 +886,7 @@
896 if (!prebuilt->upd_node) {886 if (!prebuilt->upd_node) {
897 row_get_prebuilt_update_vector(prebuilt);887 row_get_prebuilt_update_vector(prebuilt);
898 }888 }
899@@ -5679,6 +5718,10 @@889@@ -5692,6 +5731,10 @@
900 890
901 innobase_active_small();891 innobase_active_small();
902 892
@@ -907,62 +897,62 @@
907 DBUG_RETURN(error);897 DBUG_RETURN(error);
908 }898 }
909 899
910@@ -5918,6 +5961,10 @@900@@ -5931,6 +5974,10 @@
911 901
912 ha_statistic_increment(&SSV::ha_read_key_count);902 ha_statistic_increment(&SSV::ha_read_key_count);
913 903
914+ if (share->ib_table->is_corrupt) {904+ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
915+ DBUG_RETURN(HA_ERR_CRASHED);905+ DBUG_RETURN(HA_ERR_CRASHED);
916+ }906+ }
917+907+
918 index = prebuilt->index;908 index = prebuilt->index;
919 909
920 if (UNIV_UNLIKELY(index == NULL)) {910 if (UNIV_UNLIKELY(index == NULL)) {
921@@ -5983,6 +6030,10 @@911@@ -5996,6 +6043,10 @@
922 ret = DB_UNSUPPORTED;912 ret = DB_UNSUPPORTED;
923 }913 }
924 914
925+ if (share->ib_table->is_corrupt) {915+ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
926+ DBUG_RETURN(HA_ERR_CRASHED);916+ DBUG_RETURN(HA_ERR_CRASHED);
927+ }917+ }
928+918+
929 switch (ret) {919 switch (ret) {
930 case DB_SUCCESS:920 case DB_SUCCESS:
931 error = 0;921 error = 0;
932@@ -6098,6 +6149,10 @@922@@ -6111,6 +6162,10 @@
933 {923 {
934 DBUG_ENTER("change_active_index");924 DBUG_ENTER("change_active_index");
935 925
936+ if (share->ib_table->is_corrupt) {926+ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
937+ DBUG_RETURN(HA_ERR_CRASHED);927+ DBUG_RETURN(HA_ERR_CRASHED);
938+ }928+ }
939+929+
940 ut_ad(user_thd == ha_thd());930 ut_ad(user_thd == ha_thd());
941 ut_a(prebuilt->trx == thd_to_trx(user_thd));931 ut_a(prebuilt->trx == thd_to_trx(user_thd));
942 932
943@@ -6188,6 +6243,10 @@933@@ -6201,6 +6256,10 @@
944 934
945 DBUG_ENTER("general_fetch");935 DBUG_ENTER("general_fetch");
946 936
947+ if (share->ib_table->is_corrupt) {937+ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
948+ DBUG_RETURN(HA_ERR_CRASHED);938+ DBUG_RETURN(HA_ERR_CRASHED);
949+ }939+ }
950+940+
951 ut_a(prebuilt->trx == thd_to_trx(user_thd));941 ut_a(prebuilt->trx == thd_to_trx(user_thd));
952 942
953 innodb_srv_conc_enter_innodb(prebuilt->trx);943 innodb_srv_conc_enter_innodb(prebuilt->trx);
954@@ -6197,6 +6256,10 @@944@@ -6210,6 +6269,10 @@
955 945
956 innodb_srv_conc_exit_innodb(prebuilt->trx);946 innodb_srv_conc_exit_innodb(prebuilt->trx);
957 947
958+ if (share->ib_table->is_corrupt) {948+ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
959+ DBUG_RETURN(HA_ERR_CRASHED);949+ DBUG_RETURN(HA_ERR_CRASHED);
960+ }950+ }
961+951+
962 switch (ret) {952 switch (ret) {
963 case DB_SUCCESS:953 case DB_SUCCESS:
964 error = 0;954 error = 0;
965@@ -7467,10 +7530,18 @@955@@ -7476,10 +7539,18 @@
966 956
967 update_thd(ha_thd());957 update_thd(ha_thd());
968 958
@@ -981,7 +971,7 @@
981 error = convert_error_code_to_mysql(error, prebuilt->table->flags,971 error = convert_error_code_to_mysql(error, prebuilt->table->flags,
982 NULL);972 NULL);
983 973
984@@ -7975,6 +8046,16 @@974@@ -7980,6 +8051,16 @@
985 return(ranges + (double) rows / (double) total_rows * time_for_scan);975 return(ranges + (double) rows / (double) total_rows * time_for_scan);
986 }976 }
987 977
@@ -998,7 +988,7 @@
998 /*********************************************************************//**988 /*********************************************************************//**
999 Calculates the key number used inside MySQL for an Innobase index. We will989 Calculates the key number used inside MySQL for an Innobase index. We will
1000 first check the "index translation table" for a match of the index to get990 first check the "index translation table" for a match of the index to get
1001@@ -8152,7 +8233,7 @@991@@ -8157,7 +8238,7 @@
1002 ib_table = prebuilt->table;992 ib_table = prebuilt->table;
1003 993
1004 if (flag & HA_STATUS_TIME) {994 if (flag & HA_STATUS_TIME) {
@@ -1007,7 +997,7 @@
1007 /* In sql_show we call with this flag: update997 /* In sql_show we call with this flag: update
1008 then statistics so that they are up-to-date */998 then statistics so that they are up-to-date */
1009 999
1010@@ -8445,10 +8526,18 @@1000@@ -8450,10 +8531,18 @@
1011 THD* thd, /*!< in: connection thread handle */1001 THD* thd, /*!< in: connection thread handle */
1012 HA_CHECK_OPT* check_opt) /*!< in: currently ignored */1002 HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
1013 {1003 {
@@ -1026,7 +1016,7 @@
1026 return(0);1016 return(0);
1027 }1017 }
1028 1018
1029@@ -8630,6 +8719,10 @@1019@@ -8635,6 +8724,10 @@
1030 my_error(ER_QUERY_INTERRUPTED, MYF(0));1020 my_error(ER_QUERY_INTERRUPTED, MYF(0));
1031 }1021 }
1032 1022
@@ -1037,7 +1027,7 @@
1037 DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);1027 DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
1038 }1028 }
1039 1029
1040@@ -9400,6 +9493,10 @@1030@@ -9405,6 +9498,10 @@
1041 1031
1042 update_thd(thd);1032 update_thd(thd);
1043 1033
@@ -1048,7 +1038,7 @@
1048 if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {1038 if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
1049 ut_print_timestamp(stderr);1039 ut_print_timestamp(stderr);
1050 fprintf(stderr,1040 fprintf(stderr,
1051@@ -11800,6 +11897,25 @@1041@@ -11807,6 +11904,26 @@
1052 "0 (the default) disables automatic dumps.",1042 "0 (the default) disables automatic dumps.",
1053 NULL, NULL, 0, 0, UINT_MAX32, 0);1043 NULL, NULL, 0, 0, UINT_MAX32, 0);
1054 1044
@@ -1056,6 +1046,7 @@
1056+{1046+{
1057+ "assert", /* 0 */1047+ "assert", /* 0 */
1058+ "warn", /* 1 */1048+ "warn", /* 1 */
1049+ "salvage", /* 2 */
1059+ NullS1050+ NullS
1060+};1051+};
1061+TYPELIB corrupt_table_action_typelib=1052+TYPELIB corrupt_table_action_typelib=
@@ -1074,7 +1065,7 @@
1074 static struct st_mysql_sys_var* innobase_system_variables[]= {1065 static struct st_mysql_sys_var* innobase_system_variables[]= {
1075 MYSQL_SYSVAR(additional_mem_pool_size),1066 MYSQL_SYSVAR(additional_mem_pool_size),
1076 MYSQL_SYSVAR(autoextend_increment),1067 MYSQL_SYSVAR(autoextend_increment),
1077@@ -11886,6 +12002,7 @@1068@@ -11893,6 +12010,7 @@
1078 MYSQL_SYSVAR(purge_threads),1069 MYSQL_SYSVAR(purge_threads),
1079 MYSQL_SYSVAR(purge_batch_size),1070 MYSQL_SYSVAR(purge_batch_size),
1080 MYSQL_SYSVAR(rollback_segments),1071 MYSQL_SYSVAR(rollback_segments),
@@ -1136,17 +1127,7 @@
1136 #endif /* UNIV_DEBUG */1127 #endif /* UNIV_DEBUG */
1137 /*********************************************************************//**1128 /*********************************************************************//**
1138 Gets the space id of a block.1129 Gets the space id of a block.
1139@@ -1118,7 +1118,8 @@1130@@ -1433,6 +1433,7 @@
1140 void
1141 buf_page_io_complete(
1142 /*=================*/
1143- buf_page_t* bpage); /*!< in: pointer to the block in question */
1144+ buf_page_t* bpage, /*!< in: pointer to the block in question */
1145+ trx_t* trx);
1146 /********************************************************************//**
1147 Calculates a folded value of a file page address to use in the page hash
1148 table.
1149@@ -1433,6 +1434,7 @@
1150 0 if the block was never accessed1131 0 if the block was never accessed
1151 in the buffer pool */1132 in the buffer pool */
1152 /* @} */1133 /* @} */
@@ -1201,7 +1182,7 @@
1201diff -ruN a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h1182diff -ruN a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
1202--- a/storage/innobase/include/dict0mem.h 2010-11-03 07:01:13.000000000 +09001183--- a/storage/innobase/include/dict0mem.h 2010-11-03 07:01:13.000000000 +0900
1203+++ b/storage/innobase/include/dict0mem.h 2010-12-04 15:38:18.171513956 +09001184+++ b/storage/innobase/include/dict0mem.h 2010-12-04 15:38:18.171513956 +0900
1204@@ -636,6 +636,7 @@1185@@ -640,6 +640,7 @@
1205 the AUTOINC lock on this table. */1186 the AUTOINC lock on this table. */
1206 /* @} */1187 /* @} */
1207 /*----------------------*/1188 /*----------------------*/
@@ -1296,7 +1277,7 @@
1296diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h1277diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
1297--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:37:50.591516341 +09001278--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:37:50.591516341 +0900
1298+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:38:18.180563749 +09001279+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:38:18.180563749 +0900
1299@@ -243,6 +243,7 @@1280@@ -240,6 +240,7 @@
1300 extern ulint srv_adaptive_flushing_method;1281 extern ulint srv_adaptive_flushing_method;
1301 1282
1302 extern ulint srv_expand_import;1283 extern ulint srv_expand_import;
@@ -1354,7 +1335,7 @@
1354diff -ruN a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c1335diff -ruN a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
1355--- a/storage/innobase/row/row0sel.c 2010-11-03 07:01:13.000000000 +09001336--- a/storage/innobase/row/row0sel.c 2010-11-03 07:01:13.000000000 +0900
1356+++ b/storage/innobase/row/row0sel.c 2010-12-04 15:38:18.205551115 +09001337+++ b/storage/innobase/row/row0sel.c 2010-12-04 15:38:18.205551115 +0900
1357@@ -3848,6 +3848,13 @@1338@@ -3853,6 +3853,13 @@
1358 /* PHASE 4: Look for matching records in a loop */1339 /* PHASE 4: Look for matching records in a loop */
1359 1340
1360 rec = btr_pcur_get_rec(pcur);1341 rec = btr_pcur_get_rec(pcur);
@@ -1368,10 +1349,35 @@
1368 ut_ad(!!page_rec_is_comp(rec) == comp);1349 ut_ad(!!page_rec_is_comp(rec) == comp);
1369 #ifdef UNIV_SEARCH_DEBUG1350 #ifdef UNIV_SEARCH_DEBUG
1370 /*1351 /*
1352@@ -3930,7 +3937,13 @@
1353 if (UNIV_UNLIKELY(next_offs >= UNIV_PAGE_SIZE - PAGE_DIR)) {
1354
1355 wrong_offs:
1356- if (srv_force_recovery == 0 || moves_up == FALSE) {
1357+ if (srv_pass_corrupt_table && !trx_sys_sys_space(index->table->space)) {
1358+ index->table->is_corrupt = TRUE;
1359+ fil_space_set_corrupt(index->table->space);
1360+ }
1361+
1362+ if ((srv_force_recovery == 0 || moves_up == FALSE)
1363+ && srv_pass_corrupt_table <= 1) {
1364 ut_print_timestamp(stderr);
1365 buf_page_print(page_align(rec), 0);
1366 fprintf(stderr,
1367@@ -3981,7 +3994,8 @@
1368
1369 offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
1370
1371- if (UNIV_UNLIKELY(srv_force_recovery > 0)) {
1372+ if (UNIV_UNLIKELY(srv_force_recovery > 0)
1373+ || (srv_pass_corrupt_table == 2 && index->table->is_corrupt)) {
1374 if (!rec_validate(rec, offsets)
1375 || !btr_index_rec_validate(rec, index, FALSE)) {
1376 fprintf(stderr,
1371diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c1377diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
1372--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:37:50.602481253 +09001378--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:37:50.602481253 +0900
1373+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:38:18.209513823 +09001379+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:38:18.209513823 +0900
1374@@ -436,6 +436,7 @@1380@@ -430,6 +430,7 @@
1375 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */1381 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
1376 1382
1377 UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */1383 UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */
13781384
=== modified file 'innodb_recovery_patches.patch'
--- innodb_recovery_patches.patch 2011-05-10 11:57:42 +0000
+++ innodb_recovery_patches.patch 2011-06-20 09:04:39 +0000
@@ -117,7 +117,7 @@
117 static my_bool innobase_locks_unsafe_for_binlog = FALSE;117 static my_bool innobase_locks_unsafe_for_binlog = FALSE;
118 static my_bool innobase_overwrite_relay_log_info = FALSE;118 static my_bool innobase_overwrite_relay_log_info = FALSE;
119 static my_bool innobase_rollback_on_timeout = FALSE;119 static my_bool innobase_rollback_on_timeout = FALSE;
120@@ -2562,6 +2563,8 @@120@@ -2576,6 +2577,8 @@
121 121
122 srv_force_recovery = (ulint) innobase_force_recovery;122 srv_force_recovery = (ulint) innobase_force_recovery;
123 123
@@ -126,7 +126,7 @@
126 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;126 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
127 srv_use_checksums = (ibool) innobase_use_checksums;127 srv_use_checksums = (ibool) innobase_use_checksums;
128 128
129@@ -11267,6 +11270,11 @@129@@ -11274,6 +11277,11 @@
130 "The common part for InnoDB table spaces.",130 "The common part for InnoDB table spaces.",
131 NULL, NULL, NULL);131 NULL, NULL, NULL);
132 132
@@ -138,7 +138,7 @@
138 static MYSQL_SYSVAR_BOOL(recovery_update_relay_log, innobase_overwrite_relay_log_info,138 static MYSQL_SYSVAR_BOOL(recovery_update_relay_log, innobase_overwrite_relay_log_info,
139 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,139 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
140 "During InnoDB crash recovery on slave overwrite relay-log.info "140 "During InnoDB crash recovery on slave overwrite relay-log.info "
141@@ -11740,6 +11748,7 @@141@@ -11747,6 +11755,7 @@
142 MYSQL_SYSVAR(data_file_path),142 MYSQL_SYSVAR(data_file_path),
143 MYSQL_SYSVAR(data_home_dir),143 MYSQL_SYSVAR(data_home_dir),
144 MYSQL_SYSVAR(doublewrite),144 MYSQL_SYSVAR(doublewrite),
@@ -192,7 +192,7 @@
192diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h192diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
193--- a/storage/innobase/include/srv0srv.h 2010-12-03 17:30:16.321953515 +0900193--- a/storage/innobase/include/srv0srv.h 2010-12-03 17:30:16.321953515 +0900
194+++ b/storage/innobase/include/srv0srv.h 2010-12-03 17:30:41.593985184 +0900194+++ b/storage/innobase/include/srv0srv.h 2010-12-03 17:30:41.593985184 +0900
195@@ -129,6 +129,8 @@195@@ -126,6 +126,8 @@
196 extern ulint* srv_data_file_sizes;196 extern ulint* srv_data_file_sizes;
197 extern ulint* srv_data_file_is_raw_partition;197 extern ulint* srv_data_file_is_raw_partition;
198 198
@@ -441,8 +441,8 @@
441 #ifndef UNIV_HOTBACKUP441 #ifndef UNIV_HOTBACKUP
442 # include "os0sync.h"442 # include "os0sync.h"
443 # include "os0thread.h"443 # include "os0thread.h"
444@@ -4262,6 +4263,18 @@444@@ -4260,6 +4261,18 @@
445 os_thread_exit(NULL);445 INFINITE);
446 }446 }
447 447
448+ if (srv_recovery_stats && recv_recovery_is_on() && n_consecutive) {448+ if (srv_recovery_stats && recv_recovery_is_on() && n_consecutive) {
@@ -459,11 +459,11 @@
459+459+
460 os_mutex_enter(array->mutex);460 os_mutex_enter(array->mutex);
461 461
462 slot = os_aio_array_get_nth_slot(array, i + segment * n);462 if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS
463diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c463diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
464--- a/storage/innobase/srv/srv0srv.c 2010-12-03 17:30:16.339955597 +0900464--- a/storage/innobase/srv/srv0srv.c 2010-12-03 17:30:16.339955597 +0900
465+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 17:30:41.604958138 +0900465+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 17:30:41.604958138 +0900
466@@ -166,6 +166,8 @@466@@ -160,6 +160,8 @@
467 /* size in database pages */467 /* size in database pages */
468 UNIV_INTERN ulint* srv_data_file_sizes = NULL;468 UNIV_INTERN ulint* srv_data_file_sizes = NULL;
469 469
@@ -475,7 +475,7 @@
475diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c475diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
476--- a/storage/innobase/trx/trx0sys.c 2010-12-03 15:41:52.051986524 +0900476--- a/storage/innobase/trx/trx0sys.c 2010-12-03 15:41:52.051986524 +0900
477+++ b/storage/innobase/trx/trx0sys.c 2010-12-03 17:30:41.607026818 +0900477+++ b/storage/innobase/trx/trx0sys.c 2010-12-03 17:30:41.607026818 +0900
478@@ -566,6 +566,12 @@478@@ -567,6 +567,12 @@
479 zip_size ? zip_size : UNIV_PAGE_SIZE,479 zip_size ? zip_size : UNIV_PAGE_SIZE,
480 read_buf, NULL);480 read_buf, NULL);
481 481
@@ -488,7 +488,7 @@
488 /* Check if the page is corrupt */488 /* Check if the page is corrupt */
489 489
490 if (UNIV_UNLIKELY490 if (UNIV_UNLIKELY
491@@ -613,6 +619,13 @@491@@ -614,6 +620,13 @@
492 zip_size, page_no, 0,492 zip_size, page_no, 0,
493 zip_size ? zip_size : UNIV_PAGE_SIZE,493 zip_size ? zip_size : UNIV_PAGE_SIZE,
494 page, NULL);494 page, NULL);
495495
=== modified file 'innodb_separate_doublewrite.patch'
--- innodb_separate_doublewrite.patch 2011-05-10 11:57:42 +0000
+++ innodb_separate_doublewrite.patch 2011-06-20 09:04:39 +0000
@@ -105,7 +105,7 @@
105diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c105diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
106--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:35:29.143813775 +0900106--- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:35:29.143813775 +0900
107+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:35:58.628498870 +0900107+++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:35:58.628498870 +0900
108@@ -655,7 +655,7 @@108@@ -657,7 +657,7 @@
109 109
110 UT_LIST_ADD_LAST(chain, space->chain, node);110 UT_LIST_ADD_LAST(chain, space->chain, node);
111 111
@@ -114,7 +114,7 @@
114 114
115 fil_system->max_assigned_id = id;115 fil_system->max_assigned_id = id;
116 }116 }
117@@ -719,14 +719,14 @@117@@ -721,14 +721,14 @@
118 size_bytes = (((ib_int64_t)size_high) << 32)118 size_bytes = (((ib_int64_t)size_high) << 32)
119 + (ib_int64_t)size_low;119 + (ib_int64_t)size_low;
120 #ifdef UNIV_HOTBACKUP120 #ifdef UNIV_HOTBACKUP
@@ -131,7 +131,7 @@
131 131
132 if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {132 if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
133 fprintf(stderr,133 fprintf(stderr,
134@@ -772,7 +772,7 @@134@@ -774,7 +774,7 @@
135 }135 }
136 136
137 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED137 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
@@ -140,7 +140,7 @@
140 fprintf(stderr,140 fprintf(stderr,
141 "InnoDB: Error: tablespace id %lu"141 "InnoDB: Error: tablespace id %lu"
142 " in file %s is not sensible\n",142 " in file %s is not sensible\n",
143@@ -840,7 +840,7 @@143@@ -842,7 +842,7 @@
144 144
145 system->n_open++;145 system->n_open++;
146 146
@@ -149,7 +149,7 @@
149 /* Put the node to the LRU list */149 /* Put the node to the LRU list */
150 UT_LIST_ADD_FIRST(LRU, system->LRU, node);150 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
151 }151 }
152@@ -873,7 +873,7 @@152@@ -875,7 +875,7 @@
153 ut_a(system->n_open > 0);153 ut_a(system->n_open > 0);
154 system->n_open--;154 system->n_open--;
155 155
@@ -158,7 +158,7 @@
158 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);158 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);
159 159
160 /* The node is in the LRU list, remove it */160 /* The node is in the LRU list, remove it */
161@@ -959,7 +959,7 @@161@@ -961,7 +961,7 @@
162 retry:162 retry:
163 mutex_enter(&fil_system->mutex);163 mutex_enter(&fil_system->mutex);
164 164
@@ -167,7 +167,7 @@
167 /* We keep log files and system tablespace files always open;167 /* We keep log files and system tablespace files always open;
168 this is important in preventing deadlocks in this module, as168 this is important in preventing deadlocks in this module, as
169 a page read completion often performs another read from the169 a page read completion often performs another read from the
170@@ -1190,7 +1190,7 @@170@@ -1192,7 +1192,7 @@
171 " tablespace memory cache!\n",171 " tablespace memory cache!\n",
172 (ulong) space->id);172 (ulong) space->id);
173 173
@@ -176,7 +176,7 @@
176 176
177 mutex_exit(&fil_system->mutex);177 mutex_exit(&fil_system->mutex);
178 178
179@@ -1252,6 +1252,7 @@179@@ -1254,6 +1254,7 @@
180 space->mark = FALSE;180 space->mark = FALSE;
181 181
182 if (UNIV_LIKELY(purpose == FIL_TABLESPACE && !recv_recovery_on)182 if (UNIV_LIKELY(purpose == FIL_TABLESPACE && !recv_recovery_on)
@@ -184,7 +184,7 @@
184 && UNIV_UNLIKELY(id > fil_system->max_assigned_id)) {184 && UNIV_UNLIKELY(id > fil_system->max_assigned_id)) {
185 if (!fil_system->space_id_reuse_warned) {185 if (!fil_system->space_id_reuse_warned) {
186 fil_system->space_id_reuse_warned = TRUE;186 fil_system->space_id_reuse_warned = TRUE;
187@@ -1335,7 +1336,7 @@187@@ -1337,7 +1338,7 @@
188 (ulong) SRV_LOG_SPACE_FIRST_ID);188 (ulong) SRV_LOG_SPACE_FIRST_ID);
189 }189 }
190 190
@@ -193,7 +193,7 @@
193 193
194 if (success) {194 if (success) {
195 *space_id = fil_system->max_assigned_id = id;195 *space_id = fil_system->max_assigned_id = id;
196@@ -1598,6 +1599,8 @@196@@ -1600,6 +1601,8 @@
197 UT_LIST_INIT(fil_system->LRU);197 UT_LIST_INIT(fil_system->LRU);
198 198
199 fil_system->max_n_open = max_n_open;199 fil_system->max_n_open = max_n_open;
@@ -202,7 +202,7 @@
202 }202 }
203 203
204 /*******************************************************************//**204 /*******************************************************************//**
205@@ -1619,7 +1622,7 @@205@@ -1621,7 +1624,7 @@
206 space = UT_LIST_GET_FIRST(fil_system->space_list);206 space = UT_LIST_GET_FIRST(fil_system->space_list);
207 207
208 while (space != NULL) {208 while (space != NULL) {
@@ -211,7 +211,7 @@
211 node = UT_LIST_GET_FIRST(space->chain);211 node = UT_LIST_GET_FIRST(space->chain);
212 212
213 while (node != NULL) {213 while (node != NULL) {
214@@ -1709,6 +1712,10 @@214@@ -1711,6 +1714,10 @@
215 ut_error;215 ut_error;
216 }216 }
217 217
@@ -222,7 +222,7 @@
222 mutex_enter(&fil_system->mutex);222 mutex_enter(&fil_system->mutex);
223 223
224 if (fil_system->max_assigned_id < max_id) {224 if (fil_system->max_assigned_id < max_id) {
225@@ -1727,6 +1734,7 @@225@@ -1729,6 +1736,7 @@
226 ulint226 ulint
227 fil_write_lsn_and_arch_no_to_file(227 fil_write_lsn_and_arch_no_to_file(
228 /*==============================*/228 /*==============================*/
@@ -230,7 +230,7 @@
230 ulint sum_of_sizes, /*!< in: combined size of previous files230 ulint sum_of_sizes, /*!< in: combined size of previous files
231 in space, in database pages */231 in space, in database pages */
232 ib_uint64_t lsn, /*!< in: lsn to write */232 ib_uint64_t lsn, /*!< in: lsn to write */
233@@ -1736,14 +1744,16 @@233@@ -1738,14 +1746,16 @@
234 byte* buf1;234 byte* buf1;
235 byte* buf;235 byte* buf;
236 236
@@ -249,7 +249,7 @@
249 249
250 mem_free(buf1);250 mem_free(buf1);
251 251
252@@ -1779,7 +1789,7 @@252@@ -1781,7 +1791,7 @@
253 always open. */253 always open. */
254 254
255 if (space->purpose == FIL_TABLESPACE255 if (space->purpose == FIL_TABLESPACE
@@ -258,7 +258,7 @@
258 sum_of_sizes = 0;258 sum_of_sizes = 0;
259 259
260 node = UT_LIST_GET_FIRST(space->chain);260 node = UT_LIST_GET_FIRST(space->chain);
261@@ -1787,7 +1797,7 @@261@@ -1789,7 +1799,7 @@
262 mutex_exit(&fil_system->mutex);262 mutex_exit(&fil_system->mutex);
263 263
264 err = fil_write_lsn_and_arch_no_to_file(264 err = fil_write_lsn_and_arch_no_to_file(
@@ -267,7 +267,7 @@
267 if (err != DB_SUCCESS) {267 if (err != DB_SUCCESS) {
268 268
269 return(err);269 return(err);
270@@ -3834,7 +3844,7 @@270@@ -4158,7 +4168,7 @@
271 }271 }
272 272
273 #ifndef UNIV_HOTBACKUP273 #ifndef UNIV_HOTBACKUP
@@ -276,7 +276,7 @@
276 fprintf(stderr,276 fprintf(stderr,
277 "InnoDB: Error: tablespace id %lu in file %s"277 "InnoDB: Error: tablespace id %lu in file %s"
278 " is not sensible\n",278 " is not sensible\n",
279@@ -3843,7 +3853,7 @@279@@ -4167,7 +4177,7 @@
280 goto func_exit;280 goto func_exit;
281 }281 }
282 #else282 #else
@@ -285,7 +285,7 @@
285 char* new_path;285 char* new_path;
286 286
287 fprintf(stderr,287 fprintf(stderr,
288@@ -4664,7 +4674,7 @@288@@ -4988,7 +4998,7 @@
289 }289 }
290 290
291 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE291 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
@@ -294,7 +294,7 @@
294 /* The node is in the LRU list, remove it */294 /* The node is in the LRU list, remove it */
295 295
296 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);296 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);
297@@ -4710,7 +4720,7 @@297@@ -5034,7 +5044,7 @@
298 }298 }
299 299
300 if (node->n_pending == 0 && node->space->purpose == FIL_TABLESPACE300 if (node->n_pending == 0 && node->space->purpose == FIL_TABLESPACE
@@ -303,7 +303,7 @@
303 /* The node must be put back to the LRU list */303 /* The node must be put back to the LRU list */
304 UT_LIST_ADD_FIRST(LRU, system->LRU, node);304 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
305 }305 }
306@@ -5316,7 +5326,7 @@306@@ -5644,7 +5654,7 @@
307 ut_a(fil_node->n_pending == 0);307 ut_a(fil_node->n_pending == 0);
308 ut_a(fil_node->open);308 ut_a(fil_node->open);
309 ut_a(fil_node->space->purpose == FIL_TABLESPACE);309 ut_a(fil_node->space->purpose == FIL_TABLESPACE);
@@ -348,7 +348,7 @@
348 348
349 /* The highest file format being used in the database. The value can be349 /* The highest file format being used in the database. The value can be
350 set by user, however, it will be adjusted to the newer file format if350 set by user, however, it will be adjusted to the newer file format if
351@@ -2458,6 +2459,8 @@351@@ -2472,6 +2473,8 @@
352 goto error;352 goto error;
353 }353 }
354 354
@@ -357,7 +357,7 @@
357 srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table;357 srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table;
358 358
359 /* -------------- Log files ---------------------------*/359 /* -------------- Log files ---------------------------*/
360@@ -11634,6 +11637,11 @@360@@ -11641,6 +11644,11 @@
361 "Path to individual files and their sizes.",361 "Path to individual files and their sizes.",
362 NULL, NULL, NULL);362 NULL, NULL, NULL);
363 363
@@ -369,7 +369,7 @@
369 static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,369 static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
370 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,370 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
371 "The AUTOINC lock modes supported by InnoDB: "371 "The AUTOINC lock modes supported by InnoDB: "
372@@ -11801,6 +11809,7 @@372@@ -11808,6 +11816,7 @@
373 MYSQL_SYSVAR(commit_concurrency),373 MYSQL_SYSVAR(commit_concurrency),
374 MYSQL_SYSVAR(concurrency_tickets),374 MYSQL_SYSVAR(concurrency_tickets),
375 MYSQL_SYSVAR(data_file_path),375 MYSQL_SYSVAR(data_file_path),
@@ -403,7 +403,7 @@
403diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h403diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
404--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:35:29.177480351 +0900404--- a/storage/innobase/include/srv0srv.h 2010-12-04 15:35:29.177480351 +0900
405+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:35:58.646556250 +0900405+++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:35:58.646556250 +0900
406@@ -132,6 +132,8 @@406@@ -129,6 +129,8 @@
407 extern ulint* srv_data_file_sizes;407 extern ulint* srv_data_file_sizes;
408 extern ulint* srv_data_file_is_raw_partition;408 extern ulint* srv_data_file_is_raw_partition;
409 409
@@ -519,7 +519,7 @@
519diff -ruN a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c519diff -ruN a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
520--- a/storage/innobase/row/row0mysql.c 2010-12-03 17:30:16.334989510 +0900520--- a/storage/innobase/row/row0mysql.c 2010-12-03 17:30:16.334989510 +0900
521+++ b/storage/innobase/row/row0mysql.c 2010-12-04 15:35:58.652496484 +0900521+++ b/storage/innobase/row/row0mysql.c 2010-12-04 15:35:58.652496484 +0900
522@@ -3449,7 +3449,7 @@522@@ -3447,7 +3447,7 @@
523 /* Do not drop possible .ibd tablespace if something went523 /* Do not drop possible .ibd tablespace if something went
524 wrong: we do not want to delete valuable data of the user */524 wrong: we do not want to delete valuable data of the user */
525 525
@@ -531,7 +531,7 @@
531diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c531diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
532--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:35:29.180483212 +0900532--- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:35:29.180483212 +0900
533+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:35:58.656550107 +0900533+++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:35:58.656550107 +0900
534@@ -169,6 +169,8 @@534@@ -163,6 +163,8 @@
535 /* size in database pages */535 /* size in database pages */
536 UNIV_INTERN ulint* srv_data_file_sizes = NULL;536 UNIV_INTERN ulint* srv_data_file_sizes = NULL;
537 537
@@ -768,7 +768,7 @@
768diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c768diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
769--- a/storage/innobase/trx/trx0sys.c 2010-12-03 17:32:15.651024019 +0900769--- a/storage/innobase/trx/trx0sys.c 2010-12-03 17:32:15.651024019 +0900
770+++ b/storage/innobase/trx/trx0sys.c 2010-12-04 15:35:58.664550291 +0900770+++ b/storage/innobase/trx/trx0sys.c 2010-12-04 15:35:58.664550291 +0900
771@@ -414,6 +414,152 @@771@@ -415,6 +415,152 @@
772 772
773 goto start_again;773 goto start_again;
774 }774 }
@@ -921,7 +921,7 @@
921 }921 }
922 922
923 /****************************************************************//**923 /****************************************************************//**
924@@ -437,10 +583,19 @@924@@ -438,10 +584,19 @@
925 ulint source_page_no;925 ulint source_page_no;
926 byte* page;926 byte* page;
927 byte* doublewrite;927 byte* doublewrite;
@@ -941,7 +941,7 @@
941 /* We do the file i/o past the buffer pool */941 /* We do the file i/o past the buffer pool */
942 942
943 unaligned_read_buf = ut_malloc(2 * UNIV_PAGE_SIZE);943 unaligned_read_buf = ut_malloc(2 * UNIV_PAGE_SIZE);
944@@ -449,7 +604,7 @@944@@ -450,7 +605,7 @@
945 /* Read the trx sys header to check if we are using the doublewrite945 /* Read the trx sys header to check if we are using the doublewrite
946 buffer */946 buffer */
947 947
@@ -950,7 +950,7 @@
950 UNIV_PAGE_SIZE, read_buf, NULL);950 UNIV_PAGE_SIZE, read_buf, NULL);
951 doublewrite = read_buf + TRX_SYS_DOUBLEWRITE;951 doublewrite = read_buf + TRX_SYS_DOUBLEWRITE;
952 952
953@@ -487,10 +642,10 @@953@@ -488,10 +643,10 @@
954 954
955 /* Read the pages from the doublewrite buffer to memory */955 /* Read the pages from the doublewrite buffer to memory */
956 956
@@ -963,7 +963,7 @@
963 TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE,963 TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE,
964 buf + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE,964 buf + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE,
965 NULL);965 NULL);
966@@ -546,7 +701,8 @@966@@ -547,7 +702,8 @@
967 " doublewrite buf.\n",967 " doublewrite buf.\n",
968 (ulong) space_id, (ulong) page_no, (ulong) i);968 (ulong) space_id, (ulong) page_no, (ulong) i);
969 969
@@ -973,7 +973,7 @@
973 && ((page_no >= block1973 && ((page_no >= block1
974 && page_no974 && page_no
975 < block1 + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)975 < block1 + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)
976@@ -1015,6 +1171,83 @@976@@ -1016,6 +1172,83 @@
977 }977 }
978 978
979 /*****************************************************************//**979 /*****************************************************************//**
@@ -1057,7 +1057,7 @@
1057 Creates and initializes the central memory structures for the transaction1057 Creates and initializes the central memory structures for the transaction
1058 system. This is called when the database is started. */1058 system. This is called when the database is started. */
1059 UNIV_INTERN1059 UNIV_INTERN
1060@@ -1386,6 +1619,26 @@1060@@ -1387,6 +1620,26 @@
1061 /* Does nothing at the moment */1061 /* Does nothing at the moment */
1062 }1062 }
1063 1063
10641064
=== modified file 'innodb_show_lock_name.patch'
--- innodb_show_lock_name.patch 2011-05-10 11:57:42 +0000
+++ innodb_show_lock_name.patch 2011-06-20 09:04:39 +0000
@@ -8,7 +8,7 @@
8diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc8diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
9--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:34:35.285040381 +09009--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:34:35.285040381 +0900
10+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:35:12.974975252 +090010+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:35:12.974975252 +0900
11@@ -9588,9 +9588,8 @@11@@ -9593,9 +9593,8 @@
12 rw_lock_wait_time += mutex->lspent_time;12 rw_lock_wait_time += mutex->lspent_time;
13 }13 }
14 #else /* UNIV_DEBUG */14 #else /* UNIV_DEBUG */
@@ -20,7 +20,7 @@
20 buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",20 buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
21 (ulong) mutex->count_os_wait);21 (ulong) mutex->count_os_wait);
22 22
23@@ -9605,10 +9604,8 @@23@@ -9610,10 +9609,8 @@
24 24
25 if (block_mutex) {25 if (block_mutex) {
26 buf1len = (uint) my_snprintf(buf1, sizeof buf1,26 buf1len = (uint) my_snprintf(buf1, sizeof buf1,
@@ -33,7 +33,7 @@
33 buf2len = (uint) my_snprintf(buf2, sizeof buf2,33 buf2len = (uint) my_snprintf(buf2, sizeof buf2,
34 "os_waits=%lu",34 "os_waits=%lu",
35 (ulong) block_mutex_oswait_count);35 (ulong) block_mutex_oswait_count);
36@@ -9637,9 +9634,8 @@36@@ -9642,9 +9639,8 @@
37 continue;37 continue;
38 }38 }
39 39
@@ -45,7 +45,7 @@
45 buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu",45 buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu",
46 (ulong) lock->count_os_wait);46 (ulong) lock->count_os_wait);
47 47
48@@ -9653,10 +9649,8 @@48@@ -9658,10 +9654,8 @@
49 49
50 if (block_lock) {50 if (block_lock) {
51 buf1len = (uint) my_snprintf(buf1, sizeof buf1,51 buf1len = (uint) my_snprintf(buf1, sizeof buf1,
@@ -248,7 +248,7 @@
248 /******************************************************************//**248 /******************************************************************//**
249 NOTE! Please use the corresponding macro mutex_enter(), not directly249 NOTE! Please use the corresponding macro mutex_enter(), not directly
250 this function!250 this function!
251@@ -722,9 +722,9 @@251@@ -731,9 +731,9 @@
252 ulint line; /*!< Line where the mutex was locked */252 ulint line; /*!< Line where the mutex was locked */
253 ulint level; /*!< Level in the global latching order */253 ulint level; /*!< Level in the global latching order */
254 #endif /* UNIV_SYNC_DEBUG */254 #endif /* UNIV_SYNC_DEBUG */
@@ -259,7 +259,7 @@
259 os_thread_id_t thread_id; /*!< The thread id of the thread259 os_thread_id_t thread_id; /*!< The thread id of the thread
260 which locked the mutex. */260 which locked the mutex. */
261 ulint magic_n; /*!< MUTEX_MAGIC_N */261 ulint magic_n; /*!< MUTEX_MAGIC_N */
262@@ -739,9 +739,9 @@262@@ -748,9 +748,9 @@
263 ulong count_os_yield; /*!< count of os_wait */263 ulong count_os_yield; /*!< count of os_wait */
264 ulonglong lspent_time; /*!< mutex os_wait timer msec */264 ulonglong lspent_time; /*!< mutex os_wait timer msec */
265 ulonglong lmax_spent_time;/*!< mutex os_wait timer msec */265 ulonglong lmax_spent_time;/*!< mutex os_wait timer msec */
266266
=== modified file 'innodb_show_status.patch'
--- innodb_show_status.patch 2011-05-10 11:57:42 +0000
+++ innodb_show_status.patch 2011-06-20 09:04:39 +0000
@@ -62,7 +62,7 @@
62diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c62diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
63--- a/storage/innobase/fil/fil0fil.c 2010-11-03 07:01:13.000000000 +090063--- a/storage/innobase/fil/fil0fil.c 2010-11-03 07:01:13.000000000 +0900
64+++ b/storage/innobase/fil/fil0fil.c 2010-12-03 15:07:31.790357112 +090064+++ b/storage/innobase/fil/fil0fil.c 2010-12-03 15:07:31.790357112 +0900
65@@ -4884,3 +4884,30 @@65@@ -4888,3 +4888,30 @@
66 66
67 fil_system = NULL;67 fil_system = NULL;
68 }68 }
@@ -105,7 +105,7 @@
105 {"buffer_pool_pages_free",105 {"buffer_pool_pages_free",
106 (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG},106 (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG},
107 #ifdef UNIV_DEBUG107 #ifdef UNIV_DEBUG
108@@ -11074,6 +11076,16 @@108@@ -11081,6 +11083,16 @@
109 "Force InnoDB to not use next-key locking, to use only row-level locking.",109 "Force InnoDB to not use next-key locking, to use only row-level locking.",
110 NULL, NULL, FALSE);110 NULL, NULL, FALSE);
111 111
@@ -122,7 +122,7 @@
122 #ifdef UNIV_LOG_ARCHIVE122 #ifdef UNIV_LOG_ARCHIVE
123 static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,123 static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,
124 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,124 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
125@@ -11261,7 +11273,7 @@125@@ -11268,7 +11280,7 @@
126 126
127 static MYSQL_SYSVAR_STR(version, innodb_version_str,127 static MYSQL_SYSVAR_STR(version, innodb_version_str,
128 PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,128 PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
@@ -131,7 +131,7 @@
131 131
132 static MYSQL_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,132 static MYSQL_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,
133 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,133 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
134@@ -11354,6 +11366,8 @@134@@ -11361,6 +11373,8 @@
135 MYSQL_SYSVAR(thread_concurrency),135 MYSQL_SYSVAR(thread_concurrency),
136 MYSQL_SYSVAR(thread_sleep_delay),136 MYSQL_SYSVAR(thread_sleep_delay),
137 MYSQL_SYSVAR(autoinc_lock_mode),137 MYSQL_SYSVAR(autoinc_lock_mode),
@@ -186,7 +186,7 @@
186diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h186diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
187--- a/storage/innobase/include/srv0srv.h 2010-11-03 07:01:13.000000000 +0900187--- a/storage/innobase/include/srv0srv.h 2010-11-03 07:01:13.000000000 +0900
188+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:07:31.813958103 +0900188+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:07:31.813958103 +0900
189@@ -145,6 +145,9 @@189@@ -142,6 +142,9 @@
190 extern char srv_adaptive_flushing;190 extern char srv_adaptive_flushing;
191 191
192 192
@@ -196,7 +196,7 @@
196 /* The sort order table of the MySQL latin1_swedish_ci character set196 /* The sort order table of the MySQL latin1_swedish_ci character set
197 collation */197 collation */
198 extern const byte* srv_latin1_ordering;198 extern const byte* srv_latin1_ordering;
199@@ -326,6 +329,8 @@199@@ -323,6 +326,8 @@
200 buffer pool to disk */200 buffer pool to disk */
201 extern ulint srv_buf_pool_flushed;201 extern ulint srv_buf_pool_flushed;
202 202
@@ -205,7 +205,7 @@
205 /** Number of buffer pool reads that led to the205 /** Number of buffer pool reads that led to the
206 reading of a disk page */206 reading of a disk page */
207 extern ulint srv_buf_pool_reads;207 extern ulint srv_buf_pool_reads;
208@@ -705,6 +710,7 @@208@@ -702,6 +707,7 @@
209 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */209 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */
210 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */210 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
211 ulint innodb_buffer_pool_pages_flushed; /*!< srv_buf_pool_flushed */211 ulint innodb_buffer_pool_pages_flushed; /*!< srv_buf_pool_flushed */
@@ -309,7 +309,7 @@
309 #include "mysql/plugin.h"309 #include "mysql/plugin.h"
310 #include "mysql/service_thd_wait.h"310 #include "mysql/service_thd_wait.h"
311 311
312@@ -194,6 +195,9 @@312@@ -188,6 +189,9 @@
313 the checkpoints. */313 the checkpoints. */
314 UNIV_INTERN char srv_adaptive_flushing = TRUE;314 UNIV_INTERN char srv_adaptive_flushing = TRUE;
315 315
@@ -319,7 +319,7 @@
319 /** Maximum number of times allowed to conditionally acquire319 /** Maximum number of times allowed to conditionally acquire
320 mutex before switching to blocking wait on the mutex */320 mutex before switching to blocking wait on the mutex */
321 #define MAX_MUTEX_NOWAIT 20321 #define MAX_MUTEX_NOWAIT 20
322@@ -320,6 +324,7 @@322@@ -314,6 +318,7 @@
323 /* variable to count the number of pages that were written from buffer323 /* variable to count the number of pages that were written from buffer
324 pool to the disk */324 pool to the disk */
325 UNIV_INTERN ulint srv_buf_pool_flushed = 0;325 UNIV_INTERN ulint srv_buf_pool_flushed = 0;
@@ -327,7 +327,7 @@
327 327
328 /** Number of buffer pool reads that led to the328 /** Number of buffer pool reads that led to the
329 reading of a disk page */329 reading of a disk page */
330@@ -1814,6 +1819,13 @@330@@ -1823,6 +1828,13 @@
331 ulint n_reserved;331 ulint n_reserved;
332 ibool ret;332 ibool ret;
333 333
@@ -341,7 +341,7 @@
341 mutex_enter(&srv_innodb_monitor_mutex);341 mutex_enter(&srv_innodb_monitor_mutex);
342 342
343 current_time = time(NULL);343 current_time = time(NULL);
344@@ -1862,31 +1874,6 @@344@@ -1871,31 +1883,6 @@
345 345
346 mutex_exit(&dict_foreign_err_mutex);346 mutex_exit(&dict_foreign_err_mutex);
347 347
@@ -373,7 +373,7 @@
373 fputs("--------\n"373 fputs("--------\n"
374 "FILE I/O\n"374 "FILE I/O\n"
375 "--------\n", file);375 "--------\n", file);
376@@ -1917,10 +1904,78 @@376@@ -1926,10 +1913,78 @@
377 "BUFFER POOL AND MEMORY\n"377 "BUFFER POOL AND MEMORY\n"
378 "----------------------\n", file);378 "----------------------\n", file);
379 fprintf(file,379 fprintf(file,
@@ -456,7 +456,7 @@
456 fprintf(file, "Dictionary memory allocated " ULINTPF "\n",456 fprintf(file, "Dictionary memory allocated " ULINTPF "\n",
457 dict_sys->size);457 dict_sys->size);
458 458
459@@ -1936,6 +1991,16 @@459@@ -1945,6 +2000,16 @@
460 fprintf(file, "%lu read views open inside InnoDB\n",460 fprintf(file, "%lu read views open inside InnoDB\n",
461 UT_LIST_GET_LEN(trx_sys->view_list));461 UT_LIST_GET_LEN(trx_sys->view_list));
462 462
@@ -473,7 +473,7 @@
473 n_reserved = fil_space_get_n_reserved_extents(0);473 n_reserved = fil_space_get_n_reserved_extents(0);
474 if (n_reserved > 0) {474 if (n_reserved > 0) {
475 fprintf(file,475 fprintf(file,
476@@ -1979,6 +2044,31 @@476@@ -1988,6 +2053,31 @@
477 srv_n_rows_deleted_old = srv_n_rows_deleted;477 srv_n_rows_deleted_old = srv_n_rows_deleted;
478 srv_n_rows_read_old = srv_n_rows_read;478 srv_n_rows_read_old = srv_n_rows_read;
479 479
@@ -505,7 +505,7 @@
505 fputs("----------------------------\n"505 fputs("----------------------------\n"
506 "END OF INNODB MONITOR OUTPUT\n"506 "END OF INNODB MONITOR OUTPUT\n"
507 "============================\n", file);507 "============================\n", file);
508@@ -2022,6 +2112,7 @@508@@ -2031,6 +2121,7 @@
509 = srv_buf_pool_write_requests;509 = srv_buf_pool_write_requests;
510 export_vars.innodb_buffer_pool_wait_free = srv_buf_pool_wait_free;510 export_vars.innodb_buffer_pool_wait_free = srv_buf_pool_wait_free;
511 export_vars.innodb_buffer_pool_pages_flushed = srv_buf_pool_flushed;511 export_vars.innodb_buffer_pool_pages_flushed = srv_buf_pool_flushed;
512512
=== modified file 'innodb_show_status_extend.patch'
--- innodb_show_status_extend.patch 2011-05-10 11:57:42 +0000
+++ innodb_show_status_extend.patch 2011-06-20 09:04:39 +0000
@@ -245,7 +245,7 @@
245diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h245diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
246--- a/storage/innobase/include/srv0srv.h 2011-01-21 19:53:42.380638228 +0900246--- a/storage/innobase/include/srv0srv.h 2011-01-21 19:53:42.380638228 +0900
247+++ b/storage/innobase/include/srv0srv.h 2011-01-21 19:54:44.662600032 +0900247+++ b/storage/innobase/include/srv0srv.h 2011-01-21 19:54:44.662600032 +0900
248@@ -738,6 +738,11 @@248@@ -735,6 +735,11 @@
249 249
250 /** Status variables to be passed to MySQL */250 /** Status variables to be passed to MySQL */
251 struct export_var_struct{251 struct export_var_struct{
@@ -257,7 +257,7 @@
257 ulint innodb_data_pending_reads; /*!< Pending reads */257 ulint innodb_data_pending_reads; /*!< Pending reads */
258 ulint innodb_data_pending_writes; /*!< Pending writes */258 ulint innodb_data_pending_writes; /*!< Pending writes */
259 ulint innodb_data_pending_fsyncs; /*!< Pending fsyncs */259 ulint innodb_data_pending_fsyncs; /*!< Pending fsyncs */
260@@ -755,6 +760,9 @@260@@ -752,6 +757,9 @@
261 #ifdef UNIV_DEBUG261 #ifdef UNIV_DEBUG
262 ulint innodb_buffer_pool_pages_latched; /*!< Latched pages */262 ulint innodb_buffer_pool_pages_latched; /*!< Latched pages */
263 #endif /* UNIV_DEBUG */263 #endif /* UNIV_DEBUG */
@@ -267,7 +267,7 @@
267 ulint innodb_buffer_pool_read_requests; /*!< buf_pool->stat.n_page_gets */267 ulint innodb_buffer_pool_read_requests; /*!< buf_pool->stat.n_page_gets */
268 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */268 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */
269 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */269 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
270@@ -763,13 +771,43 @@270@@ -760,13 +768,43 @@
271 ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */271 ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */
272 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */272 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
273 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/273 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
@@ -311,7 +311,7 @@
311 ulint innodb_os_log_written; /*!< srv_os_log_written */311 ulint innodb_os_log_written; /*!< srv_os_log_written */
312 ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */312 ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */
313 ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */313 ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */
314@@ -778,6 +816,8 @@314@@ -775,6 +813,8 @@
315 ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */315 ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */
316 ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read */316 ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read */
317 ulint innodb_pages_written; /*!< buf_pool->stat.n_pages_written */317 ulint innodb_pages_written; /*!< buf_pool->stat.n_pages_written */
@@ -320,7 +320,7 @@
320 ulint innodb_row_lock_waits; /*!< srv_n_lock_wait_count */320 ulint innodb_row_lock_waits; /*!< srv_n_lock_wait_count */
321 ulint innodb_row_lock_current_waits; /*!< srv_n_lock_wait_current_count */321 ulint innodb_row_lock_current_waits; /*!< srv_n_lock_wait_current_count */
322 ib_int64_t innodb_row_lock_time; /*!< srv_n_lock_wait_time322 ib_int64_t innodb_row_lock_time; /*!< srv_n_lock_wait_time
323@@ -787,11 +827,18 @@323@@ -784,11 +824,18 @@
324 / srv_n_lock_wait_count */324 / srv_n_lock_wait_count */
325 ulint innodb_row_lock_time_max; /*!< srv_n_lock_max_wait_time325 ulint innodb_row_lock_time_max; /*!< srv_n_lock_max_wait_time
326 / 1000 */326 / 1000 */
@@ -342,7 +342,7 @@
342diff -ruN a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h342diff -ruN a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
343--- a/storage/innobase/include/sync0sync.h 2011-01-21 19:48:45.982637372 +0900343--- a/storage/innobase/include/sync0sync.h 2011-01-21 19:48:45.982637372 +0900
344+++ b/storage/innobase/include/sync0sync.h 2011-01-21 19:54:44.664638235 +0900344+++ b/storage/innobase/include/sync0sync.h 2011-01-21 19:54:44.664638235 +0900
345@@ -760,6 +760,10 @@345@@ -769,6 +769,10 @@
346 346
347 #define SYNC_SPIN_ROUNDS srv_n_spin_wait_rounds347 #define SYNC_SPIN_ROUNDS srv_n_spin_wait_rounds
348 348
@@ -391,7 +391,7 @@
391diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c391diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
392--- a/storage/innobase/srv/srv0srv.c 2011-01-21 19:53:42.390637840 +0900392--- a/storage/innobase/srv/srv0srv.c 2011-01-21 19:53:42.390637840 +0900
393+++ b/storage/innobase/srv/srv0srv.c 2011-01-21 19:54:44.673637084 +0900393+++ b/storage/innobase/srv/srv0srv.c 2011-01-21 19:54:44.673637084 +0900
394@@ -2248,12 +2248,49 @@394@@ -2258,12 +2258,49 @@
395 ulint LRU_len;395 ulint LRU_len;
396 ulint free_len;396 ulint free_len;
397 ulint flush_list_len;397 ulint flush_list_len;
@@ -441,7 +441,7 @@
441 export_vars.innodb_data_pending_reads441 export_vars.innodb_data_pending_reads
442 = os_n_pending_reads;442 = os_n_pending_reads;
443 export_vars.innodb_data_pending_writes443 export_vars.innodb_data_pending_writes
444@@ -2290,6 +2327,92 @@444@@ -2300,6 +2337,92 @@
445 445
446 export_vars.innodb_buffer_pool_pages_misc446 export_vars.innodb_buffer_pool_pages_misc
447 = buf_pool_get_n_pages() - LRU_len - free_len;447 = buf_pool_get_n_pages() - LRU_len - free_len;
448448
=== modified file 'innodb_show_sys_tables.patch'
--- innodb_show_sys_tables.patch 2011-05-23 03:13:18 +0000
+++ innodb_show_sys_tables.patch 2011-06-20 09:04:39 +0000
@@ -41,7 +41,7 @@
41diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc41diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
42--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:53:54.615040167 +090042--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:53:54.615040167 +0900
43+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 16:07:26.851357007 +090043+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 16:07:26.851357007 +0900
44@@ -11765,7 +11765,14 @@44@@ -11772,7 +11772,14 @@
45 i_s_innodb_cmp,45 i_s_innodb_cmp,
46 i_s_innodb_cmp_reset,46 i_s_innodb_cmp_reset,
47 i_s_innodb_cmpmem,47 i_s_innodb_cmpmem,
4848
=== modified file 'innodb_split_buf_pool_mutex.patch'
--- innodb_split_buf_pool_mutex.patch 2011-05-10 11:57:42 +0000
+++ innodb_split_buf_pool_mutex.patch 2011-06-20 09:04:39 +0000
@@ -2282,7 +2282,7 @@
2282 return(count);2282 return(count);
2283 }2283 }
2284@@ -1722,13 +1754,15 @@2284@@ -1722,13 +1754,15 @@
2285 || sync_thread_levels_empty_gen(TRUE));2285 || sync_thread_levels_empty_except_dict());
2286 #endif /* UNIV_SYNC_DEBUG */2286 #endif /* UNIV_SYNC_DEBUG */
2287 2287
2288- buf_pool_mutex_enter(buf_pool);2288- buf_pool_mutex_enter(buf_pool);
@@ -3033,8 +3033,19 @@
3033 b->state = b->oldest_modification3033 b->state = b->oldest_modification
3034 ? BUF_BLOCK_ZIP_DIRTY3034 ? BUF_BLOCK_ZIP_DIRTY
3035 : BUF_BLOCK_ZIP_PAGE;3035 : BUF_BLOCK_ZIP_PAGE;
3036@@ -1614,7 +1748,9 @@3036@@ -1597,6 +1731,7 @@
3037 buf_LRU_add_block_low(b, buf_page_is_old(b));
3038 }
3039
3040+ mutex_enter(&buf_pool->zip_mutex);
3041 if (b->state == BUF_BLOCK_ZIP_PAGE) {
3042 buf_LRU_insert_zip_clean(b);
3043 } else {
3044@@ -1612,9 +1747,12 @@
3045 buf_pool->mutex and block_mutex. */
3046 b->buf_fix_count++;
3037 b->io_fix = BUF_IO_READ;3047 b->io_fix = BUF_IO_READ;
3048+ mutex_exit(&buf_pool->zip_mutex);
3038 }3049 }
3039 3050
3040- buf_pool_mutex_exit(buf_pool);3051- buf_pool_mutex_exit(buf_pool);
@@ -3044,7 +3055,7 @@
3044 mutex_exit(block_mutex);3055 mutex_exit(block_mutex);
3045 3056
3046 /* Remove possible adaptive hash index on the page.3057 /* Remove possible adaptive hash index on the page.
3047@@ -1646,7 +1782,9 @@3058@@ -1646,7 +1784,9 @@
3048 : BUF_NO_CHECKSUM_MAGIC);3059 : BUF_NO_CHECKSUM_MAGIC);
3049 }3060 }
3050 3061
@@ -3055,7 +3066,7 @@
3055 mutex_enter(block_mutex);3066 mutex_enter(block_mutex);
3056 3067
3057 if (b) {3068 if (b) {
3058@@ -1656,13 +1794,17 @@3069@@ -1656,13 +1796,17 @@
3059 mutex_exit(&buf_pool->zip_mutex);3070 mutex_exit(&buf_pool->zip_mutex);
3060 }3071 }
3061 3072
@@ -3074,7 +3085,7 @@
3074 }3085 }
3075 3086
3076 return(BUF_LRU_FREED);3087 return(BUF_LRU_FREED);
3077@@ -1674,13 +1816,14 @@3088@@ -1674,13 +1818,14 @@
3078 void3089 void
3079 buf_LRU_block_free_non_file_page(3090 buf_LRU_block_free_non_file_page(
3080 /*=============================*/3091 /*=============================*/
@@ -3091,7 +3102,7 @@
3091 ut_ad(mutex_own(&block->mutex));3102 ut_ad(mutex_own(&block->mutex));
3092 3103
3093 switch (buf_block_get_state(block)) {3104 switch (buf_block_get_state(block)) {
3094@@ -1714,18 +1857,21 @@3105@@ -1714,18 +1859,21 @@
3095 if (data) {3106 if (data) {
3096 block->page.zip.data = NULL;3107 block->page.zip.data = NULL;
3097 mutex_exit(&block->mutex);3108 mutex_exit(&block->mutex);
@@ -3117,7 +3128,7 @@
3117 3128
3118 UNIV_MEM_ASSERT_AND_FREE(block->frame, UNIV_PAGE_SIZE);3129 UNIV_MEM_ASSERT_AND_FREE(block->frame, UNIV_PAGE_SIZE);
3119 }3130 }
3120@@ -1755,7 +1901,11 @@3131@@ -1755,7 +1903,11 @@
3121 buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);3132 buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
3122 3133
3123 ut_ad(bpage);3134 ut_ad(bpage);
@@ -3130,7 +3141,7 @@
3130 ut_ad(mutex_own(buf_page_get_mutex(bpage)));3141 ut_ad(mutex_own(buf_page_get_mutex(bpage)));
3131 3142
3132 ut_a(buf_page_get_io_fix(bpage) == BUF_IO_NONE);3143 ut_a(buf_page_get_io_fix(bpage) == BUF_IO_NONE);
3133@@ -1863,7 +2013,9 @@3144@@ -1863,7 +2015,9 @@
3134 3145
3135 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG3146 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3136 mutex_exit(buf_page_get_mutex(bpage));3147 mutex_exit(buf_page_get_mutex(bpage));
@@ -3141,7 +3152,7 @@
3141 buf_print();3152 buf_print();
3142 buf_LRU_print();3153 buf_LRU_print();
3143 buf_validate();3154 buf_validate();
3144@@ -1884,18 +2036,18 @@3155@@ -1884,18 +2038,18 @@
3145 ut_a(bpage->zip.data);3156 ut_a(bpage->zip.data);
3146 ut_a(buf_page_get_zip_size(bpage));3157 ut_a(buf_page_get_zip_size(bpage));
3147 3158
@@ -3165,7 +3176,7 @@
3165 3176
3166 UNIV_MEM_UNDESC(bpage);3177 UNIV_MEM_UNDESC(bpage);
3167 return(BUF_BLOCK_ZIP_FREE);3178 return(BUF_BLOCK_ZIP_FREE);
3168@@ -1918,13 +2070,13 @@3179@@ -1918,13 +2072,13 @@
3169 ut_ad(!bpage->in_flush_list);3180 ut_ad(!bpage->in_flush_list);
3170 ut_ad(!bpage->in_LRU_list);3181 ut_ad(!bpage->in_LRU_list);
3171 mutex_exit(&((buf_block_t*) bpage)->mutex);3182 mutex_exit(&((buf_block_t*) bpage)->mutex);
@@ -3182,7 +3193,7 @@
3182 mutex_enter(&((buf_block_t*) bpage)->mutex);3193 mutex_enter(&((buf_block_t*) bpage)->mutex);
3183 page_zip_set_size(&bpage->zip, 0);3194 page_zip_set_size(&bpage->zip, 0);
3184 }3195 }
3185@@ -1950,18 +2102,19 @@3196@@ -1950,18 +2104,19 @@
3186 void3197 void
3187 buf_LRU_block_free_hashed_page(3198 buf_LRU_block_free_hashed_page(
3188 /*===========================*/3199 /*===========================*/
@@ -3206,7 +3217,7 @@
3206 }3217 }
3207 3218
3208 /**********************************************************************//**3219 /**********************************************************************//**
3209@@ -1988,7 +2141,8 @@3220@@ -1988,7 +2143,8 @@
3210 }3221 }
3211 3222
3212 if (adjust) {3223 if (adjust) {
@@ -3216,7 +3227,7 @@
3216 3227
3217 if (ratio != buf_pool->LRU_old_ratio) {3228 if (ratio != buf_pool->LRU_old_ratio) {
3218 buf_pool->LRU_old_ratio = ratio;3229 buf_pool->LRU_old_ratio = ratio;
3219@@ -2000,7 +2154,8 @@3230@@ -2000,7 +2156,8 @@
3220 }3231 }
3221 }3232 }
3222 3233
@@ -3226,7 +3237,7 @@
3226 } else {3237 } else {
3227 buf_pool->LRU_old_ratio = ratio;3238 buf_pool->LRU_old_ratio = ratio;
3228 }3239 }
3229@@ -2105,7 +2260,8 @@3240@@ -2105,7 +2262,8 @@
3230 ulint new_len;3241 ulint new_len;
3231 3242
3232 ut_ad(buf_pool);3243 ut_ad(buf_pool);
@@ -3236,7 +3247,7 @@
3236 3247
3237 if (UT_LIST_GET_LEN(buf_pool->LRU) >= BUF_LRU_OLD_MIN_LEN) {3248 if (UT_LIST_GET_LEN(buf_pool->LRU) >= BUF_LRU_OLD_MIN_LEN) {
3238 3249
3239@@ -2166,16 +2322,22 @@3250@@ -2166,16 +2324,22 @@
3240 3251
3241 ut_a(buf_pool->LRU_old_len == old_len);3252 ut_a(buf_pool->LRU_old_len == old_len);
3242 3253
@@ -3261,7 +3272,7 @@
3261 UT_LIST_VALIDATE(unzip_LRU, buf_block_t, buf_pool->unzip_LRU,3272 UT_LIST_VALIDATE(unzip_LRU, buf_block_t, buf_pool->unzip_LRU,
3262 ut_ad(ut_list_node_313->in_unzip_LRU_list3273 ut_ad(ut_list_node_313->in_unzip_LRU_list
3263 && ut_list_node_313->page.in_LRU_list));3274 && ut_list_node_313->page.in_LRU_list));
3264@@ -2189,7 +2351,8 @@3275@@ -2189,7 +2353,8 @@
3265 ut_a(buf_page_belongs_to_unzip_LRU(&block->page));3276 ut_a(buf_page_belongs_to_unzip_LRU(&block->page));
3266 }3277 }
3267 3278
@@ -3271,7 +3282,7 @@
3271 }3282 }
3272 3283
3273 /**********************************************************************//**3284 /**********************************************************************//**
3274@@ -2225,7 +2388,8 @@3285@@ -2225,7 +2390,8 @@
3275 const buf_page_t* bpage;3286 const buf_page_t* bpage;
3276 3287
3277 ut_ad(buf_pool);3288 ut_ad(buf_pool);
@@ -3281,7 +3292,7 @@
3281 3292
3282 bpage = UT_LIST_GET_FIRST(buf_pool->LRU);3293 bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
3283 3294
3284@@ -2282,7 +2446,8 @@3295@@ -2282,7 +2448,8 @@
3285 bpage = UT_LIST_GET_NEXT(LRU, bpage);3296 bpage = UT_LIST_GET_NEXT(LRU, bpage);
3286 }3297 }
3287 3298
@@ -3388,7 +3399,7 @@
3388diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c3399diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
3389--- a/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:03.068954202 +09003400--- a/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:03.068954202 +0900
3390+++ b/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:29.335988682 +09003401+++ b/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:29.335988682 +0900
3391@@ -3832,9 +3832,11 @@3402@@ -3821,9 +3821,11 @@
3392 ulint fold = buf_page_address_fold(space, page_no);3403 ulint fold = buf_page_address_fold(space, page_no);
3393 buf_pool_t* buf_pool = buf_pool_get(space, page_no);3404 buf_pool_t* buf_pool = buf_pool_get(space, page_no);
3394 3405
@@ -3897,7 +3908,7 @@
3897 extern mysql_pfs_key_t cache_last_read_mutex_key;3908 extern mysql_pfs_key_t cache_last_read_mutex_key;
3898 extern mysql_pfs_key_t dict_foreign_err_mutex_key;3909 extern mysql_pfs_key_t dict_foreign_err_mutex_key;
3899 extern mysql_pfs_key_t dict_sys_mutex_key;3910 extern mysql_pfs_key_t dict_sys_mutex_key;
3900@@ -659,7 +663,7 @@3911@@ -668,7 +672,7 @@
3901 #define SYNC_TRX_SYS_HEADER 2903912 #define SYNC_TRX_SYS_HEADER 290
3902 #define SYNC_PURGE_QUEUE 2003913 #define SYNC_PURGE_QUEUE 200
3903 #define SYNC_LOG 1703914 #define SYNC_LOG 170
@@ -3906,7 +3917,7 @@
3906 #define SYNC_RECV 1683917 #define SYNC_RECV 168
3907 #define SYNC_WORK_QUEUE 1623918 #define SYNC_WORK_QUEUE 162
3908 #define SYNC_SEARCH_SYS_CONF 161 /* for assigning btr_search_enabled */3919 #define SYNC_SEARCH_SYS_CONF 161 /* for assigning btr_search_enabled */
3909@@ -669,8 +673,13 @@3920@@ -678,8 +682,13 @@
3910 SYNC_SEARCH_SYS, as memory allocation3921 SYNC_SEARCH_SYS, as memory allocation
3911 can call routines there! Otherwise3922 can call routines there! Otherwise
3912 the level is SYNC_MEM_HASH. */3923 the level is SYNC_MEM_HASH. */
@@ -3921,7 +3932,7 @@
3921 #define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */3932 #define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */
3922 #define SYNC_DOUBLEWRITE 1403933 #define SYNC_DOUBLEWRITE 140
3923 #define SYNC_ANY_LATCH 1353934 #define SYNC_ANY_LATCH 135
3924@@ -702,7 +711,7 @@3935@@ -711,7 +720,7 @@
3925 os_fast_mutex; /*!< We use this OS mutex in place of lock_word3936 os_fast_mutex; /*!< We use this OS mutex in place of lock_word
3926 when atomic operations are not enabled */3937 when atomic operations are not enabled */
3927 #endif3938 #endif
@@ -3933,7 +3944,7 @@
3933diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c3944diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
3934--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:48:03.080956216 +09003945--- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:48:03.080956216 +0900
3935+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:48:29.355023766 +09003946+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:48:29.355023766 +0900
3936@@ -3089,7 +3089,7 @@3947@@ -3098,7 +3098,7 @@
3937 level += log_sys->max_checkpoint_age3948 level += log_sys->max_checkpoint_age
3938 - (lsn - oldest_modification);3949 - (lsn - oldest_modification);
3939 }3950 }
@@ -3942,7 +3953,7 @@
3942 n_blocks++;3953 n_blocks++;
3943 }3954 }
3944 3955
3945@@ -3175,7 +3175,7 @@3956@@ -3184,7 +3184,7 @@
3946 found = TRUE;3957 found = TRUE;
3947 break;3958 break;
3948 }3959 }
@@ -3987,7 +3998,7 @@
3987 }3998 }
3988 3999
3989 /******************************************************************//**4000 /******************************************************************//**
3990@@ -1189,7 +1199,12 @@4001@@ -1234,7 +1244,12 @@
3991 ut_error;4002 ut_error;
3992 }4003 }
3993 break;4004 break;
@@ -4000,7 +4011,7 @@
4000 case SYNC_BUF_POOL:4011 case SYNC_BUF_POOL:
4001 /* We can have multiple mutexes of this type therefore we4012 /* We can have multiple mutexes of this type therefore we
4002 can only check whether the greater than condition holds. */4013 can only check whether the greater than condition holds. */
4003@@ -1207,7 +1222,8 @@4014@@ -1252,7 +1267,8 @@
4004 buffer block (block->mutex or buf_pool->zip_mutex). */4015 buffer block (block->mutex or buf_pool->zip_mutex). */
4005 if (!sync_thread_levels_g(array, level, FALSE)) {4016 if (!sync_thread_levels_g(array, level, FALSE)) {
4006 ut_a(sync_thread_levels_g(array, level - 1, TRUE));4017 ut_a(sync_thread_levels_g(array, level - 1, TRUE));
40074018
=== modified file 'innodb_stats.patch'
--- innodb_stats.patch 2011-05-23 03:13:18 +0000
+++ innodb_stats.patch 2011-06-20 09:04:39 +0000
@@ -350,7 +350,7 @@
350diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c350diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
351--- a/storage/innobase/dict/dict0dict.c 2010-12-03 15:48:03.040222428 +0900351--- a/storage/innobase/dict/dict0dict.c 2010-12-03 15:48:03.040222428 +0900
352+++ b/storage/innobase/dict/dict0dict.c 2010-12-03 17:19:24.841947690 +0900352+++ b/storage/innobase/dict/dict0dict.c 2010-12-03 17:19:24.841947690 +0900
353@@ -756,7 +756,7 @@353@@ -755,7 +755,7 @@
354 print an error message and return without doing354 print an error message and return without doing
355 anything. */355 anything. */
356 dict_update_statistics(table, TRUE /* only update stats356 dict_update_statistics(table, TRUE /* only update stats
@@ -359,7 +359,7 @@
359 }359 }
360 360
361 return(table);361 return(table);
362@@ -4310,6 +4310,289 @@362@@ -4309,6 +4309,295 @@
363 }363 }
364 364
365 /*********************************************************************//**365 /*********************************************************************//**
@@ -592,6 +592,8 @@
592+ break;592+ break;
593+ }593+ }
594+594+
595+ btr_pcur_store_position(&pcur, &mtr);
596+
595+ if (rec_get_deleted_flag(rec, 0)) {597+ if (rec_get_deleted_flag(rec, 0)) {
596+ /* don't count */598+ /* don't count */
597+ i--;599+ i--;
@@ -626,6 +628,10 @@
626+ rests--;628+ rests--;
627+629+
628+next_rec:630+next_rec:
631+ mtr_commit(&mtr);
632+ mtr_start(&mtr);
633+ btr_pcur_restore_position(BTR_MODIFY_LEAF, &pcur, &mtr);
634+
629+ btr_pcur_move_to_next_user_rec(&pcur, &mtr);635+ btr_pcur_move_to_next_user_rec(&pcur, &mtr);
630+ }636+ }
631+ btr_pcur_close(&pcur);637+ btr_pcur_close(&pcur);
@@ -649,7 +655,7 @@
649 Calculates new estimates for table and index statistics. The statistics655 Calculates new estimates for table and index statistics. The statistics
650 are used in query optimization. */656 are used in query optimization. */
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches