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

Proposed by Stewart Smith on 2011-06-20
Status: Merged
Approved by: Stewart Smith on 2011-06-20
Approved revision: 122
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 on 2011-06-20
Percona developers 2011-06-20 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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2011-05-18 00:03:53 +0000
3+++ Makefile 2011-06-20 09:04:39 +0000
4@@ -1,7 +1,7 @@
5 FETCH_CMD=wget
6 MASTER_SITE=http://www.percona.com/downloads/community
7-MYSQL_VERSION=5.5.12
8-PERCONA_SERVER_VERSION=rel20.3
9+MYSQL_VERSION=5.5.13
10+PERCONA_SERVER_VERSION=rel20.4
11 PERCONA_SERVER ?=Percona-Server-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)
12 DEBUG_DIR ?= $(PERCONA_SERVER)-debug
13 RELEASE_DIR ?= $(PERCONA_SERVER)-release
14
15=== modified file 'control_online_alter_index.patch'
16--- control_online_alter_index.patch 2011-05-10 11:57:42 +0000
17+++ control_online_alter_index.patch 2011-06-20 09:04:39 +0000
18@@ -8,7 +8,7 @@
19 diff -ruN a/sql/handler.h b/sql/handler.h
20 --- a/sql/handler.h 2010-11-03 07:01:14.000000000 +0900
21 +++ b/sql/handler.h 2010-12-03 13:51:04.727293058 +0900
22-@@ -203,6 +203,8 @@
23+@@ -205,6 +205,8 @@
24 #define HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE (1L << 9)
25 #define HA_INPLACE_ADD_PK_INDEX_NO_WRITE (1L << 10)
26 #define HA_INPLACE_DROP_PK_INDEX_NO_WRITE (1L << 11)
27
28=== modified file 'innodb_adaptive_hash_index_partitions.patch'
29--- innodb_adaptive_hash_index_partitions.patch 2011-06-03 13:00:05 +0000
30+++ innodb_adaptive_hash_index_partitions.patch 2011-06-20 09:04:39 +0000
31@@ -516,7 +516,7 @@
32 + }
33 + if (UNIV_LIKELY(!block->is_hashed)) {
34 + rw_lock_s_unlock(btr_search_latch);
35-+ return;
36++ goto retry;
37 + }
38 + index = block->index;
39 + ut_a(btr_search_latch == btr_search_get_latch(index->id));
40@@ -1008,7 +1008,7 @@
41 #endif /* UNIV_SYNC_DEBUG */
42 ut_ad(!btr_search_enabled);
43
44-@@ -2633,6 +2638,7 @@
45+@@ -2632,6 +2637,7 @@
46 {
47 block->check_index_page_at_flush = FALSE;
48 block->index = NULL;
49@@ -1019,7 +1019,7 @@
50 diff -ruN a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
51 --- a/storage/innobase/buf/buf0lru.c 2010-12-04 15:35:29.137347521 +0900
52 +++ b/storage/innobase/buf/buf0lru.c 2010-12-04 16:12:48.658550840 +0900
53-@@ -1796,7 +1796,7 @@
54+@@ -1798,7 +1798,7 @@
55
56 UNIV_MEM_VALID(((buf_block_t*) bpage)->frame,
57 UNIV_PAGE_SIZE);
58@@ -1031,7 +1031,7 @@
59 diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
60 --- a/storage/innobase/dict/dict0dict.c 2010-12-04 15:52:23.398513916 +0900
61 +++ b/storage/innobase/dict/dict0dict.c 2010-12-04 16:12:48.662550715 +0900
62-@@ -1812,7 +1812,7 @@
63+@@ -1811,7 +1811,7 @@
64 zero. */
65
66 for (;;) {
67@@ -1056,19 +1056,19 @@
68 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
69 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 16:12:20.185850734 +0900
70 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 16:12:48.674552412 +0900
71-@@ -11695,6 +11695,11 @@
72+@@ -11702,6 +11702,11 @@
73 "Disable with --skip-innodb-adaptive-hash-index.",
74 NULL, innodb_adaptive_hash_index_update, TRUE);
75
76 +static MYSQL_SYSVAR_ULONG(adaptive_hash_index_partitions, btr_search_index_num,
77 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
78 + "Number of InnoDB adaptive hash index partitions (default 1: disable partitioning)",
79-+ NULL, NULL, 1, 1, 32, 0);
80++ NULL, NULL, 1, 1, sizeof(ulint) * 8, 0);
81 +
82 static MYSQL_SYSVAR_ULONG(replication_delay, srv_replication_delay,
83 PLUGIN_VAR_RQCMDARG,
84 "Replication thread delay (ms) on the slave server if "
85-@@ -12060,6 +12065,7 @@
86+@@ -12068,6 +12073,7 @@
87 MYSQL_SYSVAR(use_sys_stats_table),
88 MYSQL_SYSVAR(stats_sample_pages),
89 MYSQL_SYSVAR(adaptive_hash_index),
90@@ -1264,7 +1264,7 @@
91 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
92 --- a/storage/innobase/include/buf0buf.h 2010-12-15 19:00:07.713604580 +0900
93 +++ b/storage/innobase/include/buf0buf.h 2010-12-15 20:58:03.546839883 +0900
94-@@ -1547,7 +1547,7 @@
95+@@ -1546,7 +1546,7 @@
96 pointers in the adaptive hash index
97 pointing to this frame */
98 #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
99@@ -1273,7 +1273,7 @@
100 already been built on this
101 page; note that it does not
102 guarantee that the index is
103-@@ -1561,6 +1561,7 @@
104+@@ -1560,6 +1560,7 @@
105 unsigned curr_left_side:1;/*!< TRUE or FALSE in hash indexing */
106 dict_index_t* index; /*!< Index for which the adaptive
107 hash index has been created. */
108@@ -1389,7 +1389,7 @@
109 #ifdef UNIV_SEARCH_DEBUG
110 ulint cnt = 0;
111 #endif /* UNIV_SEARCH_DEBUG */
112-@@ -3441,18 +3443,32 @@
113+@@ -3446,18 +3448,33 @@
114 /* PHASE 0: Release a possible s-latch we are holding on the
115 adaptive hash index latch if there is someone waiting behind */
116
117@@ -1397,9 +1397,9 @@
118 - && trx->has_search_latch) {
119 + should_release = 0;
120 + for (i = 0; i < btr_search_index_num; i++) {
121-+ if ((trx->has_search_latch & ((ulint)1 << i))
122-+ && rw_lock_get_writer(btr_search_latch_part[i])
123-+ != RW_LOCK_NOT_LOCKED) {
124++ /* we should check all latches (fix Bug#791030) */
125++ if (rw_lock_get_writer(btr_search_latch_part[i])
126++ != RW_LOCK_NOT_LOCKED) {
127 + should_release |= ((ulint)1 << i);
128 + }
129 + }
130@@ -1414,9 +1414,10 @@
131 - rw_lock_s_unlock(&btr_search_latch);
132 - trx->has_search_latch = FALSE;
133 + for (i = 0; i < btr_search_index_num; i++) {
134-+ if (should_release & ((ulint)1 << i)) {
135++ /* we should release all s-latches (fix Bug#791030) */
136++ if (trx->has_search_latch & ((ulint)1 << i)) {
137 + rw_lock_s_unlock(btr_search_latch_part[i]);
138-+ trx->has_search_latch &= ~((ulint)1 << i);
139++ trx->has_search_latch &= (~((ulint)1 << i));
140 + }
141 + }
142
143@@ -1426,7 +1427,7 @@
144 }
145
146 /* Reset the new record lock info if srv_locks_unsafe_for_binlog
147-@@ -3603,9 +3619,11 @@
148+@@ -3608,9 +3625,28 @@
149 hash index semaphore! */
150
151 #ifndef UNIV_SEARCH_DEBUG
152@@ -1435,13 +1436,30 @@
153 - trx->has_search_latch = TRUE;
154 + if (!(trx->has_search_latch
155 + & ((ulint)1 << (index->id % btr_search_index_num)))) {
156-+ rw_lock_s_lock(btr_search_get_latch(index->id));
157-+ trx->has_search_latch |=
158-+ (ulint)1 << (index->id % btr_search_index_num);
159++ if (trx->has_search_latch
160++ < ((ulint)1 << (index->id % btr_search_index_num))) {
161++ rw_lock_s_lock(btr_search_get_latch(index->id));
162++ trx->has_search_latch |=
163++ ((ulint)1 << (index->id % btr_search_index_num));
164++ } else {
165++ /* should re-lock to obay latch-order */
166++ for (i = 0; i < btr_search_index_num; i++) {
167++ if (trx->has_search_latch & ((ulint)1 << i)) {
168++ rw_lock_s_unlock(btr_search_latch_part[i]);
169++ }
170++ }
171++ trx->has_search_latch |=
172++ ((ulint)1 << (index->id % btr_search_index_num));
173++ for (i = 0; i < btr_search_index_num; i++) {
174++ if (trx->has_search_latch & ((ulint)1 << i)) {
175++ rw_lock_s_lock(btr_search_latch_part[i]);
176++ }
177++ }
178++ }
179 }
180 #endif
181 switch (row_sel_try_search_shortcut_for_mysql(
182-@@ -3666,7 +3684,11 @@
183+@@ -3671,7 +3707,11 @@
184
185 trx->search_latch_timeout--;
186
187@@ -1454,7 +1472,7 @@
188 trx->has_search_latch = FALSE;
189 }
190
191-@@ -3690,7 +3712,12 @@
192+@@ -3695,7 +3735,12 @@
193 /* PHASE 3: Open or restore index cursor position */
194
195 if (trx->has_search_latch) {
196@@ -1471,7 +1489,7 @@
197 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
198 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 16:12:20.231484679 +0900
199 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 16:12:48.726551018 +0900
200-@@ -2035,7 +2035,9 @@
201+@@ -2045,7 +2045,9 @@
202 "-------------------------------------\n", file);
203 ibuf_print(file);
204
205@@ -1482,7 +1500,7 @@
206
207 fprintf(file,
208 "%.2f hash searches/s, %.2f non-hash searches/s\n",
209-@@ -2060,14 +2062,15 @@
210+@@ -2070,14 +2072,15 @@
211 ut_total_allocated_memory,
212 mem_pool_get_reserved(mem_comm_pool));
213 /* Calcurate reserved memories */
214@@ -1502,7 +1520,7 @@
215
216 lock_sys_subtotal = 0;
217 if (trx_sys) {
218-@@ -2093,10 +2096,10 @@
219+@@ -2103,10 +2106,10 @@
220 " Recovery system %lu \t(%lu + %lu)\n",
221
222 (ulong) (btr_search_sys
223@@ -1518,7 +1536,7 @@
224 diff -ruN a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
225 --- a/storage/innobase/sync/sync0sync.c 2010-12-03 17:36:44.300986571 +0900
226 +++ b/storage/innobase/sync/sync0sync.c 2010-12-04 16:12:48.729513564 +0900
227-@@ -1178,7 +1178,6 @@
228+@@ -1223,7 +1223,6 @@
229 case SYNC_OUTER_ANY_LATCH:
230 case SYNC_FILE_FORMAT_TAG:
231 case SYNC_DOUBLEWRITE:
232@@ -1526,7 +1544,7 @@
233 case SYNC_SEARCH_SYS_CONF:
234 case SYNC_TRX_LOCK_HEAP:
235 case SYNC_KERNEL:
236-@@ -1199,6 +1198,7 @@
237+@@ -1244,6 +1243,7 @@
238 ut_error;
239 }
240 break;
241@@ -1537,7 +1555,7 @@
242 diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
243 --- a/storage/innobase/trx/trx0trx.c 2010-12-03 17:49:11.623953784 +0900
244 +++ b/storage/innobase/trx/trx0trx.c 2010-12-04 16:12:48.731513275 +0900
245-@@ -266,8 +266,14 @@
246+@@ -265,8 +265,14 @@
247 /*=================================*/
248 trx_t* trx) /*!< in: transaction */
249 {
250
251=== modified file 'innodb_admin_command_base.patch'
252--- innodb_admin_command_base.patch 2011-05-23 03:13:18 +0000
253+++ innodb_admin_command_base.patch 2011-06-20 09:04:39 +0000
254@@ -8,7 +8,7 @@
255 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
256 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:32:15.624039043 +0900
257 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:32:35.424957827 +0900
258-@@ -11856,7 +11856,8 @@
259+@@ -11863,7 +11863,8 @@
260 i_s_innodb_sys_foreign_cols,
261 i_s_innodb_sys_stats,
262 i_s_innodb_table_stats,
263
264=== modified file 'innodb_buffer_pool_pages_i_s.patch'
265--- innodb_buffer_pool_pages_i_s.patch 2011-05-23 03:13:18 +0000
266+++ innodb_buffer_pool_pages_i_s.patch 2011-06-20 09:04:39 +0000
267@@ -8,7 +8,7 @@
268 diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
269 --- a/storage/innobase/buf/buf0buf.c 2010-12-04 20:20:44.595483291 +0900
270 +++ b/storage/innobase/buf/buf0buf.c 2010-12-06 19:28:04.055227506 +0900
271-@@ -4536,6 +4536,36 @@
272+@@ -4537,6 +4537,36 @@
273 mutex_exit(block_mutex);
274 }
275
276@@ -48,7 +48,7 @@
277 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
278 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 20:20:44.614551139 +0900
279 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-06 19:23:47.622195800 +0900
280-@@ -12140,6 +12140,9 @@
281+@@ -12148,6 +12148,9 @@
282 i_s_innodb_sys_stats,
283 i_s_innodb_table_stats,
284 i_s_innodb_index_stats,
285@@ -786,7 +786,7 @@
286 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
287 --- a/storage/innobase/include/buf0buf.h 2010-12-04 19:46:40.197471531 +0900
288 +++ b/storage/innobase/include/buf0buf.h 2010-12-06 19:23:47.638195824 +0900
289-@@ -1145,6 +1145,14 @@
290+@@ -1144,6 +1144,14 @@
291 /*===========*/
292 const buf_pool_t* buf_pool) /*!< in: buffer pool */
293 __attribute__((nonnull, const));
294
295=== modified file 'innodb_buffer_pool_shm.patch'
296--- innodb_buffer_pool_shm.patch 2011-05-10 11:57:42 +0000
297+++ innodb_buffer_pool_shm.patch 2011-06-20 09:04:39 +0000
298@@ -742,7 +742,7 @@
299
300
301 static char* internal_innobase_data_file_path = NULL;
302-@@ -2656,6 +2657,14 @@
303+@@ -2670,6 +2671,14 @@
304 srv_buf_pool_size = (ulint) innobase_buffer_pool_size;
305 srv_buf_pool_instances = (ulint) innobase_buffer_pool_instances;
306
307@@ -757,7 +757,7 @@
308 srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
309
310 srv_n_file_io_threads = (ulint) innobase_file_io_threads;
311-@@ -2672,6 +2681,7 @@
312+@@ -2686,6 +2695,7 @@
313 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
314 srv_use_checksums = (ibool) innobase_use_checksums;
315 srv_fast_checksum = (ibool) innobase_fast_checksum;
316@@ -765,7 +765,7 @@
317
318 #ifdef HAVE_LARGE_PAGES
319 if ((os_use_large_pages = (ibool) my_use_large_pages))
320-@@ -11726,6 +11736,16 @@
321+@@ -11733,6 +11743,16 @@
322 "Number of buffer pool instances, set to higher value on high-end machines to increase scalability",
323 NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L);
324
325@@ -782,7 +782,7 @@
326 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
327 PLUGIN_VAR_RQCMDARG,
328 "Helps in performance tuning in heavily concurrent environments.",
329-@@ -12019,6 +12039,8 @@
330+@@ -12027,6 +12047,8 @@
331 MYSQL_SYSVAR(autoextend_increment),
332 MYSQL_SYSVAR(buffer_pool_size),
333 MYSQL_SYSVAR(buffer_pool_instances),
334@@ -802,7 +802,7 @@
335
336 /** @name Modes for buf_page_get_gen */
337 /* @{ */
338-@@ -1594,9 +1595,12 @@
339+@@ -1593,9 +1594,12 @@
340 /**********************************************************************//**
341 Compute the hash fold value for blocks in buf_pool->zip_hash. */
342 /* @{ */
343@@ -950,7 +950,7 @@
344 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
345 --- a/storage/innobase/include/srv0srv.h 2011-04-09 18:48:45.000000000 +0400
346 +++ b/storage/innobase/include/srv0srv.h 2011-04-09 18:48:48.000000000 +0400
347-@@ -171,6 +171,10 @@
348+@@ -168,6 +168,10 @@
349 extern ulint srv_mem_pool_size;
350 extern ulint srv_lock_table_size;
351
352@@ -1204,7 +1204,7 @@
353 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
354 --- a/storage/innobase/srv/srv0srv.c 2011-04-09 18:48:46.000000000 +0400
355 +++ b/storage/innobase/srv/srv0srv.c 2011-04-09 18:48:48.000000000 +0400
356-@@ -234,6 +234,11 @@
357+@@ -228,6 +228,11 @@
358 UNIV_INTERN ulint srv_mem_pool_size = ULINT_MAX;
359 UNIV_INTERN ulint srv_lock_table_size = ULINT_MAX;
360
361
362=== modified file 'innodb_deadlock_count.patch'
363--- innodb_deadlock_count.patch 2011-05-10 11:57:42 +0000
364+++ innodb_deadlock_count.patch 2011-06-20 09:04:39 +0000
365@@ -31,7 +31,7 @@
366 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
367 --- a/storage/innobase/include/srv0srv.h 2010-12-04 15:55:21.378480843 +0900
368 +++ b/storage/innobase/include/srv0srv.h 2010-12-04 16:10:24.606550983 +0900
369-@@ -761,6 +761,7 @@
370+@@ -758,6 +758,7 @@
371 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
372 ulint innodb_dblwr_pages_written; /*!< srv_dblwr_pages_written */
373 ulint innodb_dblwr_writes; /*!< srv_dblwr_writes */
374@@ -53,7 +53,7 @@
375 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
376 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:57:13.069513371 +0900
377 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 16:10:24.610593039 +0900
378-@@ -474,6 +474,7 @@
379+@@ -468,6 +468,7 @@
380 static ulint srv_n_rows_deleted_old = 0;
381 static ulint srv_n_rows_read_old = 0;
382
383@@ -61,7 +61,7 @@
384 UNIV_INTERN ulint srv_n_lock_wait_count = 0;
385 UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;
386 UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;
387-@@ -2272,6 +2273,7 @@
388+@@ -2282,6 +2283,7 @@
389 export_vars.innodb_buffer_pool_pages_data = LRU_len;
390 export_vars.innodb_buffer_pool_pages_dirty = flush_list_len;
391 export_vars.innodb_buffer_pool_pages_free = free_len;
392
393=== modified file 'innodb_dict_size_limit.patch'
394--- innodb_dict_size_limit.patch 2011-05-10 11:57:42 +0000
395+++ innodb_dict_size_limit.patch 2011-06-20 09:04:39 +0000
396@@ -277,7 +277,7 @@
397 diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
398 --- a/storage/innobase/dict/dict0dict.c 2010-11-03 07:01:13.000000000 +0900
399 +++ b/storage/innobase/dict/dict0dict.c 2010-12-03 15:45:47.525953769 +0900
400-@@ -627,6 +627,8 @@
401+@@ -626,6 +626,8 @@
402
403 table = dict_table_get_on_id_low(table_id);
404
405@@ -286,7 +286,7 @@
406 mutex_exit(&(dict_sys->mutex));
407
408 return(table);
409-@@ -745,6 +747,8 @@
410+@@ -744,6 +746,8 @@
411 table->n_mysql_handles_opened++;
412 }
413
414@@ -295,7 +295,7 @@
415 mutex_exit(&(dict_sys->mutex));
416
417 if (table != NULL) {
418-@@ -1260,6 +1264,64 @@
419+@@ -1259,6 +1263,64 @@
420 dict_mem_table_free(table);
421 }
422
423@@ -360,7 +360,7 @@
424 /****************************************************************//**
425 If the given column name is reserved for InnoDB system columns, return
426 TRUE.
427-@@ -1729,6 +1791,11 @@
428+@@ -1728,6 +1790,11 @@
429 ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
430 ut_ad(mutex_own(&(dict_sys->mutex)));
431
432@@ -384,7 +384,7 @@
433 {"have_atomic_builtins",
434 (char*) &export_vars.innodb_have_atomic_builtins, SHOW_BOOL},
435 {"log_waits",
436-@@ -11635,6 +11637,11 @@
437+@@ -11642,6 +11644,11 @@
438 "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)",
439 NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib);
440
441@@ -396,7 +396,7 @@
442 static struct st_mysql_sys_var* innobase_system_variables[]= {
443 MYSQL_SYSVAR(additional_mem_pool_size),
444 MYSQL_SYSVAR(autoextend_increment),
445-@@ -11702,6 +11709,7 @@
446+@@ -11709,6 +11716,7 @@
447 MYSQL_SYSVAR(flush_neighbor_pages),
448 MYSQL_SYSVAR(read_ahead),
449 MYSQL_SYSVAR(adaptive_flushing_method),
450@@ -500,7 +500,7 @@
451 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
452 --- a/storage/innobase/include/srv0srv.h 2010-12-03 15:43:57.297067100 +0900
453 +++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:45:47.562024404 +0900
454-@@ -232,6 +232,7 @@
455+@@ -229,6 +229,7 @@
456 extern ulint srv_read_ahead;
457 extern ulint srv_adaptive_flushing_method;
458
459@@ -508,7 +508,7 @@
460 /*-------------------------------------------*/
461
462 extern ulint srv_n_rows_inserted;
463-@@ -712,6 +713,7 @@
464+@@ -709,6 +710,7 @@
465 ulint innodb_data_writes; /*!< I/O write requests */
466 ulint innodb_data_written; /*!< Data bytes written */
467 ulint innodb_data_reads; /*!< I/O read requests */
468@@ -519,7 +519,7 @@
469 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
470 --- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:43:57.301024390 +0900
471 +++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:45:47.565023830 +0900
472-@@ -421,6 +421,8 @@
473+@@ -415,6 +415,8 @@
474 UNIV_INTERN ulint srv_enable_unsafe_group_commit = 0; /* 0:disable 1:enable */
475 UNIV_INTERN ulint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */
476 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
477@@ -528,7 +528,7 @@
478 /*-------------------------------------------*/
479 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
480 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
481-@@ -2211,6 +2213,7 @@
482+@@ -2220,6 +2222,7 @@
483 export_vars.innodb_data_reads = os_n_file_reads;
484 export_vars.innodb_data_writes = os_n_file_writes;
485 export_vars.innodb_data_written = srv_data_written;
486
487=== modified file 'innodb_expand_import.patch'
488--- innodb_expand_import.patch 2011-05-10 11:57:42 +0000
489+++ innodb_expand_import.patch 2011-06-20 09:04:39 +0000
490@@ -5,10 +5,40 @@
491 #!!! notice !!!
492 # Any small change to this file in the main branch
493 # should be done or reviewed by the maintainer!
494+diff -ruN a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
495+--- a/storage/innobase/btr/btr0btr.c 2011-04-11 19:44:03.000000000 +0900
496++++ b/storage/innobase/btr/btr0btr.c 2011-05-24 20:30:12.455852287 +0900
497+@@ -837,7 +837,7 @@
498+ /**************************************************************//**
499+ Creates a new index page (not the root, and also not
500+ used in page reorganization). @see btr_page_empty(). */
501+-static
502++UNIV_INTERN
503+ void
504+ btr_page_create(
505+ /*============*/
506+@@ -1707,7 +1707,7 @@
507+ #ifndef UNIV_HOTBACKUP
508+ /*************************************************************//**
509+ Empties an index page. @see btr_page_create(). */
510+-static
511++UNIV_INTERN
512+ void
513+ btr_page_empty(
514+ /*===========*/
515+@@ -2269,7 +2269,7 @@
516+ /**************************************************************//**
517+ Attaches the halves of an index page on the appropriate level in an
518+ index tree. */
519+-static
520++UNIV_INTERN
521+ void
522+ btr_attach_half_pages(
523+ /*==================*/
524 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
525 --- a/storage/innobase/fil/fil0fil.c 2010-12-03 15:09:51.274957577 +0900
526 +++ b/storage/innobase/fil/fil0fil.c 2010-12-03 15:52:23.553986552 +0900
527-@@ -40,6 +40,12 @@
528+@@ -40,6 +40,14 @@
529 #include "dict0dict.h"
530 #include "page0page.h"
531 #include "page0zip.h"
532@@ -18,10 +48,97 @@
533 +#include "row0mysql.h"
534 +#include "row0row.h"
535 +#include "que0que.h"
536++#include "btr0btr.h"
537++#include "btr0sea.h"
538 #ifndef UNIV_HOTBACKUP
539 # include "buf0lru.h"
540 # include "ibuf0ibuf.h"
541-@@ -3078,7 +3084,7 @@
542+@@ -3032,6 +3040,84 @@
543+ }
544+
545+ /********************************************************************//**
546++Checks if a page is corrupt. (for offline page)
547++*/
548++static
549++ibool
550++fil_page_buf_page_is_corrupted_offline(
551++/*===================================*/
552++ const byte* page, /*!< in: a database page */
553++ ulint zip_size) /*!< in: size of compressed page;
554++ 0 for uncompressed pages */
555++{
556++ ulint checksum_field;
557++ ulint old_checksum_field;
558++
559++ if (!zip_size
560++ && memcmp(page + FIL_PAGE_LSN + 4,
561++ page + UNIV_PAGE_SIZE
562++ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) {
563++ return(TRUE);
564++ }
565++
566++ checksum_field = mach_read_from_4(page
567++ + FIL_PAGE_SPACE_OR_CHKSUM);
568++
569++ if (zip_size) {
570++ return(checksum_field != BUF_NO_CHECKSUM_MAGIC
571++ && checksum_field
572++ != page_zip_calc_checksum(page, zip_size));
573++ }
574++
575++ old_checksum_field = mach_read_from_4(
576++ page + UNIV_PAGE_SIZE
577++ - FIL_PAGE_END_LSN_OLD_CHKSUM);
578++
579++ if (old_checksum_field != mach_read_from_4(page
580++ + FIL_PAGE_LSN)
581++ && old_checksum_field != BUF_NO_CHECKSUM_MAGIC
582++ && old_checksum_field
583++ != buf_calc_page_old_checksum(page)) {
584++ return(TRUE);
585++ }
586++
587++ if (checksum_field != 0
588++ && checksum_field != BUF_NO_CHECKSUM_MAGIC
589++ && checksum_field
590++ != buf_calc_page_new_checksum(page)) {
591++ return(TRUE);
592++ }
593++
594++ return(FALSE);
595++}
596++
597++/********************************************************************//**
598++*/
599++static
600++void
601++fil_page_buf_page_store_checksum(
602++/*=============================*/
603++ byte* page,
604++ ulint zip_size)
605++{
606++ if (!zip_size) {
607++ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
608++ srv_use_checksums
609++ ? buf_calc_page_new_checksum(page)
610++ : BUF_NO_CHECKSUM_MAGIC);
611++ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
612++ srv_use_checksums
613++ ? buf_calc_page_old_checksum(page)
614++ : BUF_NO_CHECKSUM_MAGIC);
615++ } else {
616++ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
617++ srv_use_checksums
618++ ? page_zip_calc_checksum(page, zip_size)
619++ : BUF_NO_CHECKSUM_MAGIC);
620++ }
621++}
622++
623++/********************************************************************//**
624+ Tries to open a single-table tablespace and optionally checks the space id is
625+ right in it. If does not succeed, prints an error message to the .err log. This
626+ function is used to open a tablespace when we start up mysqld, and also in
627+@@ -3078,7 +3164,7 @@
628
629 file = os_file_create_simple_no_error_handling(
630 innodb_file_data_key, filepath, OS_FILE_OPEN,
631@@ -30,7 +147,7 @@
632 if (!success) {
633 /* The following call prints an error message */
634 os_file_get_last_error(TRUE);
635-@@ -3125,6 +3131,466 @@
636+@@ -3125,6 +3211,445 @@
637 space_id = fsp_header_get_space_id(page);
638 space_flags = fsp_header_get_flags(page);
639
640@@ -56,6 +173,7 @@
641 + fil_system_t* system;
642 + fil_node_t* node = NULL;
643 + fil_space_t* space;
644++ ulint zip_size;
645 +
646 + buf3 = ut_malloc(2 * UNIV_PAGE_SIZE);
647 + descr_page = ut_align(buf3, UNIV_PAGE_SIZE);
648@@ -73,12 +191,15 @@
649 + /* store as first descr page */
650 + memcpy(descr_page, page, UNIV_PAGE_SIZE);
651 +
652++ zip_size = dict_table_flags_to_zip_size(flags);
653++ ut_a(zip_size == dict_table_flags_to_zip_size(space_flags));
654++
655 + /* get free limit (page number) of the table space */
656 +/* these should be same to the definition in fsp0fsp.c */
657 +#define FSP_HEADER_OFFSET FIL_PAGE_DATA
658 +#define FSP_FREE_LIMIT 12
659 + free_limit = mach_read_from_4(FSP_HEADER_OFFSET + FSP_FREE_LIMIT + page);
660-+ free_limit_bytes = (ib_int64_t)free_limit * (ib_int64_t)UNIV_PAGE_SIZE;
661++ free_limit_bytes = (ib_int64_t)free_limit * (ib_int64_t)(zip_size ? zip_size : UNIV_PAGE_SIZE);
662 +
663 + /* overwrite fsp header */
664 + fsp_header_init_fields(page, id, flags);
665@@ -87,14 +208,9 @@
666 + space_flags = flags;
667 + if (mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN) > current_lsn)
668 + mach_write_to_8(page + FIL_PAGE_FILE_FLUSH_LSN, current_lsn);
669-+ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
670-+ srv_use_checksums
671-+ ? buf_calc_page_new_checksum(page)
672-+ : BUF_NO_CHECKSUM_MAGIC);
673-+ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
674-+ srv_use_checksums
675-+ ? buf_calc_page_old_checksum(page)
676-+ : BUF_NO_CHECKSUM_MAGIC);
677++
678++ fil_page_buf_page_store_checksum(page, zip_size);
679++
680 + success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE);
681 +
682 + /* get file size */
683@@ -104,7 +220,7 @@
684 +
685 + if (size_bytes < free_limit_bytes) {
686 + free_limit_bytes = size_bytes;
687-+ if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
688++ if (size_bytes >= (lint)FSP_EXTENT_SIZE * (lint)(zip_size ? zip_size : UNIV_PAGE_SIZE)) {
689 + fprintf(stderr, "InnoDB: free limit of %s is larger than its real size.\n", filepath);
690 + file_is_corrupt = TRUE;
691 + }
692@@ -168,63 +284,41 @@
693 + size_bytes = ut_2pow_round(size_bytes, 1024 * 1024);
694 + }
695 + */
696-+ if (!(flags & DICT_TF_ZSSIZE_MASK)) {
697++
698++ if (zip_size) {
699++ fprintf(stderr, "InnoDB: Warning: importing compressed table is still EXPERIMENTAL, currently.\n");
700++ }
701++
702++ {
703 + mem_heap_t* heap = NULL;
704 + ulint offsets_[REC_OFFS_NORMAL_SIZE];
705 + ulint* offsets = offsets_;
706 + ib_int64_t offset;
707 +
708-+ size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
709++ size = (ulint) (size_bytes / (zip_size ? zip_size : UNIV_PAGE_SIZE));
710 + /* over write space id of all pages */
711 + rec_offs_init(offsets_);
712 +
713 + fprintf(stderr, "InnoDB: Progress in %%:");
714 +
715-+ for (offset = 0; offset < free_limit_bytes; offset += UNIV_PAGE_SIZE) {
716-+ ulint checksum_field;
717-+ ulint old_checksum_field;
718++ for (offset = 0; offset < free_limit_bytes;
719++ offset += zip_size ? zip_size : UNIV_PAGE_SIZE) {
720 + ibool page_is_corrupt;
721 +
722 + success = os_file_read(file, page,
723 + (ulint)(offset & 0xFFFFFFFFUL),
724-+ (ulint)(offset >> 32), UNIV_PAGE_SIZE);
725++ (ulint)(offset >> 32),
726++ zip_size ? zip_size : UNIV_PAGE_SIZE);
727 +
728 + page_is_corrupt = FALSE;
729 +
730 + /* check consistency */
731-+ if (memcmp(page + FIL_PAGE_LSN + 4,
732-+ page + UNIV_PAGE_SIZE
733-+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) {
734-+
735++ if (fil_page_buf_page_is_corrupted_offline(page, zip_size)) {
736 + page_is_corrupt = TRUE;
737 + }
738 +
739 + if (mach_read_from_4(page + FIL_PAGE_OFFSET)
740-+ != offset / UNIV_PAGE_SIZE) {
741-+
742-+ page_is_corrupt = TRUE;
743-+ }
744-+
745-+ checksum_field = mach_read_from_4(page
746-+ + FIL_PAGE_SPACE_OR_CHKSUM);
747-+
748-+ old_checksum_field = mach_read_from_4(
749-+ page + UNIV_PAGE_SIZE
750-+ - FIL_PAGE_END_LSN_OLD_CHKSUM);
751-+
752-+ if (old_checksum_field != mach_read_from_4(page
753-+ + FIL_PAGE_LSN)
754-+ && old_checksum_field != BUF_NO_CHECKSUM_MAGIC
755-+ && old_checksum_field
756-+ != buf_calc_page_old_checksum(page)) {
757-+
758-+ page_is_corrupt = TRUE;
759-+ }
760-+
761-+ if (checksum_field != 0
762-+ && checksum_field != BUF_NO_CHECKSUM_MAGIC
763-+ && checksum_field
764-+ != buf_calc_page_new_checksum(page)) {
765++ != offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)) {
766 +
767 + page_is_corrupt = TRUE;
768 + }
769@@ -235,7 +329,8 @@
770 + /* it should be overwritten already */
771 + ut_a(!page_is_corrupt);
772 +
773-+ } else if (!((offset / UNIV_PAGE_SIZE) % UNIV_PAGE_SIZE)) {
774++ } else if (!((offset / (zip_size ? zip_size : UNIV_PAGE_SIZE))
775++ % (zip_size ? zip_size : UNIV_PAGE_SIZE))) {
776 + /* descr page (not header) */
777 + if (page_is_corrupt) {
778 + file_is_corrupt = TRUE;
779@@ -246,7 +341,7 @@
780 + }
781 +
782 + /* store as descr page */
783-+ memcpy(descr_page, page, UNIV_PAGE_SIZE);
784++ memcpy(descr_page, page, (zip_size ? zip_size : UNIV_PAGE_SIZE));
785 +
786 + } else if (descr_is_corrupt) {
787 + /* unknown state of the page */
788@@ -274,9 +369,12 @@
789 + ulint bit_index;
790 +
791 + descr = descr_page + XDES_ARR_OFFSET
792-+ + XDES_SIZE * (ut_2pow_remainder((offset / UNIV_PAGE_SIZE), UNIV_PAGE_SIZE) / FSP_EXTENT_SIZE);
793++ + XDES_SIZE * (ut_2pow_remainder(
794++ (offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)),
795++ (zip_size ? zip_size : UNIV_PAGE_SIZE)) / FSP_EXTENT_SIZE);
796 +
797-+ index = XDES_FREE_BIT + XDES_BITS_PER_PAGE * ((offset / UNIV_PAGE_SIZE) % FSP_EXTENT_SIZE);
798++ index = XDES_FREE_BIT
799++ + XDES_BITS_PER_PAGE * ((offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)) % FSP_EXTENT_SIZE);
800 + byte_index = index / 8;
801 + bit_index = index % 8;
802 +
803@@ -294,7 +392,7 @@
804 + }
805 +
806 + if (page_is_corrupt) {
807-+ fprintf(stderr, " [errp:%lld]", offset / UNIV_PAGE_SIZE);
808++ fprintf(stderr, " [errp:%lld]", offset / (zip_size ? zip_size : UNIV_PAGE_SIZE));
809 +
810 + /* cannot treat corrupt page */
811 + goto skip_write;
812@@ -304,7 +402,13 @@
813 + mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, id);
814 +
815 + for (i = 0; i < n_index; i++) {
816-+ if (offset / UNIV_PAGE_SIZE == root_page[i]) {
817++ if (offset / (zip_size ? zip_size : UNIV_PAGE_SIZE) == root_page[i]) {
818++ if (fil_page_get_type(page) != FIL_PAGE_INDEX) {
819++ file_is_corrupt = TRUE;
820++ fprintf(stderr, " [etyp:%lld]",
821++ offset / (zip_size ? zip_size : UNIV_PAGE_SIZE));
822++ goto skip_write;
823++ }
824 + /* this is index root page */
825 + mach_write_to_4(page + FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
826 + + FSEG_HDR_SPACE, id);
827@@ -317,7 +421,14 @@
828 + if (fil_page_get_type(page) == FIL_PAGE_INDEX) {
829 + index_id_t tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
830 +
831-+ if (mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
832++ for (i = 0; i < n_index; i++) {
833++ if (old_id[i] == tmp) {
834++ mach_write_to_8(page + (PAGE_HEADER + PAGE_INDEX_ID), new_id[i]);
835++ break;
836++ }
837++ }
838++
839++ if (!zip_size && mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
840 + && old_id[0] == tmp) {
841 + /* leaf page of cluster index, reset trx_id of records */
842 + rec_t* rec;
843@@ -356,42 +467,34 @@
844 + rec = page_rec_get_next(rec);
845 + n_recs--;
846 + }
847-+ }
848-+
849-+ for (i = 0; i < n_index; i++) {
850-+ if (old_id[i] == tmp) {
851-+ mach_write_to_8(page + (PAGE_HEADER + PAGE_INDEX_ID), new_id[i]);
852-+ break;
853-+ }
854++ } else if (mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
855++ && old_id[0] != tmp) {
856++ mach_write_to_8(page + (PAGE_HEADER + PAGE_MAX_TRX_ID), 1);
857 + }
858 + }
859 +
860 + if (mach_read_from_8(page + FIL_PAGE_LSN) > current_lsn) {
861 + mach_write_to_8(page + FIL_PAGE_LSN, current_lsn);
862-+ mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
863-+ current_lsn);
864++ if (!zip_size) {
865++ mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
866++ current_lsn);
867++ }
868 + }
869 +
870-+ mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
871-+ srv_use_checksums
872-+ ? buf_calc_page_new_checksum(page)
873-+ : BUF_NO_CHECKSUM_MAGIC);
874-+ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
875-+ srv_use_checksums
876-+ ? buf_calc_page_old_checksum(page)
877-+ : BUF_NO_CHECKSUM_MAGIC);
878++ fil_page_buf_page_store_checksum(page, zip_size);
879 +
880 + success = os_file_write(filepath, file, page,
881 + (ulint)(offset & 0xFFFFFFFFUL),
882-+ (ulint)(offset >> 32), UNIV_PAGE_SIZE);
883++ (ulint)(offset >> 32),
884++ zip_size ? zip_size : UNIV_PAGE_SIZE);
885 + }
886 +
887 +skip_write:
888 + if (free_limit_bytes
889-+ && ((ib_int64_t)((offset + UNIV_PAGE_SIZE) * 100) / free_limit_bytes)
890++ && ((ib_int64_t)((offset + (zip_size ? zip_size : UNIV_PAGE_SIZE)) * 100) / free_limit_bytes)
891 + != ((offset * 100) / free_limit_bytes)) {
892 + fprintf(stderr, " %lu",
893-+ (ulong)((ib_int64_t)((offset + UNIV_PAGE_SIZE) * 100) / free_limit_bytes));
894++ (ulong)((ib_int64_t)((offset + (zip_size ? zip_size : UNIV_PAGE_SIZE)) * 100) / free_limit_bytes));
895 + }
896 + }
897 +
898@@ -447,13 +550,6 @@
899 + if (UNIV_LIKELY_NULL(heap)) {
900 + mem_heap_free(heap);
901 + }
902-+ } else {
903-+ /* zip page? */
904-+ size = (ulint)
905-+ (size_bytes
906-+ / dict_table_flags_to_zip_size(flags));
907-+ fprintf(stderr, "InnoDB: Import: The table %s seems to be in a newer format."
908-+ " It may not be possible to process it.\n", name);
909 + }
910 + /* .exp file should be removed */
911 + success = os_file_delete(info_file_path);
912@@ -497,10 +593,282 @@
913 ut_free(buf2);
914
915 if (UNIV_UNLIKELY(space_id != id
916+@@ -3166,6 +3691,271 @@
917+ os_file_close(file);
918+ mem_free(filepath);
919+
920++ if (srv_expand_import && dict_table_flags_to_zip_size(flags)) {
921++ ulint page_no;
922++ ulint zip_size;
923++ ulint height;
924++ ulint root_height = 0;
925++ rec_t* node_ptr;
926++ dict_table_t* table;
927++ dict_index_t* index;
928++ buf_block_t* block;
929++ page_t* page;
930++ page_zip_des_t* page_zip;
931++ mtr_t mtr;
932++
933++ mem_heap_t* heap = NULL;
934++ ulint offsets_[REC_OFFS_NORMAL_SIZE];
935++ ulint* offsets = offsets_;
936++
937++ rec_offs_init(offsets_);
938++
939++ zip_size = dict_table_flags_to_zip_size(flags);
940++
941++ table = dict_table_get_low(name);
942++ index = dict_table_get_first_index(table);
943++ page_no = dict_index_get_page(index);
944++ ut_a(page_no == 3);
945++
946++ fprintf(stderr, "InnoDB: It is compressed .ibd file. need to convert additionaly on buffer pool.\n");
947++
948++ /* down to leaf */
949++ mtr_start(&mtr);
950++ mtr_set_log_mode(&mtr, MTR_LOG_NONE);
951++
952++ height = ULINT_UNDEFINED;
953++
954++ for (;;) {
955++ block = buf_page_get(space_id, zip_size, page_no,
956++ RW_NO_LATCH, &mtr);
957++ page = buf_block_get_frame(block);
958++
959++ block->check_index_page_at_flush = TRUE;
960++
961++ if (height == ULINT_UNDEFINED) {
962++ height = btr_page_get_level(page, &mtr);
963++ root_height = height;
964++ }
965++
966++ if (height == 0) {
967++ break;
968++ }
969++
970++ node_ptr = page_rec_get_next(page_get_infimum_rec(page));
971++
972++ height--;
973++
974++ offsets = rec_get_offsets(node_ptr, index, offsets, ULINT_UNDEFINED, &heap);
975++ page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
976++ }
977++
978++ mtr_commit(&mtr);
979++
980++ fprintf(stderr, "InnoDB: pages needs split are ...");
981++
982++ /* scan reaf pages */
983++ while (page_no != FIL_NULL) {
984++ rec_t* rec;
985++ rec_t* supremum;
986++ ulint n_recs;
987++
988++ mtr_start(&mtr);
989++
990++ block = buf_page_get(space_id, zip_size, page_no,
991++ RW_X_LATCH, &mtr);
992++ page = buf_block_get_frame(block);
993++ page_zip = buf_block_get_page_zip(block);
994++
995++ if (!page_zip) {
996++ /*something wrong*/
997++ fprintf(stderr, "InnoDB: Something wrong with reading page %lu.\n", page_no);
998++convert_err_exit:
999++ mtr_commit(&mtr);
1000++ mutex_enter(&fil_system->mutex);
1001++ fil_space_free(space_id, FALSE);
1002++ mutex_exit(&fil_system->mutex);
1003++ success = FALSE;
1004++ goto convert_exit;
1005++ }
1006++
1007++ supremum = page_get_supremum_rec(page);
1008++ rec = page_rec_get_next(page_get_infimum_rec(page));
1009++ n_recs = page_get_n_recs(page);
1010++
1011++ /* illegal operation as InnoDB online system. so not logged */
1012++ while (rec && rec != supremum && n_recs > 0) {
1013++ ulint n_fields;
1014++ ulint i;
1015++ ulint offset = index->trx_id_offset;
1016++
1017++ offsets = rec_get_offsets(rec, index, offsets,
1018++ ULINT_UNDEFINED, &heap);
1019++ n_fields = rec_offs_n_fields(offsets);
1020++ if (!offset) {
1021++ offset = row_get_trx_id_offset(rec, index, offsets);
1022++ }
1023++ trx_write_trx_id(rec + offset, 1);
1024++
1025++ for (i = 0; i < n_fields; i++) {
1026++ if (rec_offs_nth_extern(offsets, i)) {
1027++ ulint local_len;
1028++ byte* data;
1029++
1030++ data = rec_get_nth_field(rec, offsets, i, &local_len);
1031++
1032++ local_len -= BTR_EXTERN_FIELD_REF_SIZE;
1033++
1034++ mach_write_to_4(data + local_len + BTR_EXTERN_SPACE_ID, id);
1035++ }
1036++ }
1037++
1038++ rec = page_rec_get_next(rec);
1039++ n_recs--;
1040++ }
1041++
1042++ /* dummy logged update for along with modified page path */
1043++ if (index->id != btr_page_get_index_id(page)) {
1044++ /* this should be adjusted already */
1045++ fprintf(stderr, "InnoDB: The page %lu seems to be converted wrong.\n", page_no);
1046++ goto convert_err_exit;
1047++ }
1048++ btr_page_set_index_id(page, page_zip, index->id, &mtr);
1049++
1050++ /* confirm whether fits to the page size or not */
1051++ if (!page_zip_compress(page_zip, page, index, &mtr)
1052++ && !btr_page_reorganize(block, index, &mtr)) {
1053++ buf_block_t* new_block;
1054++ page_t* new_page;
1055++ page_zip_des_t* new_page_zip;
1056++ rec_t* split_rec;
1057++ ulint n_uniq;
1058++
1059++ /* split page is needed */
1060++ fprintf(stderr, " %lu", page_no);
1061++
1062++ mtr_x_lock(dict_index_get_lock(index), &mtr);
1063++
1064++ n_uniq = dict_index_get_n_unique_in_tree(index);
1065++
1066++ if(page_get_n_recs(page) < 2) {
1067++ /* no way to make smaller */
1068++ fprintf(stderr, "InnoDB: The page %lu cannot be store to the page size.\n", page_no);
1069++ goto convert_err_exit;
1070++ }
1071++
1072++ if (UNIV_UNLIKELY(page_no == dict_index_get_page(index))) {
1073++ ulint new_page_no;
1074++ dtuple_t* node_ptr;
1075++ ulint level;
1076++ rec_t* node_ptr_rec;
1077++ page_cur_t page_cursor;
1078++
1079++ /* it is root page, need to raise before split */
1080++
1081++ level = btr_page_get_level(page, &mtr);
1082++
1083++ new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, &mtr);
1084++ new_page = buf_block_get_frame(new_block);
1085++ new_page_zip = buf_block_get_page_zip(new_block);
1086++ btr_page_create(new_block, new_page_zip, index, level, &mtr);
1087++
1088++ btr_page_set_next(new_page, new_page_zip, FIL_NULL, &mtr);
1089++ btr_page_set_prev(new_page, new_page_zip, FIL_NULL, &mtr);
1090++
1091++ page_zip_copy_recs(new_page_zip, new_page,
1092++ page_zip, page, index, &mtr);
1093++ btr_search_move_or_delete_hash_entries(new_block, block, index);
1094++
1095++ rec = page_rec_get_next(page_get_infimum_rec(new_page));
1096++ new_page_no = buf_block_get_page_no(new_block);
1097++
1098++ node_ptr = dict_index_build_node_ptr(index, rec, new_page_no, heap,
1099++ level);
1100++ dtuple_set_info_bits(node_ptr,
1101++ dtuple_get_info_bits(node_ptr)
1102++ | REC_INFO_MIN_REC_FLAG);
1103++ btr_page_empty(block, page_zip, index, level + 1, &mtr);
1104++
1105++ btr_page_set_next(page, page_zip, FIL_NULL, &mtr);
1106++ btr_page_set_prev(page, page_zip, FIL_NULL, &mtr);
1107++
1108++ page_cur_set_before_first(block, &page_cursor);
1109++
1110++ node_ptr_rec = page_cur_tuple_insert(&page_cursor, node_ptr,
1111++ index, 0, &mtr);
1112++ ut_a(node_ptr_rec);
1113++
1114++ if (!btr_page_reorganize(block, index, &mtr)) {
1115++ fprintf(stderr, "InnoDB: failed to store the page %lu.\n", page_no);
1116++ goto convert_err_exit;
1117++ }
1118++
1119++ /* move to the raised page */
1120++ page_no = new_page_no;
1121++ block = new_block;
1122++ page = new_page;
1123++ page_zip = new_page_zip;
1124++
1125++ fprintf(stderr, "(raise_to:%lu)", page_no);
1126++ }
1127++
1128++ split_rec = page_get_middle_rec(page);
1129++
1130++ new_block = btr_page_alloc(index, page_no + 1, FSP_UP,
1131++ btr_page_get_level(page, &mtr), &mtr);
1132++ new_page = buf_block_get_frame(new_block);
1133++ new_page_zip = buf_block_get_page_zip(new_block);
1134++ btr_page_create(new_block, new_page_zip, index,
1135++ btr_page_get_level(page, &mtr), &mtr);
1136++
1137++ offsets = rec_get_offsets(split_rec, index, offsets, n_uniq, &heap);
1138++
1139++ btr_attach_half_pages(index, block,
1140++ split_rec, new_block, FSP_UP, &mtr);
1141++
1142++ page_zip_copy_recs(new_page_zip, new_page,
1143++ page_zip, page, index, &mtr);
1144++ page_delete_rec_list_start(split_rec - page + new_page,
1145++ new_block, index, &mtr);
1146++ btr_search_move_or_delete_hash_entries(new_block, block, index);
1147++ page_delete_rec_list_end(split_rec, block, index,
1148++ ULINT_UNDEFINED, ULINT_UNDEFINED, &mtr);
1149++
1150++ fprintf(stderr, "(new:%lu)", buf_block_get_page_no(new_block));
1151++
1152++ /* Are they needed? */
1153++ if (!btr_page_reorganize(block, index, &mtr)) {
1154++ fprintf(stderr, "InnoDB: failed to store the page %lu.\n", page_no);
1155++ goto convert_err_exit;
1156++ }
1157++ if (!btr_page_reorganize(new_block, index, &mtr)) {
1158++ fprintf(stderr, "InnoDB: failed to store the page %lu.\n", buf_block_get_page_no(new_block));
1159++ goto convert_err_exit;
1160++ }
1161++ }
1162++
1163++ page_no = btr_page_get_next(page, &mtr);
1164++
1165++ mtr_commit(&mtr);
1166++
1167++ if (heap) {
1168++ mem_heap_empty(heap);
1169++ }
1170++ }
1171++
1172++ fprintf(stderr, "...done.\nInnoDB: waiting the flush batch of the additional conversion.\n");
1173++
1174++ /* should wait for the not-logged changes are all flushed */
1175++ buf_flush_list(ULINT_MAX, mtr.end_lsn + 1);
1176++ buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST);
1177++
1178++ fprintf(stderr, "InnoDB: done.\n");
1179++convert_exit:
1180++ if (UNIV_LIKELY_NULL(heap)) {
1181++ mem_heap_free(heap);
1182++ }
1183++ }
1184++
1185+ return(success);
1186+ }
1187+ #endif /* !UNIV_HOTBACKUP */
1188 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
1189 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:49:59.195023983 +0900
1190 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:52:23.555957062 +0900
1191-@@ -7368,6 +7368,14 @@
1192+@@ -7377,6 +7377,14 @@
1193 err = row_discard_tablespace_for_mysql(dict_table->name, trx);
1194 } else {
1195 err = row_import_tablespace_for_mysql(dict_table->name, trx);
1196@@ -515,7 +883,7 @@
1197 }
1198
1199 err = convert_error_code_to_mysql(err, dict_table->flags, NULL);
1200-@@ -11642,6 +11650,11 @@
1201+@@ -11649,6 +11657,11 @@
1202 "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)",
1203 NULL, innodb_adaptive_flushing_method_update, 1, &adaptive_flushing_method_typelib);
1204
1205@@ -527,7 +895,7 @@
1206 static MYSQL_SYSVAR_ULONG(dict_size_limit, srv_dict_size_limit,
1207 PLUGIN_VAR_RQCMDARG,
1208 "Limit the allocated memory for dictionary cache. (0: unlimited)",
1209-@@ -11714,6 +11727,7 @@
1210+@@ -11721,6 +11734,7 @@
1211 MYSQL_SYSVAR(flush_neighbor_pages),
1212 MYSQL_SYSVAR(read_ahead),
1213 MYSQL_SYSVAR(adaptive_flushing_method),
1214@@ -535,10 +903,125 @@
1215 MYSQL_SYSVAR(dict_size_limit),
1216 MYSQL_SYSVAR(use_sys_malloc),
1217 MYSQL_SYSVAR(use_native_aio),
1218+diff -ruN a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
1219+--- a/storage/innobase/include/btr0btr.h 2011-04-11 19:44:03.000000000 +0900
1220++++ b/storage/innobase/include/btr0btr.h 2011-05-24 20:30:12.459853343 +0900
1221+@@ -219,6 +219,17 @@
1222+ @return the uncompressed page frame */
1223+ # define btr_page_get(space,zip_size,page_no,mode,mtr) \
1224+ buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,mtr))
1225++/**************************************************************//**
1226++Sets the index id field of a page. */
1227++UNIV_INLINE
1228++void
1229++btr_page_set_index_id(
1230++/*==================*/
1231++ page_t* page, /*!< in: page to be created */
1232++ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
1233++ part will be updated, or NULL */
1234++ index_id_t id, /*!< in: index id */
1235++ mtr_t* mtr); /*!< in: mtr */
1236+ #endif /* !UNIV_HOTBACKUP */
1237+ /**************************************************************//**
1238+ Gets the index id field of a page.
1239+@@ -256,6 +267,17 @@
1240+ const page_t* page, /*!< in: index page */
1241+ mtr_t* mtr); /*!< in: mini-transaction handle */
1242+ /********************************************************//**
1243++Sets the next index page field. */
1244++UNIV_INLINE
1245++void
1246++btr_page_set_next(
1247++/*==============*/
1248++ page_t* page, /*!< in: index page */
1249++ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
1250++ part will be updated, or NULL */
1251++ ulint next, /*!< in: next page number */
1252++ mtr_t* mtr); /*!< in: mini-transaction handle */
1253++/********************************************************//**
1254+ Gets the previous index page number.
1255+ @return prev page number */
1256+ UNIV_INLINE
1257+@@ -264,6 +286,17 @@
1258+ /*==============*/
1259+ const page_t* page, /*!< in: index page */
1260+ mtr_t* mtr); /*!< in: mini-transaction handle */
1261++/********************************************************//**
1262++Sets the previous index page field. */
1263++UNIV_INLINE
1264++void
1265++btr_page_set_prev(
1266++/*==============*/
1267++ page_t* page, /*!< in: index page */
1268++ page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
1269++ part will be updated, or NULL */
1270++ ulint prev, /*!< in: previous page number */
1271++ mtr_t* mtr); /*!< in: mini-transaction handle */
1272+ /*************************************************************//**
1273+ Gets pointer to the previous user record in the tree. It is assumed
1274+ that the caller has appropriate latches on the page and its neighbor.
1275+@@ -309,6 +342,18 @@
1276+ /*===========================*/
1277+ const rec_t* rec, /*!< in: node pointer record */
1278+ const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
1279++/**************************************************************//**
1280++Creates a new index page (not the root, and also not
1281++used in page reorganization). @see btr_page_empty(). */
1282++UNIV_INTERN
1283++void
1284++btr_page_create(
1285++/*============*/
1286++ buf_block_t* block, /*!< in/out: page to be created */
1287++ page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
1288++ dict_index_t* index, /*!< in: index */
1289++ ulint level, /*!< in: the B-tree level of the page */
1290++ mtr_t* mtr); /*!< in: mtr */
1291+ /************************************************************//**
1292+ Creates the root node for a new index tree.
1293+ @return page number of the created root, FIL_NULL if did not succeed */
1294+@@ -379,6 +424,17 @@
1295+ dict_index_t* index, /*!< in: record descriptor */
1296+ mtr_t* mtr); /*!< in: mtr */
1297+ /*************************************************************//**
1298++Empties an index page. @see btr_page_create(). */
1299++UNIV_INTERN
1300++void
1301++btr_page_empty(
1302++/*===========*/
1303++ buf_block_t* block, /*!< in: page to be emptied */
1304++ page_zip_des_t* page_zip,/*!< out: compressed page, or NULL */
1305++ dict_index_t* index, /*!< in: index of the page */
1306++ ulint level, /*!< in: the B-tree level of the page */
1307++ mtr_t* mtr); /*!< in: mtr */
1308++/*************************************************************//**
1309+ Decides if the page should be split at the convergence point of
1310+ inserts converging to left.
1311+ @return TRUE if split recommended */
1312+@@ -437,6 +493,20 @@
1313+ # define btr_insert_on_non_leaf_level(i,l,t,m) \
1314+ btr_insert_on_non_leaf_level_func(i,l,t,__FILE__,__LINE__,m)
1315+ #endif /* !UNIV_HOTBACKUP */
1316++/**************************************************************//**
1317++Attaches the halves of an index page on the appropriate level in an
1318++index tree. */
1319++UNIV_INTERN
1320++void
1321++btr_attach_half_pages(
1322++/*==================*/
1323++ dict_index_t* index, /*!< in: the index tree */
1324++ buf_block_t* block, /*!< in/out: page to be split */
1325++ rec_t* split_rec, /*!< in: first record on upper
1326++ half page */
1327++ buf_block_t* new_block, /*!< in/out: the new half page */
1328++ ulint direction, /*!< in: FSP_UP or FSP_DOWN */
1329++ mtr_t* mtr); /*!< in: mtr */
1330+ /****************************************************************//**
1331+ Sets a record as the predefined minimum record. */
1332+ UNIV_INTERN
1333 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
1334 --- a/storage/innobase/include/srv0srv.h 2010-12-03 15:48:03.077954270 +0900
1335 +++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:52:23.561986996 +0900
1336-@@ -232,6 +232,8 @@
1337+@@ -229,6 +229,8 @@
1338 extern ulint srv_read_ahead;
1339 extern ulint srv_adaptive_flushing_method;
1340
1341@@ -547,10 +1030,37 @@
1342 extern ulint srv_dict_size_limit;
1343 /*-------------------------------------------*/
1344
1345+diff -ruN a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
1346+--- a/storage/innobase/row/row0mysql.c 2011-04-11 19:44:03.000000000 +0900
1347++++ b/storage/innobase/row/row0mysql.c 2011-06-06 11:53:18.395764565 +0900
1348+@@ -2568,6 +2568,11 @@
1349+
1350+ current_lsn = log_get_lsn();
1351+
1352++ /* Enlarge the fatal lock wait timeout during import. */
1353++ mutex_enter(&kernel_mutex);
1354++ srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */
1355++ mutex_exit(&kernel_mutex);
1356++
1357+ /* It is possible, though very improbable, that the lsn's in the
1358+ tablespace to be imported have risen above the current system lsn, if
1359+ a lengthy purge, ibuf merge, or rollback was performed on a backup
1360+@@ -2679,6 +2684,11 @@
1361+
1362+ trx->op_info = "";
1363+
1364++ /* Restore the fatal semaphore wait timeout */
1365++ mutex_enter(&kernel_mutex);
1366++ srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */
1367++ mutex_exit(&kernel_mutex);
1368++
1369+ return((int) err);
1370+ }
1371+
1372 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
1373 --- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:49:59.230956118 +0900
1374 +++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:52:23.562954411 +0900
1375-@@ -422,6 +422,8 @@
1376+@@ -416,6 +416,8 @@
1377 UNIV_INTERN ulint srv_read_ahead = 3; /* 1: random 2: linear 3: Both */
1378 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
1379
1380
1381=== modified file 'innodb_extend_slow.patch'
1382--- innodb_extend_slow.patch 2011-05-10 11:57:42 +0000
1383+++ innodb_extend_slow.patch 2011-06-20 09:04:39 +0000
1384@@ -335,7 +335,7 @@
1385 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
1386 --- a/storage/innobase/fil/fil0fil.c 2010-12-03 15:53:54.610037199 +0900
1387 +++ b/storage/innobase/fil/fil0fil.c 2010-12-03 17:42:42.079064198 +0900
1388-@@ -4423,7 +4423,7 @@
1389+@@ -4747,7 +4747,7 @@
1390 node->name, node->handle, buf,
1391 offset_low, offset_high,
1392 page_size * n_pages,
1393@@ -344,7 +344,7 @@
1394 #endif
1395 if (success) {
1396 node->size += n_pages;
1397-@@ -4750,7 +4750,7 @@
1398+@@ -5074,7 +5074,7 @@
1399 i/o on a tablespace which does not exist */
1400 UNIV_INTERN
1401 ulint
1402@@ -353,7 +353,7 @@
1403 /*===*/
1404 ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,
1405 ORed to OS_FILE_LOG, if a log i/o
1406-@@ -4775,8 +4775,9 @@
1407+@@ -5099,8 +5099,9 @@
1408 void* buf, /*!< in/out: buffer where to store read data
1409 or from where to write; in aio this must be
1410 appropriately aligned */
1411@@ -364,7 +364,7 @@
1412 {
1413 ulint mode;
1414 fil_space_t* space;
1415-@@ -4944,7 +4945,7 @@
1416+@@ -5268,7 +5269,7 @@
1417 #else
1418 /* Queue the aio request */
1419 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
1420@@ -376,7 +376,7 @@
1421 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
1422 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:36:44.293955189 +0900
1423 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:42:42.090024586 +0900
1424-@@ -1559,6 +1559,16 @@
1425+@@ -1573,6 +1573,16 @@
1426 trx->check_unique_secondary = !thd_test_options(
1427 thd, OPTION_RELAXED_UNIQUE_CHECKS);
1428
1429@@ -393,7 +393,7 @@
1430 DBUG_VOID_RETURN;
1431 }
1432
1433-@@ -1613,6 +1623,32 @@
1434+@@ -1627,6 +1637,32 @@
1435 return(trx);
1436 }
1437
1438@@ -426,7 +426,7 @@
1439 /*********************************************************************//**
1440 Note that a transaction has been registered with MySQL.
1441 @return true if transaction is registered with MySQL 2PC coordinator */
1442-@@ -9296,6 +9332,25 @@
1443+@@ -9301,6 +9337,25 @@
1444 statement has ended */
1445
1446 if (trx->n_mysql_tables_in_use == 0) {
1447@@ -648,13 +648,13 @@
1448 +/* prototypes for new functions added to ha_innodb.cc */
1449 +ibool innobase_get_slow_log();
1450 +
1451- /* This is set to the MySQL server value for this variable. */
1452- extern uint srv_lower_case_table_names;
1453-
1454+ /* Mutex for locking srv_monitor_file */
1455+ extern mutex_t srv_monitor_file_mutex;
1456+ /* Temporary file for innodb monitor output */
1457 diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
1458 --- a/storage/innobase/include/trx0trx.h 2010-12-03 15:41:52.049372966 +0900
1459 +++ b/storage/innobase/include/trx0trx.h 2010-12-03 17:42:42.107024532 +0900
1460-@@ -738,6 +738,17 @@
1461+@@ -743,6 +743,17 @@
1462 /*------------------------------*/
1463 char detailed_error[256]; /*!< detailed error message for last
1464 error, or empty. */
1465@@ -843,8 +843,8 @@
1466 }
1467
1468 ut_a(type == OS_FILE_WRITE);
1469-@@ -4099,6 +4131,11 @@
1470- ut_error;
1471+@@ -4101,6 +4133,11 @@
1472+ array = NULL; /* Eliminate compiler warning */
1473 }
1474
1475 + if (trx && type == OS_FILE_READ)
1476@@ -865,10 +865,10 @@
1477 +/* prototypes for new functions added to ha_innodb.cc */
1478 +ibool innobase_get_slow_log();
1479 +
1480- /* This is set to the MySQL server value for this variable. It is only
1481- needed for FOREIGN KEY definition parsing since FOREIGN KEY names are not
1482- stored in the server metadata. The server stores and enforces it for
1483-@@ -1244,6 +1247,10 @@
1484+ /* The following counter is incremented whenever there is some user activity
1485+ in the server */
1486+ UNIV_INTERN ulint srv_activity_count = 0;
1487+@@ -1232,6 +1235,10 @@
1488 ibool has_slept = FALSE;
1489 srv_conc_slot_t* slot = NULL;
1490 ulint i;
1491@@ -877,9 +877,9 @@
1492 + ulint sec;
1493 + ulint ms;
1494
1495- if (trx->mysql_thd != NULL
1496- && thd_is_replication_slave_thread(trx->mysql_thd)) {
1497-@@ -1320,6 +1327,7 @@
1498+ #ifdef UNIV_SYNC_DEBUG
1499+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
1500+@@ -1312,6 +1319,7 @@
1501 switches. */
1502 if (SRV_THREAD_SLEEP_DELAY > 0) {
1503 os_thread_sleep(SRV_THREAD_SLEEP_DELAY);
1504@@ -887,10 +887,11 @@
1505 }
1506
1507 trx->op_info = "";
1508-@@ -1375,6 +1383,13 @@
1509- /* Go to wait for the event; when a thread leaves InnoDB it will
1510- release this thread */
1511-
1512+@@ -1371,6 +1379,14 @@
1513+ #ifdef UNIV_SYNC_DEBUG
1514+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
1515+ #endif /* UNIV_SYNC_DEBUG */
1516++
1517 + if (innobase_get_slow_log() && trx->take_stats) {
1518 + ut_usectime(&sec, &ms);
1519 + start_time = (ib_uint64_t)sec * 1000000 + ms;
1520@@ -901,7 +902,7 @@
1521 trx->op_info = "waiting in InnoDB queue";
1522
1523 thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
1524-@@ -1383,6 +1398,12 @@
1525+@@ -1379,6 +1395,12 @@
1526
1527 trx->op_info = "";
1528
1529@@ -917,7 +918,7 @@
1530 diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
1531 --- a/storage/innobase/trx/trx0trx.c 2010-12-03 15:41:52.053955669 +0900
1532 +++ b/storage/innobase/trx/trx0trx.c 2010-12-03 17:42:42.127023410 +0900
1533-@@ -185,6 +185,15 @@
1534+@@ -188,6 +188,15 @@
1535 trx->global_read_view = NULL;
1536 trx->read_view = NULL;
1537
1538@@ -933,9 +934,9 @@
1539 /* Set X/Open XA transaction identification to NULL */
1540 memset(&trx->xid, 0, sizeof(trx->xid));
1541 trx->xid.formatID = -1;
1542-@@ -222,6 +231,11 @@
1543+@@ -221,6 +230,11 @@
1544
1545- trx->mysql_process_no = os_proc_get_number();
1546+ mutex_exit(&kernel_mutex);
1547
1548 + if (innobase_get_slow_log() && trx->take_stats) {
1549 + trx->distinct_page_access_hash = mem_alloc(DPAH_SIZE);
1550@@ -945,7 +946,7 @@
1551 return(trx);
1552 }
1553
1554-@@ -353,6 +367,12 @@
1555+@@ -406,6 +420,12 @@
1556 /*===============*/
1557 trx_t* trx) /*!< in, own: trx object */
1558 {
1559@@ -958,7 +959,7 @@
1560 mutex_enter(&kernel_mutex);
1561
1562 UT_LIST_REMOVE(mysql_trx_list, trx_sys->mysql_trx_list, trx);
1563-@@ -374,6 +394,12 @@
1564+@@ -427,6 +447,12 @@
1565 /*====================*/
1566 trx_t* trx) /*!< in, own: trx object */
1567 {
1568@@ -971,7 +972,7 @@
1569 mutex_enter(&kernel_mutex);
1570
1571 trx_free(trx);
1572-@@ -1152,6 +1178,9 @@
1573+@@ -1212,6 +1238,9 @@
1574 trx_t* trx) /*!< in: transaction */
1575 {
1576 que_thr_t* thr;
1577@@ -981,7 +982,7 @@
1578
1579 ut_ad(mutex_own(&kernel_mutex));
1580 ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
1581-@@ -1166,6 +1195,11 @@
1582+@@ -1226,6 +1255,11 @@
1583 thr = UT_LIST_GET_FIRST(trx->wait_thrs);
1584 }
1585
1586@@ -993,7 +994,7 @@
1587 trx->que_state = TRX_QUE_RUNNING;
1588 }
1589
1590-@@ -1179,6 +1213,9 @@
1591+@@ -1239,6 +1273,9 @@
1592 trx_t* trx) /*!< in: transaction in the TRX_QUE_LOCK_WAIT state */
1593 {
1594 que_thr_t* thr;
1595@@ -1003,7 +1004,7 @@
1596
1597 ut_ad(mutex_own(&kernel_mutex));
1598 ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
1599-@@ -1193,6 +1230,11 @@
1600+@@ -1253,6 +1290,11 @@
1601 thr = UT_LIST_GET_FIRST(trx->wait_thrs);
1602 }
1603
1604
1605=== modified file 'innodb_extra_rseg.patch'
1606--- innodb_extra_rseg.patch 2011-05-23 03:13:18 +0000
1607+++ innodb_extra_rseg.patch 2011-06-20 09:04:39 +0000
1608@@ -8,7 +8,7 @@
1609 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
1610 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:18:48.879955903 +0900
1611 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:22:53.779955671 +0900
1612-@@ -11521,6 +11521,7 @@
1613+@@ -11528,6 +11528,7 @@
1614 innobase_system_variables, /* system variables */
1615 NULL /* reserved */
1616 },
1617
1618=== added file 'innodb_fake_changes.patch'
1619--- innodb_fake_changes.patch 1970-01-01 00:00:00 +0000
1620+++ innodb_fake_changes.patch 2011-06-20 09:04:39 +0000
1621@@ -0,0 +1,614 @@
1622+# name : innodb_fake_changes.patch
1623+# introduced : 5.5.12
1624+# maintainer : Yasufumi
1625+#
1626+#!!! notice !!!
1627+# Any small change to this file in the main branch
1628+# should be done or reviewed by the maintainer!
1629+diff -ruN a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
1630+--- a/storage/innobase/btr/btr0cur.c 2011-06-01 21:04:26.346416429 +0900
1631++++ b/storage/innobase/btr/btr0cur.c 2011-06-01 21:04:53.718415294 +0900
1632+@@ -1167,6 +1167,11 @@
1633+ rec_t* rec;
1634+ roll_ptr_t roll_ptr;
1635+
1636++ if (thr && thr_get_trx(thr)->fake_changes) {
1637++ /* skip LOCK, UNDO */
1638++ return(DB_SUCCESS);
1639++ }
1640++
1641+ /* Check if we have to wait for a lock: enqueue an explicit lock
1642+ request if yes */
1643+
1644+@@ -1298,7 +1303,7 @@
1645+ }
1646+ #endif /* UNIV_DEBUG */
1647+
1648+- ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
1649++ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
1650+ max_size = page_get_max_insert_size_after_reorganize(page, 1);
1651+ leaf = page_is_leaf(page);
1652+
1653+@@ -1393,6 +1398,12 @@
1654+ goto fail_err;
1655+ }
1656+
1657++ if (thr && thr_get_trx(thr)->fake_changes) {
1658++ /* skip CHANGE, LOG */
1659++ *big_rec = big_rec_vec;
1660++ return(err); /* == DB_SUCCESS */
1661++ }
1662++
1663+ page_cursor = btr_cur_get_page_cur(cursor);
1664+
1665+ /* Now, try the insert */
1666+@@ -1535,10 +1546,10 @@
1667+
1668+ *big_rec = NULL;
1669+
1670+- ut_ad(mtr_memo_contains(mtr,
1671++ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr,
1672+ dict_index_get_lock(btr_cur_get_index(cursor)),
1673+ MTR_MEMO_X_LOCK));
1674+- ut_ad(mtr_memo_contains(mtr, btr_cur_get_block(cursor),
1675++ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, btr_cur_get_block(cursor),
1676+ MTR_MEMO_PAGE_X_FIX));
1677+
1678+ /* Try first an optimistic insert; reset the cursor flag: we do not
1679+@@ -1604,6 +1615,16 @@
1680+ }
1681+ }
1682+
1683++ if (thr && thr_get_trx(thr)->fake_changes) {
1684++ /* skip CHANGE, LOG */
1685++ if (n_extents > 0) {
1686++ fil_space_release_free_extents(index->space,
1687++ n_reserved);
1688++ }
1689++ *big_rec = big_rec_vec;
1690++ return(DB_SUCCESS);
1691++ }
1692++
1693+ if (dict_index_get_page(index)
1694+ == buf_block_get_page_no(btr_cur_get_block(cursor))) {
1695+
1696+@@ -1660,6 +1681,11 @@
1697+
1698+ ut_ad(cursor && update && thr && roll_ptr);
1699+
1700++ if (thr && thr_get_trx(thr)->fake_changes) {
1701++ /* skip LOCK, UNDO */
1702++ return(DB_SUCCESS);
1703++ }
1704++
1705+ rec = btr_cur_get_rec(cursor);
1706+ index = cursor->index;
1707+
1708+@@ -1958,6 +1984,14 @@
1709+ return(err);
1710+ }
1711+
1712++ if (trx->fake_changes) {
1713++ /* skip CHANGE, LOG */
1714++ if (UNIV_LIKELY_NULL(heap)) {
1715++ mem_heap_free(heap);
1716++ }
1717++ return(err); /* == DB_SUCCESS */
1718++ }
1719++
1720+ if (block->is_hashed) {
1721+ /* The function row_upd_changes_ord_field_binary works only
1722+ if the update vector was built for a clustered index, we must
1723+@@ -2061,7 +2095,7 @@
1724+ rec = btr_cur_get_rec(cursor);
1725+ index = cursor->index;
1726+ ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
1727+- ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
1728++ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
1729+ /* The insert buffer tree should never be updated in place. */
1730+ ut_ad(!dict_index_is_ibuf(index));
1731+
1732+@@ -2171,6 +2205,11 @@
1733+ goto err_exit;
1734+ }
1735+
1736++ if (thr && thr_get_trx(thr)->fake_changes) {
1737++ /* skip CHANGE, LOG */
1738++ goto err_exit; /* == DB_SUCCESS */
1739++ }
1740++
1741+ /* Ok, we may do the replacement. Store on the page infimum the
1742+ explicit locks on rec, before deleting rec (see the comment in
1743+ btr_cur_pessimistic_update). */
1744+@@ -2321,9 +2360,9 @@
1745+ rec = btr_cur_get_rec(cursor);
1746+ index = cursor->index;
1747+
1748+- ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
1749++ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, dict_index_get_lock(index),
1750+ MTR_MEMO_X_LOCK));
1751+- ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
1752++ ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
1753+ #ifdef UNIV_ZIP_DEBUG
1754+ ut_a(!page_zip || page_zip_validate(page_zip, page));
1755+ #endif /* UNIV_ZIP_DEBUG */
1756+@@ -2411,6 +2450,9 @@
1757+
1758+ ut_ad(big_rec_vec == NULL);
1759+
1760++ /* fake_changes should not cause undo. so never reaches here */
1761++ ut_ad(!(trx->fake_changes));
1762++
1763+ btr_rec_free_updated_extern_fields(
1764+ index, rec, page_zip, offsets, update,
1765+ trx_is_recv(trx) ? RB_RECOVERY : RB_NORMAL, mtr);
1766+@@ -2445,6 +2487,12 @@
1767+ }
1768+ }
1769+
1770++ if (trx->fake_changes) {
1771++ /* skip CHANGE, LOG */
1772++ err = DB_SUCCESS;
1773++ goto return_after_reservations;
1774++ }
1775++
1776+ /* Store state of explicit locks on rec on the page infimum record,
1777+ before deleting rec. The page infimum acts as a dummy carrier of the
1778+ locks, taking care also of lock releases, before we can move the locks
1779+@@ -2746,6 +2794,11 @@
1780+ ut_ad(dict_index_is_clust(index));
1781+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
1782+
1783++ if (thr && thr_get_trx(thr)->fake_changes) {
1784++ /* skip LOCK, UNDO, CHANGE, LOG */
1785++ return(DB_SUCCESS);
1786++ }
1787++
1788+ err = lock_clust_rec_modify_check_and_lock(flags, block,
1789+ rec, index, offsets, thr);
1790+
1791+@@ -2883,6 +2936,11 @@
1792+ rec_t* rec;
1793+ ulint err;
1794+
1795++ if (thr && thr_get_trx(thr)->fake_changes) {
1796++ /* skip LOCK, CHANGE, LOG */
1797++ return(DB_SUCCESS);
1798++ }
1799++
1800+ block = btr_cur_get_block(cursor);
1801+ rec = btr_cur_get_rec(cursor);
1802+
1803+diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
1804+--- a/storage/innobase/handler/ha_innodb.cc 2011-06-01 21:04:26.511385596 +0900
1805++++ b/storage/innobase/handler/ha_innodb.cc 2011-06-01 21:04:53.723390828 +0900
1806+@@ -484,6 +484,12 @@
1807+ " or 2 (write at commit, flush once per second).",
1808+ NULL, NULL, 1, 0, 2, 0);
1809+
1810++static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
1811++ "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "
1812++ "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "
1813++ "ATTENTION: the transaction started after enabled is affected.",
1814++ NULL, NULL, FALSE);
1815++
1816+
1817+ static handler *innobase_create_handler(handlerton *hton,
1818+ TABLE_SHARE *table,
1819+@@ -1675,6 +1681,8 @@
1820+ trx->check_unique_secondary = !thd_test_options(
1821+ thd, OPTION_RELAXED_UNIQUE_CHECKS);
1822+
1823++ trx->fake_changes = THDVAR(thd, fake_changes);
1824++
1825+ #ifdef EXTENDED_SLOWLOG
1826+ if (thd_log_slow_verbosity(thd) & SLOG_V_INNODB) {
1827+ trx->take_stats = TRUE;
1828+@@ -7486,12 +7494,20 @@
1829+
1830+ parent_trx = check_trx_exists(thd);
1831+
1832++
1833++ if (parent_trx->fake_changes
1834++ && thd_sql_command(thd) != SQLCOM_CREATE_TABLE) {
1835++ sql_print_error("innodb_fake_changes cannot treat new table during other than CREATE TABLE. (%s)\n", name);
1836++ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
1837++ }
1838++
1839+ /* In case MySQL calls this in the middle of a SELECT query, release
1840+ possible adaptive hash latch to avoid deadlocks of threads */
1841+
1842+ trx_search_latch_release_if_reserved(parent_trx);
1843+
1844+ trx = innobase_trx_allocate(thd);
1845++ trx->fake_changes = FALSE;
1846+
1847+ /* Latch the InnoDB data dictionary exclusively so that no deadlocks
1848+ or lock waits can happen in it during a table create operation.
1849+@@ -7701,6 +7717,7 @@
1850+ /*==============================*/
1851+ {
1852+ int error;
1853++ ibool fake_changes_reserved = FALSE;
1854+
1855+ DBUG_ENTER("ha_innobase::truncate");
1856+
1857+@@ -7713,10 +7730,21 @@
1858+ DBUG_RETURN(HA_ERR_CRASHED);
1859+ }
1860+
1861++ if (prebuilt->trx->fake_changes) {
1862++ /* disable temporally */
1863++ prebuilt->trx->fake_changes = FALSE;
1864++ fake_changes_reserved = TRUE;
1865++ }
1866++
1867+ /* Truncate the table in InnoDB */
1868+
1869+ error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
1870+
1871++ if (fake_changes_reserved) {
1872++ prebuilt->trx->fake_changes = TRUE;
1873++ fake_changes_reserved = FALSE;
1874++ }
1875++
1876+ if (share->ib_table->is_corrupt) {
1877+ DBUG_RETURN(HA_ERR_CRASHED);
1878+ }
1879+@@ -7768,6 +7796,7 @@
1880+ trx_search_latch_release_if_reserved(parent_trx);
1881+
1882+ trx = innobase_trx_allocate(thd);
1883++ trx->fake_changes = FALSE;
1884+
1885+ name_len = strlen(name);
1886+
1887+@@ -7855,6 +7884,7 @@
1888+ trx->mysql_thd = NULL;
1889+ #else
1890+ trx = innobase_trx_allocate(thd);
1891++ trx->fake_changes = FALSE;
1892+ #endif
1893+ row_drop_database_for_mysql(namebuf, trx);
1894+ my_free(namebuf);
1895+@@ -7960,6 +7990,7 @@
1896+ trx_search_latch_release_if_reserved(parent_trx);
1897+
1898+ trx = innobase_trx_allocate(thd);
1899++ trx->fake_changes = FALSE;
1900+
1901+ error = innobase_rename_table(trx, from, to, TRUE);
1902+
1903+@@ -12228,6 +12259,7 @@
1904+ MYSQL_SYSVAR(rollback_segments),
1905+ MYSQL_SYSVAR(corrupt_table_action),
1906+ MYSQL_SYSVAR(lazy_drop_table),
1907++ MYSQL_SYSVAR(fake_changes),
1908+ NULL
1909+ };
1910+
1911+diff -ruN a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
1912+--- a/storage/innobase/handler/handler0alter.cc 2011-04-11 19:44:03.000000000 +0900
1913++++ b/storage/innobase/handler/handler0alter.cc 2011-06-01 21:04:53.728495636 +0900
1914+@@ -641,6 +641,7 @@
1915+ ibool dict_locked = FALSE;
1916+ ulint new_primary;
1917+ int error;
1918++ ulint should_fake_changes = FALSE;
1919+
1920+ DBUG_ENTER("ha_innobase::add_index");
1921+ ut_a(table);
1922+@@ -677,11 +678,17 @@
1923+ }
1924+
1925+ heap = mem_heap_create(1024);
1926++
1927++ if (prebuilt->trx->fake_changes) {
1928++ prebuilt->trx->fake_changes = FALSE;
1929++ should_fake_changes = TRUE;
1930++ }
1931+ trx_start_if_not_started(prebuilt->trx);
1932+
1933+ /* Create a background transaction for the operations on
1934+ the data dictionary tables. */
1935+ trx = innobase_trx_allocate(user_thd);
1936++ trx->fake_changes = FALSE;
1937+ trx_start_if_not_started(trx);
1938+
1939+ /* Create table containing all indexes to be built in this
1940+@@ -760,6 +767,9 @@
1941+ row_mysql_unlock_data_dictionary(trx);
1942+ trx_free_for_mysql(trx);
1943+ trx_commit_for_mysql(prebuilt->trx);
1944++ if (should_fake_changes) {
1945++ prebuilt->trx->fake_changes = TRUE;
1946++ }
1947+ DBUG_RETURN(error);
1948+ }
1949+
1950+@@ -925,6 +935,9 @@
1951+ trx_commit_for_mysql(trx);
1952+ if (prebuilt->trx) {
1953+ trx_commit_for_mysql(prebuilt->trx);
1954++ if (should_fake_changes) {
1955++ prebuilt->trx->fake_changes = TRUE;
1956++ }
1957+ }
1958+
1959+ if (dict_locked) {
1960+@@ -1172,6 +1185,7 @@
1961+ /* Create a background transaction for the operations on
1962+ the data dictionary tables. */
1963+ trx = innobase_trx_allocate(user_thd);
1964++ trx->fake_changes = FALSE;
1965+ trx_start_if_not_started(trx);
1966+
1967+ /* Flag this transaction as a dictionary operation, so that
1968+diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
1969+--- a/storage/innobase/ibuf/ibuf0ibuf.c 2011-06-01 21:04:26.529383815 +0900
1970++++ b/storage/innobase/ibuf/ibuf0ibuf.c 2011-06-01 21:04:53.732416483 +0900
1971+@@ -3496,6 +3496,8 @@
1972+
1973+ ut_a(trx_sys_multiple_tablespace_format);
1974+
1975++ ut_ad(!(thr_get_trx(thr)->fake_changes));
1976++
1977+ do_merge = FALSE;
1978+
1979+ /* Perform dirty reads of ibuf->size and ibuf->max_size, to
1980+diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
1981+--- a/storage/innobase/include/trx0trx.h 2011-06-01 21:04:25.762416618 +0900
1982++++ b/storage/innobase/include/trx0trx.h 2011-06-01 21:04:53.736387944 +0900
1983+@@ -512,6 +512,7 @@
1984+ FALSE, one can save CPU time and about
1985+ 150 bytes in the undo log size as then
1986+ we skip XA steps */
1987++ ulint fake_changes;
1988+ ulint flush_log_later;/* In 2PC, we hold the
1989+ prepare_commit mutex across
1990+ both phases. In that case, we
1991+diff -ruN a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
1992+--- a/storage/innobase/lock/lock0lock.c 2011-06-01 21:04:26.543396960 +0900
1993++++ b/storage/innobase/lock/lock0lock.c 2011-06-01 21:04:53.739416526 +0900
1994+@@ -3909,6 +3909,10 @@
1995+
1996+ trx = thr_get_trx(thr);
1997+
1998++ if (trx->fake_changes && mode == LOCK_IX) {
1999++ mode = LOCK_IS;
2000++ }
2001++
2002+ lock_mutex_enter_kernel();
2003+
2004+ /* Look for stronger locks the same trx already has on the table */
2005+@@ -5107,6 +5111,11 @@
2006+ }
2007+
2008+ trx = thr_get_trx(thr);
2009++
2010++ if (trx->fake_changes) {
2011++ return(DB_SUCCESS);
2012++ }
2013++
2014+ next_rec = page_rec_get_next_const(rec);
2015+ next_rec_heap_no = page_rec_get_heap_no(next_rec);
2016+
2017+@@ -5275,6 +5284,10 @@
2018+ return(DB_SUCCESS);
2019+ }
2020+
2021++ if (thr && thr_get_trx(thr)->fake_changes) {
2022++ return(DB_SUCCESS);
2023++ }
2024++
2025+ heap_no = rec_offs_comp(offsets)
2026+ ? rec_get_heap_no_new(rec)
2027+ : rec_get_heap_no_old(rec);
2028+@@ -5333,6 +5346,10 @@
2029+ return(DB_SUCCESS);
2030+ }
2031+
2032++ if (thr && thr_get_trx(thr)->fake_changes) {
2033++ return(DB_SUCCESS);
2034++ }
2035++
2036+ heap_no = page_rec_get_heap_no(rec);
2037+
2038+ /* Another transaction cannot have an implicit lock on the record,
2039+@@ -5420,6 +5437,10 @@
2040+ return(DB_SUCCESS);
2041+ }
2042+
2043++ if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) {
2044++ mode = LOCK_S;
2045++ }
2046++
2047+ heap_no = page_rec_get_heap_no(rec);
2048+
2049+ lock_mutex_enter_kernel();
2050+@@ -5496,6 +5517,10 @@
2051+ return(DB_SUCCESS);
2052+ }
2053+
2054++ if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) {
2055++ mode = LOCK_S;
2056++ }
2057++
2058+ heap_no = page_rec_get_heap_no(rec);
2059+
2060+ lock_mutex_enter_kernel();
2061+diff -ruN a/storage/innobase/que/que0que.c b/storage/innobase/que/que0que.c
2062+--- a/storage/innobase/que/que0que.c 2011-06-01 21:04:25.553416889 +0900
2063++++ b/storage/innobase/que/que0que.c 2011-06-01 21:04:53.743419001 +0900
2064+@@ -1417,6 +1417,12 @@
2065+
2066+ ut_a(trx->error_state == DB_SUCCESS);
2067+
2068++ if (trx->fake_changes) {
2069++ /* fake_changes should not access to system tables */
2070++ fprintf(stderr, "InnoDB: ERROR: innodb_fake_changes tried to access to system tables.\n");
2071++ return(DB_ERROR);
2072++ }
2073++
2074+ if (reserve_dict_mutex) {
2075+ mutex_enter(&dict_sys->mutex);
2076+ }
2077+diff -ruN a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
2078+--- a/storage/innobase/row/row0ins.c 2011-06-01 21:04:26.099449453 +0900
2079++++ b/storage/innobase/row/row0ins.c 2011-06-01 21:04:53.746383371 +0900
2080+@@ -1499,6 +1499,11 @@
2081+ if (UNIV_LIKELY_NULL(heap)) {
2082+ mem_heap_free(heap);
2083+ }
2084++
2085++ if (trx->fake_changes) {
2086++ err = DB_SUCCESS;
2087++ }
2088++
2089+ return(err);
2090+ }
2091+
2092+@@ -2004,7 +2009,7 @@
2093+ }
2094+
2095+ btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
2096+- search_mode,
2097++ thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : search_mode,
2098+ &cursor, 0, __FILE__, __LINE__, &mtr);
2099+
2100+ if (cursor.flag == BTR_CUR_INSERT_TO_IBUF) {
2101+@@ -2065,7 +2070,7 @@
2102+
2103+ btr_cur_search_to_nth_level(index, 0, entry,
2104+ PAGE_CUR_LE,
2105+- mode | BTR_INSERT,
2106++ thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : (mode | BTR_INSERT),
2107+ &cursor, 0,
2108+ __FILE__, __LINE__, &mtr);
2109+ }
2110+@@ -2119,6 +2124,22 @@
2111+ if (UNIV_LIKELY_NULL(big_rec)) {
2112+ rec_t* rec;
2113+ ulint* offsets;
2114++
2115++ if (thr_get_trx(thr)->fake_changes) {
2116++ /* skip store extern */
2117++ if (modify) {
2118++ dtuple_big_rec_free(big_rec);
2119++ } else {
2120++ dtuple_convert_back_big_rec(index, entry, big_rec);
2121++ }
2122++
2123++ if (UNIV_LIKELY_NULL(heap)) {
2124++ mem_heap_free(heap);
2125++ }
2126++
2127++ return(err);
2128++ }
2129++
2130+ mtr_start(&mtr);
2131+
2132+ btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
2133+diff -ruN a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
2134+--- a/storage/innobase/row/row0mysql.c 2011-06-01 21:04:26.287385626 +0900
2135++++ b/storage/innobase/row/row0mysql.c 2011-06-01 21:04:53.749372325 +0900
2136+@@ -1245,6 +1245,7 @@
2137+ prebuilt->table->stat_n_rows--;
2138+ }
2139+
2140++ if (!(trx->fake_changes))
2141+ row_update_statistics_if_needed(prebuilt->table);
2142+ trx->op_info = "";
2143+
2144+@@ -1504,6 +1505,7 @@
2145+ that changes indexed columns, UPDATEs that change only non-indexed
2146+ columns would not affect statistics. */
2147+ if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
2148++ if (!(trx->fake_changes))
2149+ row_update_statistics_if_needed(prebuilt->table);
2150+ }
2151+
2152+@@ -1721,6 +1723,7 @@
2153+ srv_n_rows_updated++;
2154+ }
2155+
2156++ if (!(trx->fake_changes))
2157+ row_update_statistics_if_needed(table);
2158+
2159+ return(err);
2160+diff -ruN a/storage/innobase/row/row0upd.c b/storage/innobase/row/row0upd.c
2161+--- a/storage/innobase/row/row0upd.c 2011-06-01 21:04:25.588384975 +0900
2162++++ b/storage/innobase/row/row0upd.c 2011-06-01 21:04:53.753385366 +0900
2163+@@ -1603,7 +1603,8 @@
2164+ mode |= BTR_DELETE_MARK;
2165+ }
2166+
2167+- search_result = row_search_index_entry(index, entry, mode,
2168++ search_result = row_search_index_entry(index, entry,
2169++ trx->fake_changes ? BTR_SEARCH_LEAF : mode,
2170+ &pcur, &mtr);
2171+
2172+ btr_cur = btr_pcur_get_btr_cur(&pcur);
2173+@@ -1850,9 +1851,11 @@
2174+ the previous invocation of this function. Mark the
2175+ off-page columns in the entry inherited. */
2176+
2177++ if (!(trx->fake_changes)) {
2178+ change_ownership = row_upd_clust_rec_by_insert_inherit(
2179+ NULL, NULL, entry, node->update);
2180+ ut_a(change_ownership);
2181++ }
2182+ /* fall through */
2183+ case UPD_NODE_INSERT_CLUSTERED:
2184+ /* A lock wait occurred in row_ins_index_entry() in
2185+@@ -1882,7 +1885,7 @@
2186+ delete-marked old record, mark them disowned by the
2187+ old record and owned by the new entry. */
2188+
2189+- if (rec_offs_any_extern(offsets)) {
2190++ if (rec_offs_any_extern(offsets) && !(trx->fake_changes)) {
2191+ change_ownership = row_upd_clust_rec_by_insert_inherit(
2192+ rec, offsets, entry, node->update);
2193+
2194+@@ -2012,7 +2015,8 @@
2195+ the same transaction do not modify the record in the meantime.
2196+ Therefore we can assert that the restoration of the cursor succeeds. */
2197+
2198+- ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
2199++ ut_a(btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : BTR_MODIFY_TREE,
2200++ pcur, mtr));
2201+
2202+ ut_ad(!rec_get_deleted_flag(btr_pcur_get_rec(pcur),
2203+ dict_table_is_comp(index->table)));
2204+@@ -2022,7 +2026,8 @@
2205+ node->cmpl_info, thr, mtr);
2206+ mtr_commit(mtr);
2207+
2208+- if (err == DB_SUCCESS && big_rec) {
2209++ /* skip store extern for fake_changes */
2210++ if (err == DB_SUCCESS && big_rec && !(thr_get_trx(thr)->fake_changes)) {
2211+ ulint offsets_[REC_OFFS_NORMAL_SIZE];
2212+ rec_t* rec;
2213+ rec_offs_init(offsets_);
2214+@@ -2146,7 +2151,8 @@
2215+
2216+ ut_a(pcur->rel_pos == BTR_PCUR_ON);
2217+
2218+- success = btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur, mtr);
2219++ success = btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : BTR_MODIFY_LEAF,
2220++ pcur, mtr);
2221+
2222+ if (!success) {
2223+ err = DB_RECORD_NOT_FOUND;
2224+diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
2225+--- a/storage/innobase/trx/trx0trx.c 2011-06-01 21:04:26.411537237 +0900
2226++++ b/storage/innobase/trx/trx0trx.c 2011-06-01 21:04:53.756415956 +0900
2227+@@ -121,6 +121,8 @@
2228+
2229+ trx->support_xa = TRUE;
2230+
2231++ trx->fake_changes = FALSE;
2232++
2233+ trx->check_foreigns = TRUE;
2234+ trx->check_unique_secondary = TRUE;
2235+
2236
2237=== modified file 'innodb_fast_checksum.patch'
2238--- innodb_fast_checksum.patch 2011-05-10 11:57:42 +0000
2239+++ innodb_fast_checksum.patch 2011-06-20 09:04:39 +0000
2240@@ -109,8 +109,34 @@
2241 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
2242 --- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:52:23.406513743 +0900
2243 +++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:53:45.020513800 +0900
2244-@@ -3199,7 +3199,9 @@
2245- mach_write_to_8(page + FIL_PAGE_FILE_FLUSH_LSN, current_lsn);
2246+@@ -3094,13 +3094,24 @@
2247+ return(TRUE);
2248+ }
2249+
2250+- if (checksum_field != 0
2251++ if (!srv_fast_checksum
2252++ && checksum_field != 0
2253+ && checksum_field != BUF_NO_CHECKSUM_MAGIC
2254+ && checksum_field
2255+ != buf_calc_page_new_checksum(page)) {
2256+ return(TRUE);
2257+ }
2258+
2259++ if (srv_fast_checksum
2260++ && checksum_field != 0
2261++ && checksum_field != BUF_NO_CHECKSUM_MAGIC
2262++ && checksum_field
2263++ != buf_calc_page_new_checksum_32(page)
2264++ && checksum_field
2265++ != buf_calc_page_new_checksum(page)) {
2266++ return(TRUE);
2267++ }
2268++
2269+ return(FALSE);
2270+ }
2271+
2272+@@ -3116,7 +3127,9 @@
2273+ if (!zip_size) {
2274 mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
2275 srv_use_checksums
2276 - ? buf_calc_page_new_checksum(page)
2277@@ -120,45 +146,6 @@
2278 : BUF_NO_CHECKSUM_MAGIC);
2279 mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
2280 srv_use_checksums
2281-@@ -3331,7 +3333,8 @@
2282- page_is_corrupt = TRUE;
2283- }
2284-
2285-- if (checksum_field != 0
2286-+ if (!srv_fast_checksum
2287-+ && checksum_field != 0
2288- && checksum_field != BUF_NO_CHECKSUM_MAGIC
2289- && checksum_field
2290- != buf_calc_page_new_checksum(page)) {
2291-@@ -3339,6 +3342,17 @@
2292- page_is_corrupt = TRUE;
2293- }
2294-
2295-+ if (srv_fast_checksum
2296-+ && checksum_field != 0
2297-+ && checksum_field != BUF_NO_CHECKSUM_MAGIC
2298-+ && checksum_field
2299-+ != buf_calc_page_new_checksum_32(page)
2300-+ && checksum_field
2301-+ != buf_calc_page_new_checksum(page)) {
2302-+
2303-+ page_is_corrupt = TRUE;
2304-+ }
2305-+
2306- /* if it is free page, inconsistency is acceptable */
2307- if (!offset) {
2308- /* header page*/
2309-@@ -3484,7 +3498,9 @@
2310-
2311- mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
2312- srv_use_checksums
2313-- ? buf_calc_page_new_checksum(page)
2314-+ ? (!srv_fast_checksum
2315-+ ? buf_calc_page_new_checksum(page)
2316-+ : buf_calc_page_new_checksum_32(page))
2317- : BUF_NO_CHECKSUM_MAGIC);
2318- mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
2319- srv_use_checksums
2320 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
2321 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:52:23.420480329 +0900
2322 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:53:45.029551892 +0900
2323@@ -170,7 +157,7 @@
2324 static my_bool innobase_recovery_stats = TRUE;
2325 static my_bool innobase_locks_unsafe_for_binlog = FALSE;
2326 static my_bool innobase_overwrite_relay_log_info = FALSE;
2327-@@ -2606,6 +2607,7 @@
2328+@@ -2620,6 +2621,7 @@
2329
2330 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
2331 srv_use_checksums = (ibool) innobase_use_checksums;
2332@@ -178,7 +165,7 @@
2333
2334 #ifdef HAVE_LARGE_PAGES
2335 if ((os_use_large_pages = (ibool) my_use_large_pages))
2336-@@ -11414,6 +11416,15 @@
2337+@@ -11421,6 +11423,15 @@
2338 "Disable with --skip-innodb-checksums.",
2339 NULL, NULL, TRUE);
2340
2341@@ -194,7 +181,7 @@
2342 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
2343 PLUGIN_VAR_READONLY,
2344 "The common part for InnoDB table spaces.",
2345-@@ -11922,6 +11933,7 @@
2346+@@ -11930,6 +11941,7 @@
2347 MYSQL_SYSVAR(buffer_pool_size),
2348 MYSQL_SYSVAR(buffer_pool_instances),
2349 MYSQL_SYSVAR(checksums),
2350@@ -231,7 +218,7 @@
2351 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
2352 --- a/storage/innobase/include/srv0srv.h 2010-12-04 15:52:23.474482590 +0900
2353 +++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:53:45.048512100 +0900
2354-@@ -227,6 +227,7 @@
2355+@@ -224,6 +224,7 @@
2356
2357 extern ibool srv_use_doublewrite_buf;
2358 extern ibool srv_use_checksums;
2359@@ -291,7 +278,7 @@
2360 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
2361 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:52:23.498513634 +0900
2362 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:53:45.053550283 +0900
2363-@@ -420,6 +420,7 @@
2364+@@ -414,6 +414,7 @@
2365
2366 UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE;
2367 UNIV_INTERN ibool srv_use_checksums = TRUE;
2368
2369=== modified file 'innodb_files_extend.patch'
2370--- innodb_files_extend.patch 2011-05-10 11:57:42 +0000
2371+++ innodb_files_extend.patch 2011-06-20 09:04:39 +0000
2372@@ -8,7 +8,7 @@
2373 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
2374 --- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:21.358513751 +0900
2375 +++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:58.243481131 +0900
2376-@@ -729,7 +729,7 @@
2377+@@ -731,7 +731,7 @@
2378 ut_a(space->purpose != FIL_LOG);
2379 ut_a(!trx_sys_sys_space(space->id));
2380
2381@@ -17,16 +17,7 @@
2382 fprintf(stderr,
2383 "InnoDB: Error: the size of single-table"
2384 " tablespace file %s\n"
2385-@@ -3216,7 +3216,7 @@
2386-
2387- if (size_bytes < free_limit_bytes) {
2388- free_limit_bytes = size_bytes;
2389-- if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
2390-+ if (size_bytes >= (lint)FSP_EXTENT_SIZE * (lint)UNIV_PAGE_SIZE) {
2391- fprintf(stderr, "InnoDB: free limit of %s is larger than its real size.\n", filepath);
2392- file_is_corrupt = TRUE;
2393- }
2394-@@ -3830,7 +3830,7 @@
2395+@@ -4151,7 +4151,7 @@
2396
2397 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
2398 #ifndef UNIV_HOTBACKUP
2399@@ -35,7 +26,7 @@
2400 fprintf(stderr,
2401 "InnoDB: Error: the size of single-table tablespace"
2402 " file %s\n"
2403-@@ -3850,7 +3850,7 @@
2404+@@ -4171,7 +4171,7 @@
2405 /* Align the memory for file i/o if we might have O_DIRECT set */
2406 page = ut_align(buf2, UNIV_PAGE_SIZE);
2407
2408@@ -44,7 +35,7 @@
2409 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
2410
2411 /* We have to read the tablespace id from the file */
2412-@@ -4828,9 +4828,9 @@
2413+@@ -5149,9 +5149,9 @@
2414 ut_ad(ut_is_2pow(zip_size));
2415 ut_ad(buf);
2416 ut_ad(len > 0);
2417@@ -121,7 +112,7 @@
2418 static my_bool innobase_thread_concurrency_timer_based;
2419 static long long innobase_buffer_pool_size, innobase_log_file_size;
2420
2421-@@ -2302,6 +2305,65 @@
2422+@@ -2316,6 +2319,65 @@
2423 }
2424 #endif /* DBUG_OFF */
2425
2426@@ -187,7 +178,7 @@
2427 #ifndef MYSQL_SERVER
2428 innodb_overwrite_relay_log_info = FALSE;
2429 #endif
2430-@@ -7253,9 +7315,9 @@
2431+@@ -7241,9 +7303,9 @@
2432 | DICT_TF_COMPACT
2433 | DICT_TF_FORMAT_ZIP
2434 << DICT_TF_FORMAT_SHIFT;
2435@@ -200,7 +191,7 @@
2436 }
2437 }
2438
2439-@@ -11425,6 +11487,16 @@
2440+@@ -11432,6 +11494,16 @@
2441 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
2442 NULL, NULL, FALSE);
2443
2444@@ -217,7 +208,7 @@
2445 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
2446 PLUGIN_VAR_READONLY,
2447 "The common part for InnoDB table spaces.",
2448-@@ -11928,6 +12000,8 @@
2449+@@ -11936,6 +12008,8 @@
2450 NULL, NULL, 0, &corrupt_table_action_typelib);
2451
2452 static struct st_mysql_sys_var* innobase_system_variables[]= {
2453@@ -229,7 +220,7 @@
2454 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
2455 --- a/storage/innobase/include/buf0buf.h 2010-12-04 15:55:21.375482937 +0900
2456 +++ b/storage/innobase/include/buf0buf.h 2010-12-04 15:55:58.258469088 +0900
2457-@@ -1684,7 +1684,7 @@
2458+@@ -1683,7 +1683,7 @@
2459 time_t last_printout_time;
2460 /*!< when buf_print_io was last time
2461 called */
2462@@ -238,7 +229,7 @@
2463 /*!< Statistics of buddy system,
2464 indexed by block size */
2465 buf_pool_stat_t stat; /*!< current statistics */
2466-@@ -1780,7 +1780,7 @@
2467+@@ -1779,7 +1779,7 @@
2468 /* @{ */
2469 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
2470 /*!< unmodified compressed pages */
2471@@ -247,7 +238,7 @@
2472 /*!< buddy free lists */
2473
2474 buf_page_t watch[BUF_POOL_WATCH_SIZE];
2475-@@ -1788,9 +1788,9 @@
2476+@@ -1787,9 +1787,9 @@
2477 pool watches. Protected by
2478 buf_pool->mutex. */
2479
2480@@ -379,7 +370,7 @@
2481 diff -ruN a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
2482 --- a/storage/innobase/include/univ.i 2010-11-03 07:01:13.000000000 +0900
2483 +++ b/storage/innobase/include/univ.i 2010-12-04 15:55:58.263549721 +0900
2484-@@ -298,9 +298,13 @@
2485+@@ -311,9 +311,13 @@
2486 */
2487
2488 /* The 2-logarithm of UNIV_PAGE_SIZE: */
2489@@ -395,7 +386,7 @@
2490
2491 /* Maximum number of parallel threads in a parallelized operation */
2492 #define UNIV_MAX_PARALLELISM 32
2493-@@ -419,7 +423,7 @@
2494+@@ -432,7 +436,7 @@
2495 stored part of the field in the tablespace. The length field then
2496 contains the sum of the following flag and the locally stored len. */
2497
2498@@ -404,7 +395,7 @@
2499
2500 /* Some macros to improve branch prediction and reduce cache misses */
2501 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
2502-@@ -522,4 +526,6 @@
2503+@@ -535,4 +539,6 @@
2504 UNIV_MEM_ALLOC(addr, size); \
2505 } while (0)
2506
2507@@ -547,7 +538,7 @@
2508 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
2509 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:21.384486344 +0900
2510 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:58.282550845 +0900
2511-@@ -240,6 +240,13 @@
2512+@@ -234,6 +234,13 @@
2513 UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;
2514 UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;
2515
2516
2517=== modified file 'innodb_fix_misc.patch'
2518--- innodb_fix_misc.patch 2011-05-18 00:03:53 +0000
2519+++ innodb_fix_misc.patch 2011-06-20 09:04:39 +0000
2520@@ -13,7 +13,7 @@
2521 diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
2522 --- a/storage/innobase/buf/buf0buf.c 2011-02-23 19:00:48.178696354 +0900
2523 +++ b/storage/innobase/buf/buf0buf.c 2011-02-23 19:01:19.138826278 +0900
2524-@@ -4063,6 +4063,7 @@
2525+@@ -4061,6 +4061,7 @@
2526 bpage->state = BUF_BLOCK_ZIP_PAGE;
2527 bpage->space = space;
2528 bpage->offset = offset;
2529@@ -102,7 +102,7 @@
2530 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
2531 --- a/storage/innobase/fil/fil0fil.c 2011-02-23 19:00:48.223696428 +0900
2532 +++ b/storage/innobase/fil/fil0fil.c 2011-02-23 19:01:19.147655510 +0900
2533-@@ -252,6 +252,7 @@
2534+@@ -254,6 +254,7 @@
2535 struct fil_system_struct {
2536 #ifndef UNIV_HOTBACKUP
2537 mutex_t mutex; /*!< The mutex protecting the cache */
2538@@ -110,7 +110,7 @@
2539 #endif /* !UNIV_HOTBACKUP */
2540 hash_table_t* spaces; /*!< The hash table of spaces in the
2541 system; they are hashed on the space
2542-@@ -861,7 +862,7 @@
2543+@@ -863,7 +864,7 @@
2544 ut_ad(node && system);
2545 ut_ad(mutex_own(&(system->mutex)));
2546 ut_a(node->open);
2547@@ -119,7 +119,7 @@
2548 ut_a(node->n_pending_flushes == 0);
2549 ut_a(node->modification_counter == node->flush_counter);
2550
2551-@@ -874,7 +875,7 @@
2552+@@ -876,7 +877,7 @@
2553 ut_a(system->n_open > 0);
2554 system->n_open--;
2555
2556@@ -128,7 +128,7 @@
2557 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);
2558
2559 /* The node is in the LRU list, remove it */
2560-@@ -1073,7 +1074,7 @@
2561+@@ -1075,7 +1076,7 @@
2562 ut_ad(node && system && space);
2563 ut_ad(mutex_own(&(system->mutex)));
2564 ut_a(node->magic_n == FIL_NODE_MAGIC_N);
2565@@ -137,7 +137,7 @@
2566
2567 if (node->open) {
2568 /* We fool the assertion in fil_node_close_file() to think
2569-@@ -1595,6 +1596,8 @@
2570+@@ -1597,6 +1598,8 @@
2571
2572 mutex_create(fil_system_mutex_key,
2573 &fil_system->mutex, SYNC_ANY_LATCH);
2574@@ -146,7 +146,7 @@
2575
2576 fil_system->spaces = hash_create(hash_size);
2577 fil_system->name_hash = hash_create(hash_size);
2578-@@ -2341,7 +2344,11 @@
2579+@@ -2343,7 +2346,11 @@
2580 completely and permanently. The flag is_being_deleted also prevents
2581 fil_flush() from being applied to this tablespace. */
2582
2583@@ -158,7 +158,7 @@
2584 #endif
2585 /* printf("Deleting tablespace %s id %lu\n", space->name, id); */
2586
2587-@@ -4400,6 +4407,10 @@
2588+@@ -4721,6 +4728,10 @@
2589 ulint page_size;
2590 ibool success = TRUE;
2591
2592@@ -169,7 +169,7 @@
2593 fil_mutex_enter_and_prepare_for_io(space_id);
2594
2595 space = fil_space_get_by_id(space_id);
2596-@@ -4411,6 +4422,7 @@
2597+@@ -4732,6 +4743,7 @@
2598 *actual_size = space->size;
2599
2600 mutex_exit(&fil_system->mutex);
2601@@ -177,7 +177,7 @@
2602
2603 return(TRUE);
2604 }
2605-@@ -4443,6 +4455,8 @@
2606+@@ -4764,6 +4776,8 @@
2607 offset_low = ((start_page_no - file_start_page_no)
2608 % (4096 * ((1024 * 1024) / page_size)))
2609 * page_size;
2610@@ -186,7 +186,7 @@
2611 #ifdef UNIV_HOTBACKUP
2612 success = os_file_write(node->name, node->handle, buf,
2613 offset_low, offset_high,
2614-@@ -4452,8 +4466,10 @@
2615+@@ -4773,8 +4787,10 @@
2616 node->name, node->handle, buf,
2617 offset_low, offset_high,
2618 page_size * n_pages,
2619@@ -198,7 +198,7 @@
2620 if (success) {
2621 node->size += n_pages;
2622 space->size += n_pages;
2623-@@ -4499,6 +4515,7 @@
2624+@@ -4820,6 +4836,7 @@
2625 printf("Extended %s to %lu, actual size %lu pages\n", space->name,
2626 size_after_extend, *actual_size); */
2627 mutex_exit(&fil_system->mutex);
2628@@ -206,7 +206,7 @@
2629
2630 fil_flush(space_id);
2631
2632-@@ -4861,6 +4878,22 @@
2633+@@ -5182,6 +5199,22 @@
2634 srv_data_written+= len;
2635 }
2636
2637@@ -216,7 +216,7 @@
2638 + && ((buf_page_t*)message)->space_was_being_deleted) {
2639 +
2640 + if (mode == OS_AIO_NORMAL) {
2641-+ buf_page_io_complete(message, trx);
2642++ buf_page_io_complete(message);
2643 + return(DB_SUCCESS); /*fake*/
2644 + }
2645 + if (type == OS_FILE_READ) {
2646@@ -229,7 +229,7 @@
2647 /* Reserve the fil_system mutex and make sure that we can open at
2648 least one file while holding it, if the file is not already open */
2649
2650-@@ -4990,10 +5023,24 @@
2651+@@ -5323,10 +5356,24 @@
2652 #else
2653 /* Queue the aio request */
2654 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
2655@@ -255,7 +255,7 @@
2656 ut_a(ret);
2657
2658 if (mode == OS_AIO_SYNC) {
2659-@@ -5093,6 +5140,7 @@
2660+@@ -5426,6 +5473,7 @@
2661 fil_node_t* fil_node;
2662 void* message;
2663 ulint type;
2664@@ -263,7 +263,7 @@
2665
2666 ut_ad(fil_validate_skip());
2667
2668-@@ -5100,10 +5148,10 @@
2669+@@ -5433,10 +5481,10 @@
2670 srv_set_io_thread_op_info(segment, "native aio handle");
2671 #ifdef WIN_ASYNC_IO
2672 ret = os_aio_windows_handle(segment, 0, &fil_node,
2673@@ -274,9 +274,9 @@
2674 - &message, &type);
2675 + &message, &type, &space_id);
2676 #else
2677+ ut_error;
2678 ret = 0; /* Eliminate compiler warning */
2679- ut_error;
2680-@@ -5112,7 +5160,22 @@
2681+@@ -5445,7 +5493,22 @@
2682 srv_set_io_thread_op_info(segment, "simulated aio handle");
2683
2684 ret = os_aio_simulated_handle(segment, &fil_node,
2685@@ -295,7 +295,7 @@
2686 + || buf_page_get_state(message) != BUF_BLOCK_FILE_PAGE);
2687 +
2688 + srv_set_io_thread_op_info(segment, "complete io for buf page");
2689-+ buf_page_io_complete(message, NULL);
2690++ buf_page_io_complete(message);
2691 + return;
2692 }
2693
2694@@ -303,7 +303,7 @@
2695 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
2696 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:57:13.035513990 +0900
2697 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:57:53.084513775 +0900
2698-@@ -11999,6 +11999,12 @@
2699+@@ -12007,6 +12007,12 @@
2700 "except for the deletion.",
2701 NULL, NULL, 0, &corrupt_table_action_typelib);
2702
2703@@ -316,7 +316,7 @@
2704 static struct st_mysql_sys_var* innobase_system_variables[]= {
2705 MYSQL_SYSVAR(page_size),
2706 MYSQL_SYSVAR(log_block_size),
2707-@@ -12089,6 +12095,7 @@
2708+@@ -12097,6 +12103,7 @@
2709 MYSQL_SYSVAR(purge_batch_size),
2710 MYSQL_SYSVAR(rollback_segments),
2711 MYSQL_SYSVAR(corrupt_table_action),
2712@@ -324,7 +324,7 @@
2713 NULL
2714 };
2715
2716-@@ -12098,7 +12105,7 @@
2717+@@ -12106,7 +12113,7 @@
2718 &innobase_storage_engine,
2719 innobase_hton_name,
2720 plugin_author,
2721@@ -336,7 +336,7 @@
2722 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
2723 --- a/storage/innobase/include/buf0buf.h 2011-02-23 19:00:48.252696774 +0900
2724 +++ b/storage/innobase/include/buf0buf.h 2011-02-23 19:01:19.182655902 +0900
2725-@@ -1439,6 +1439,7 @@
2726+@@ -1438,6 +1438,7 @@
2727 0 if the block was never accessed
2728 in the buffer pool */
2729 /* @} */
2730@@ -468,7 +468,7 @@
2731 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
2732 --- a/storage/innobase/include/srv0srv.h 2011-02-23 19:00:48.212625715 +0900
2733 +++ b/storage/innobase/include/srv0srv.h 2011-02-23 19:01:19.193655990 +0900
2734-@@ -247,6 +247,8 @@
2735+@@ -244,6 +244,8 @@
2736 extern ulint srv_pass_corrupt_table;
2737
2738 extern ulint srv_dict_size_limit;
2739@@ -480,7 +480,7 @@
2740 diff -ruN a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
2741 --- a/storage/innobase/include/sync0sync.h 2011-02-23 19:00:47.875625940 +0900
2742 +++ b/storage/innobase/include/sync0sync.h 2011-02-23 19:01:19.195703856 +0900
2743-@@ -682,6 +682,7 @@
2744+@@ -691,6 +691,7 @@
2745 #define SYNC_BUF_POOL 150 /* Buffer pool mutex */
2746 #define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */
2747 #define SYNC_DOUBLEWRITE 140
2748@@ -493,7 +493,7 @@
2749 +++ b/storage/innobase/include/univ.i 2010-12-04 15:57:53.091592933 +0900
2750 @@ -53,6 +53,11 @@
2751 #define INNODB_VERSION_MINOR 1
2752- #define INNODB_VERSION_BUGFIX 6
2753+ #define INNODB_VERSION_BUGFIX 7
2754
2755 +#ifndef PERCONA_INNODB_VERSION
2756 +#define PERCONA_INNODB_VERSION 20.1
2757@@ -550,7 +550,7 @@
2758 trx_t* trx)
2759 {
2760 os_aio_array_t* array;
2761-@@ -4137,7 +4141,7 @@
2762+@@ -4139,7 +4143,7 @@
2763 trx->io_read += n;
2764 }
2765 slot = os_aio_array_reserve_slot(type, array, message1, message2, file,
2766@@ -559,7 +559,7 @@
2767 if (type == OS_FILE_READ) {
2768 if (srv_use_native_aio) {
2769 os_n_file_reads++;
2770-@@ -4256,7 +4260,8 @@
2771+@@ -4258,7 +4262,8 @@
2772 parameters are valid and can be used to
2773 restart the operation, for example */
2774 void** message2,
2775@@ -569,7 +569,7 @@
2776 {
2777 ulint orig_seg = segment;
2778 os_aio_array_t* array;
2779-@@ -4329,6 +4334,7 @@
2780+@@ -4337,6 +4342,7 @@
2781 *message2 = slot->message2;
2782
2783 *type = slot->type;
2784@@ -577,7 +577,7 @@
2785
2786 if (ret && len == slot->len) {
2787 ret_val = TRUE;
2788-@@ -4569,7 +4575,8 @@
2789+@@ -4565,7 +4571,8 @@
2790 aio operation failed, these output
2791 parameters are valid and can be used to
2792 restart the operation. */
2793@@ -587,7 +587,7 @@
2794 {
2795 ulint segment;
2796 os_aio_array_t* array;
2797-@@ -4627,6 +4634,7 @@
2798+@@ -4638,6 +4645,7 @@
2799 *message2 = slot->message2;
2800
2801 *type = slot->type;
2802@@ -595,7 +595,7 @@
2803
2804 if ((slot->ret == 0) && (slot->n_bytes == (long)slot->len)) {
2805 ret = TRUE;
2806-@@ -4680,7 +4688,8 @@
2807+@@ -4691,7 +4699,8 @@
2808 parameters are valid and can be used to
2809 restart the operation, for example */
2810 void** message2,
2811@@ -605,7 +605,7 @@
2812 {
2813 os_aio_array_t* array;
2814 ulint segment;
2815-@@ -4958,6 +4967,7 @@
2816+@@ -4987,6 +4996,7 @@
2817 *message2 = slot->message2;
2818
2819 *type = slot->type;
2820@@ -624,7 +624,7 @@
2821
2822 /** Provide optional 4.x backwards compatibility for 5.0 and above */
2823 UNIV_INTERN ibool row_rollback_on_timeout = FALSE;
2824-@@ -1194,6 +1195,13 @@
2825+@@ -1191,6 +1192,13 @@
2826
2827 thr = que_fork_get_first_thr(prebuilt->ins_graph);
2828
2829@@ -649,7 +649,7 @@
2830
2831 rec_offs_init(offsets_);
2832
2833-@@ -3732,6 +3733,17 @@
2834+@@ -3737,6 +3738,17 @@
2835
2836 /* Do some start-of-statement preparations */
2837
2838@@ -667,7 +667,7 @@
2839 if (!prebuilt->sql_stat_start) {
2840 /* No need to set an intention lock or assign a read view */
2841
2842-@@ -3742,6 +3754,18 @@
2843+@@ -3747,6 +3759,18 @@
2844 " perform a consistent read\n"
2845 "InnoDB: but the read view is not assigned!\n",
2846 stderr);
2847@@ -689,7 +689,7 @@
2848 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
2849 --- a/storage/innobase/srv/srv0srv.c 2011-02-23 19:00:48.283695497 +0900
2850 +++ b/storage/innobase/srv/srv0srv.c 2011-02-23 19:01:19.204696643 +0900
2851-@@ -447,6 +447,8 @@
2852+@@ -441,6 +441,8 @@
2853 UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */
2854
2855 UNIV_INTERN ulint srv_dict_size_limit = 0;
2856@@ -713,7 +713,7 @@
2857 diff -ruN a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
2858 --- a/storage/innobase/sync/sync0sync.c 2011-02-25 14:18:55.817202060 +0900
2859 +++ b/storage/innobase/sync/sync0sync.c 2011-02-25 14:19:44.596202017 +0900
2860-@@ -1175,6 +1175,7 @@
2861+@@ -1220,6 +1220,7 @@
2862 case SYNC_LOG_FLUSH_ORDER:
2863 case SYNC_THR_LOCAL:
2864 case SYNC_ANY_LATCH:
2865
2866=== modified file 'innodb_io_patches.patch'
2867--- innodb_io_patches.patch 2011-05-10 11:57:42 +0000
2868+++ innodb_io_patches.patch 2011-06-20 09:04:39 +0000
2869@@ -84,7 +84,7 @@
2870 /********************************************************************//**
2871 Obtain the InnoDB transaction of a MySQL thread.
2872 @return reference to transaction pointer */
2873-@@ -2423,6 +2440,9 @@
2874+@@ -2437,6 +2454,9 @@
2875 srv_n_read_io_threads = (ulint) innobase_read_io_threads;
2876 srv_n_write_io_threads = (ulint) innobase_write_io_threads;
2877
2878@@ -94,7 +94,7 @@
2879 srv_force_recovery = (ulint) innobase_force_recovery;
2880
2881 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
2882-@@ -11018,7 +11038,7 @@
2883+@@ -11025,7 +11045,7 @@
2884 PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
2885 "Purge threads can be either 0 or 1.",
2886 NULL, NULL,
2887@@ -103,7 +103,7 @@
2888 0, /* Minimum value */
2889 1, 0); /* Maximum value */
2890
2891-@@ -11060,12 +11080,18 @@
2892+@@ -11067,12 +11087,18 @@
2893 innodb_file_format_max_validate,
2894 innodb_file_format_max_update, "Antelope");
2895
2896@@ -128,7 +128,7 @@
2897
2898 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
2899 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
2900-@@ -11160,7 +11186,7 @@
2901+@@ -11167,7 +11193,7 @@
2902 static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
2903 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
2904 "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
2905@@ -137,7 +137,7 @@
2906
2907 static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances,
2908 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
2909-@@ -11312,6 +11338,95 @@
2910+@@ -11319,6 +11345,95 @@
2911 "trigger a readahead.",
2912 NULL, NULL, 56, 0, 64, 0);
2913
2914@@ -233,7 +233,7 @@
2915 static struct st_mysql_sys_var* innobase_system_variables[]= {
2916 MYSQL_SYSVAR(additional_mem_pool_size),
2917 MYSQL_SYSVAR(autoextend_increment),
2918-@@ -11332,6 +11447,7 @@
2919+@@ -11339,6 +11454,7 @@
2920 MYSQL_SYSVAR(file_format_check),
2921 MYSQL_SYSVAR(file_format_max),
2922 MYSQL_SYSVAR(flush_log_at_trx_commit),
2923@@ -241,7 +241,7 @@
2924 MYSQL_SYSVAR(flush_method),
2925 MYSQL_SYSVAR(force_recovery),
2926 MYSQL_SYSVAR(locks_unsafe_for_binlog),
2927-@@ -11369,6 +11485,13 @@
2928+@@ -11376,6 +11492,13 @@
2929 MYSQL_SYSVAR(show_verbose_locks),
2930 MYSQL_SYSVAR(show_locks_held),
2931 MYSQL_SYSVAR(version),
2932@@ -271,7 +271,7 @@
2933
2934 mutex_create(ibuf_pessimistic_insert_mutex_key,
2935 &ibuf_pessimistic_insert_mutex,
2936-@@ -2764,9 +2766,11 @@
2937+@@ -2753,9 +2755,11 @@
2938 size = ibuf->size;
2939 max_size = ibuf->max_size;
2940
2941@@ -299,7 +299,7 @@
2942 diff -ruN a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
2943 --- a/storage/innobase/include/ha_prototypes.h 2010-11-03 07:01:13.000000000 +0900
2944 +++ b/storage/innobase/include/ha_prototypes.h 2010-12-03 15:10:09.078026360 +0900
2945-@@ -284,5 +284,12 @@
2946+@@ -284,6 +284,13 @@
2947 /*===================*/
2948 void* thd, /*!< in: thread handle (THD*) */
2949 ulint value); /*!< in: time waited for the lock */
2950@@ -311,11 +311,12 @@
2951 +/*================================*/
2952 + void* thd);
2953
2954- #endif
2955+ /**********************************************************************//**
2956+ Get the current setting of the lower_case_table_names global parameter from
2957 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
2958 --- a/storage/innobase/include/srv0srv.h 2010-12-03 15:09:51.291955835 +0900
2959 +++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:10:09.079029047 +0900
2960-@@ -141,7 +141,8 @@
2961+@@ -138,7 +138,8 @@
2962 extern ulint srv_n_log_files;
2963 extern ulint srv_log_file_size;
2964 extern ulint srv_log_buffer_size;
2965@@ -325,7 +326,7 @@
2966 extern char srv_adaptive_flushing;
2967
2968
2969-@@ -219,6 +220,16 @@
2970+@@ -216,6 +217,16 @@
2971 extern ulong srv_max_purge_lag;
2972
2973 extern ulong srv_replication_delay;
2974@@ -342,7 +343,7 @@
2975 /*-------------------------------------------*/
2976
2977 extern ulint srv_n_rows_inserted;
2978-@@ -397,8 +408,9 @@
2979+@@ -394,8 +405,9 @@
2980 when writing data files, but do flush
2981 after writing to log files */
2982 SRV_UNIX_NOSYNC, /*!< do not flush after writing */
2983@@ -540,7 +541,7 @@
2984 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
2985 --- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:09:51.301987792 +0900
2986 +++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:13:29.369986988 +0900
2987-@@ -189,7 +189,8 @@
2988+@@ -183,7 +183,8 @@
2989 UNIV_INTERN ulint srv_log_file_size = ULINT_MAX;
2990 /* size in database pages */
2991 UNIV_INTERN ulint srv_log_buffer_size = ULINT_MAX;
2992@@ -550,7 +551,7 @@
2993
2994 /* Try to flush dirty pages so as to avoid IO bursts at
2995 the checkpoints. */
2996-@@ -408,6 +409,17 @@
2997+@@ -402,6 +403,17 @@
2998
2999 UNIV_INTERN ulong srv_replication_delay = 0;
3000
3001@@ -568,7 +569,7 @@
3002 /*-------------------------------------------*/
3003 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
3004 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
3005-@@ -2733,6 +2745,7 @@
3006+@@ -2742,6 +2754,7 @@
3007 ulint n_pages_purged = 0;
3008 ulint n_bytes_merged;
3009 ulint n_pages_flushed;
3010@@ -576,7 +577,7 @@
3011 ulint n_bytes_archived;
3012 ulint n_tables_to_drop;
3013 ulint n_ios;
3014-@@ -2740,7 +2753,20 @@
3015+@@ -2749,7 +2762,20 @@
3016 ulint n_ios_very_old;
3017 ulint n_pend_ios;
3018 ulint next_itr_time;
3019@@ -597,7 +598,7 @@
3020
3021 #ifdef UNIV_DEBUG_THREAD_CREATION
3022 fprintf(stderr, "Master thread starts, id %lu\n",
3023-@@ -2762,6 +2788,9 @@
3024+@@ -2771,6 +2797,9 @@
3025
3026 mutex_exit(&kernel_mutex);
3027
3028@@ -607,7 +608,7 @@
3029 loop:
3030 /*****************************************************************/
3031 /* ---- When there is database activity by users, we cycle in this
3032-@@ -2792,9 +2821,13 @@
3033+@@ -2801,9 +2830,13 @@
3034 /* Sleep for 1 second on entrying the for loop below the first time. */
3035 next_itr_time = ut_time_ms() + 1000;
3036
3037@@ -621,7 +622,7 @@
3038 /* ALTER TABLE in MySQL requires on Unix that the table handler
3039 can drop tables lazily after there no longer are SELECT
3040 queries to them. */
3041-@@ -2818,6 +2851,7 @@
3042+@@ -2827,6 +2860,7 @@
3043 srv_main_thread_op_info = "sleeping";
3044 srv_main_1_second_loops++;
3045
3046@@ -629,7 +630,7 @@
3047 if (next_itr_time > cur_time
3048 && srv_shutdown_state == SRV_SHUTDOWN_NONE) {
3049
3050-@@ -2828,10 +2862,26 @@
3051+@@ -2837,10 +2871,26 @@
3052 (next_itr_time - cur_time)
3053 * 1000));
3054 srv_main_sleeps++;
3055@@ -656,7 +657,7 @@
3056
3057 /* Flush logs if needed */
3058 srv_sync_log_buffer_in_background();
3059-@@ -2851,7 +2901,7 @@
3060+@@ -2860,7 +2910,7 @@
3061 if (n_pend_ios < SRV_PEND_IO_THRESHOLD
3062 && (n_ios - n_ios_old < SRV_RECENT_IO_ACTIVITY)) {
3063 srv_main_thread_op_info = "doing insert buffer merge";
3064@@ -665,7 +666,7 @@
3065
3066 /* Flush logs if needed */
3067 srv_sync_log_buffer_in_background();
3068-@@ -2868,7 +2918,11 @@
3069+@@ -2877,7 +2927,11 @@
3070 n_pages_flushed = buf_flush_list(
3071 PCT_IO(100), IB_ULONGLONG_MAX);
3072
3073@@ -678,7 +679,7 @@
3074
3075 /* Try to keep the rate of flushing of dirty
3076 pages such that redo log generation does not
3077-@@ -2884,6 +2938,224 @@
3078+@@ -2893,6 +2947,224 @@
3079 n_flush,
3080 IB_ULONGLONG_MAX);
3081 }
3082@@ -903,7 +904,7 @@
3083 }
3084
3085 if (srv_activity_count == old_activity_count) {
3086-@@ -2932,7 +3204,7 @@
3087+@@ -2941,7 +3213,7 @@
3088 even if the server were active */
3089
3090 srv_main_thread_op_info = "doing insert buffer merge";
3091@@ -912,7 +913,7 @@
3092
3093 /* Flush logs if needed */
3094 srv_sync_log_buffer_in_background();
3095-@@ -3040,7 +3312,7 @@
3096+@@ -3049,7 +3321,7 @@
3097 buf_flush_list below. Otherwise, the system favors
3098 clean pages over cleanup throughput. */
3099 n_bytes_merged = ibuf_contract_for_n_pages(FALSE,
3100@@ -921,7 +922,7 @@
3101 }
3102
3103 srv_main_thread_op_info = "reserving kernel mutex";
3104-@@ -3184,6 +3456,7 @@
3105+@@ -3189,6 +3461,7 @@
3106 srv_slot_t* slot;
3107 ulint retries = 0;
3108 ulint n_total_purged = ULINT_UNDEFINED;
3109@@ -929,7 +930,7 @@
3110
3111 ut_a(srv_n_purge_threads == 1);
3112
3113-@@ -3204,9 +3477,12 @@
3114+@@ -3209,9 +3482,12 @@
3115
3116 mutex_exit(&kernel_mutex);
3117
3118@@ -942,7 +943,7 @@
3119
3120 /* If there are very few records to purge or the last
3121 purge didn't purge any records then wait for activity.
3122-@@ -3253,6 +3529,16 @@
3123+@@ -3258,6 +3534,16 @@
3124 } while (n_pages_purged > 0 && !srv_fast_shutdown);
3125
3126 srv_sync_log_buffer_in_background();
3127@@ -991,7 +992,7 @@
3128 diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
3129 --- a/storage/innobase/trx/trx0trx.c 2010-11-03 07:01:13.000000000 +0900
3130 +++ b/storage/innobase/trx/trx0trx.c 2010-12-03 15:10:09.106023937 +0900
3131-@@ -924,6 +924,7 @@
3132+@@ -984,6 +984,7 @@
3133 trx->read_view = NULL;
3134
3135 if (lsn) {
3136@@ -999,7 +1000,7 @@
3137
3138 mutex_exit(&kernel_mutex);
3139
3140-@@ -932,6 +933,12 @@
3141+@@ -992,6 +993,12 @@
3142 trx_undo_insert_cleanup(trx);
3143 }
3144
3145@@ -1012,7 +1013,7 @@
3146 /* NOTE that we could possibly make a group commit more
3147 efficient here: call os_thread_yield here to allow also other
3148 trxs to come to commit! */
3149-@@ -963,9 +970,9 @@
3150+@@ -1023,9 +1030,9 @@
3151 if (trx->flush_log_later) {
3152 /* Do nothing yet */
3153 trx->must_flush_log_later = TRUE;
3154@@ -1024,7 +1025,7 @@
3155 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
3156 /* Write the log but do not flush it to disk */
3157
3158-@@ -977,7 +984,7 @@
3159+@@ -1037,7 +1044,7 @@
3160
3161 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
3162 }
3163@@ -1033,7 +1034,7 @@
3164
3165 /* Write the log but do not flush it to disk */
3166
3167-@@ -1641,16 +1648,23 @@
3168+@@ -1701,16 +1708,23 @@
3169 trx_t* trx) /*!< in: trx handle */
3170 {
3171 ib_uint64_t lsn = trx->commit_lsn;
3172@@ -1059,7 +1060,7 @@
3173 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
3174 /* Write the log but do not flush it to disk */
3175
3176-@@ -1661,7 +1675,7 @@
3177+@@ -1721,7 +1735,7 @@
3178
3179 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
3180 }
3181@@ -1068,7 +1069,7 @@
3182
3183 /* Write the log but do not flush it to disk */
3184
3185-@@ -1914,6 +1928,8 @@
3186+@@ -1969,6 +1983,8 @@
3187 /*--------------------------------------*/
3188
3189 if (lsn) {
3190@@ -1077,7 +1078,7 @@
3191 /* Depending on the my.cnf options, we may now write the log
3192 buffer to the log files, making the prepared state of the
3193 transaction durable if the OS does not crash. We may also
3194-@@ -1933,9 +1949,15 @@
3195+@@ -1988,9 +2004,15 @@
3196
3197 mutex_exit(&kernel_mutex);
3198
3199@@ -1095,7 +1096,7 @@
3200 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
3201 /* Write the log but do not flush it to disk */
3202
3203-@@ -1947,7 +1969,7 @@
3204+@@ -2002,7 +2024,7 @@
3205
3206 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
3207 }
3208
3209=== modified file 'innodb_lru_dump_restore.patch'
3210--- innodb_lru_dump_restore.patch 2011-05-10 11:57:42 +0000
3211+++ innodb_lru_dump_restore.patch 2011-06-20 09:04:39 +0000
3212@@ -8,7 +8,7 @@
3213 diff -ruN a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
3214 --- a/storage/innobase/buf/buf0lru.c 2010-12-03 15:49:59.185023424 +0900
3215 +++ b/storage/innobase/buf/buf0lru.c 2010-12-04 15:33:37.626482350 +0900
3216-@@ -2245,6 +2245,284 @@
3217+@@ -2247,6 +2247,284 @@
3218 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);
3219 }
3220
3221@@ -308,7 +308,7 @@
3222 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
3223 --- a/storage/innobase/fil/fil0fil.c 2010-12-03 17:49:11.581025127 +0900
3224 +++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:33:37.632482885 +0900
3225-@@ -4965,6 +4965,70 @@
3226+@@ -5289,6 +5289,70 @@
3227 return(DB_SUCCESS);
3228 }
3229
3230@@ -382,7 +382,7 @@
3231 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
3232 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:49:11.589956135 +0900
3233 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:33:37.645555490 +0900
3234-@@ -11786,6 +11786,12 @@
3235+@@ -11793,6 +11793,12 @@
3236 "Limit the allocated memory for dictionary cache. (0: unlimited)",
3237 NULL, NULL, 0, 0, LONG_MAX, 0);
3238
3239@@ -395,7 +395,7 @@
3240 static struct st_mysql_sys_var* innobase_system_variables[]= {
3241 MYSQL_SYSVAR(additional_mem_pool_size),
3242 MYSQL_SYSVAR(autoextend_increment),
3243-@@ -11867,6 +11873,7 @@
3244+@@ -11874,6 +11880,7 @@
3245 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
3246 MYSQL_SYSVAR(read_ahead_threshold),
3247 MYSQL_SYSVAR(io_capacity),
3248@@ -535,7 +535,7 @@
3249 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
3250 --- a/storage/innobase/include/srv0srv.h 2010-12-03 17:49:11.603969747 +0900
3251 +++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:33:37.685550816 +0900
3252-@@ -359,6 +359,9 @@
3253+@@ -356,6 +356,9 @@
3254 reading of a disk page */
3255 extern ulint srv_buf_pool_reads;
3256
3257@@ -545,7 +545,7 @@
3258 /** Status variables to be passed to MySQL */
3259 typedef struct export_var_struct export_struc;
3260
3261-@@ -664,6 +667,16 @@
3262+@@ -661,6 +664,16 @@
3263 /*=====================*/
3264 void* arg); /*!< in: a dummy parameter required by
3265 os_thread_create */
3266@@ -565,7 +565,7 @@
3267 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
3268 --- a/storage/innobase/srv/srv0srv.c 2010-12-03 17:49:11.620986661 +0900
3269 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:33:37.708550811 +0900
3270-@@ -336,6 +336,9 @@
3271+@@ -330,6 +330,9 @@
3272 reading of a disk page */
3273 UNIV_INTERN ulint srv_buf_pool_reads = 0;
3274
3275@@ -575,7 +575,7 @@
3276 /* structure to pass status variables to MySQL */
3277 UNIV_INTERN export_struc export_vars;
3278
3279-@@ -2691,6 +2694,56 @@
3280+@@ -2701,6 +2704,56 @@
3281 /* We count the number of threads in os_thread_exit(). A created
3282 thread should always use that to exit and not use return() to exit. */
3283
3284
3285=== modified file 'innodb_overwrite_relay_log_info.patch'
3286--- innodb_overwrite_relay_log_info.patch 2011-05-10 11:57:42 +0000
3287+++ innodb_overwrite_relay_log_info.patch 2011-06-20 09:04:39 +0000
3288@@ -56,7 +56,7 @@
3289 static my_bool innobase_rollback_on_timeout = FALSE;
3290 static my_bool innobase_create_status_file = FALSE;
3291 static my_bool innobase_stats_on_metadata = TRUE;
3292-@@ -2234,6 +2254,89 @@
3293+@@ -2248,6 +2268,89 @@
3294 }
3295 #endif /* DBUG_OFF */
3296
3297@@ -146,7 +146,7 @@
3298 /* Check that values don't overflow on 32-bit systems. */
3299 if (sizeof(ulint) == 4) {
3300 if (innobase_buffer_pool_size > UINT_MAX32) {
3301-@@ -2532,6 +2635,76 @@
3302+@@ -2546,6 +2649,76 @@
3303 goto mem_free_and_error;
3304 }
3305
3306@@ -223,7 +223,7 @@
3307 innobase_old_blocks_pct = buf_LRU_old_ratio_update(
3308 innobase_old_blocks_pct, TRUE);
3309
3310-@@ -2644,6 +2817,25 @@
3311+@@ -2658,6 +2831,25 @@
3312 trx_t* trx) /*!< in: transaction handle */
3313 {
3314 if (trx_is_started(trx)) {
3315@@ -249,7 +249,7 @@
3316
3317 trx_commit_for_mysql(trx);
3318 }
3319-@@ -11007,6 +11199,12 @@
3320+@@ -11014,6 +11206,12 @@
3321 "The common part for InnoDB table spaces.",
3322 NULL, NULL, NULL);
3323
3324@@ -262,7 +262,7 @@
3325 static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
3326 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
3327 "Enable InnoDB doublewrite buffer (enabled by default). "
3328-@@ -11467,6 +11665,7 @@
3329+@@ -11474,6 +11672,7 @@
3330 MYSQL_SYSVAR(old_blocks_pct),
3331 MYSQL_SYSVAR(old_blocks_time),
3332 MYSQL_SYSVAR(open_files),
3333@@ -312,7 +312,7 @@
3334 diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
3335 --- a/storage/innobase/include/trx0trx.h 2010-12-03 15:18:48.894955550 +0900
3336 +++ b/storage/innobase/include/trx0trx.h 2010-12-03 15:38:20.323953416 +0900
3337-@@ -569,6 +569,21 @@
3338+@@ -580,6 +580,20 @@
3339 ib_int64_t mysql_log_offset;/* if MySQL binlog is used, this field
3340 contains the end offset of the binlog
3341 entry */
3342@@ -330,14 +330,13 @@
3343 + replication has processed */
3344 + const char* mysql_relay_log_file_name;
3345 + ib_int64_t mysql_relay_log_pos;
3346-+
3347- os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
3348- with this transaction object */
3349- ulint mysql_process_no;/* since in Linux, 'top' reports
3350+ /*------------------------------*/
3351+ ulint n_mysql_tables_in_use; /* number of Innobase tables
3352+ used in the processing of the current
3353 diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
3354 --- a/storage/innobase/trx/trx0sys.c 2010-11-03 07:01:13.000000000 +0900
3355 +++ b/storage/innobase/trx/trx0sys.c 2010-12-03 15:38:20.325956917 +0900
3356-@@ -75,13 +75,16 @@
3357+@@ -76,13 +76,16 @@
3358 file name and position here. */
3359 /* @{ */
3360 /** Master binlog file name */
3361@@ -355,7 +354,7 @@
3362 /** If this MySQL server uses binary logging, after InnoDB has been inited
3363 and if it has done a crash recovery, we store the binlog file name and position
3364 here. */
3365-@@ -683,23 +686,25 @@
3366+@@ -684,23 +687,25 @@
3367 void
3368 trx_sys_update_mysql_binlog_offset(
3369 /*===============================*/
3370@@ -387,7 +386,7 @@
3371 if (mach_read_from_4(sys_header + field
3372 + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
3373 != TRX_SYS_MYSQL_LOG_MAGIC_N) {
3374-@@ -821,13 +826,26 @@
3375+@@ -822,13 +827,26 @@
3376 + TRX_SYS_MYSQL_LOG_OFFSET_LOW),
3377 sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
3378 + TRX_SYS_MYSQL_LOG_NAME);
3379@@ -415,7 +414,7 @@
3380
3381 trx_sys_mysql_master_log_pos
3382 = (((ib_int64_t) mach_read_from_4(
3383-@@ -836,6 +854,19 @@
3384+@@ -837,6 +855,19 @@
3385 + ((ib_int64_t) mach_read_from_4(
3386 sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
3387 + TRX_SYS_MYSQL_LOG_OFFSET_LOW));
3388@@ -438,7 +437,7 @@
3389 diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
3390 --- a/storage/innobase/trx/trx0trx.c 2010-12-03 15:37:45.549028990 +0900
3391 +++ b/storage/innobase/trx/trx0trx.c 2010-12-03 15:38:20.328957217 +0900
3392-@@ -135,6 +135,10 @@
3393+@@ -138,6 +138,10 @@
3394
3395 trx->mysql_log_file_name = NULL;
3396 trx->mysql_log_offset = 0;
3397@@ -449,7 +448,7 @@
3398
3399 mutex_create(trx_undo_mutex_key, &trx->undo_mutex, SYNC_TRX_UNDO);
3400
3401-@@ -765,6 +769,7 @@
3402+@@ -820,6 +824,7 @@
3403 {
3404 mtr_t mtr;
3405 trx_rseg_t* rseg;
3406@@ -457,7 +456,7 @@
3407
3408 ut_ad(!mutex_own(&kernel_mutex));
3409
3410-@@ -818,8 +823,12 @@
3411+@@ -873,8 +878,12 @@
3412
3413 if (trx->mysql_log_file_name
3414 && trx->mysql_log_file_name[0] != '\0') {
3415@@ -470,7 +469,7 @@
3416 trx->mysql_log_file_name,
3417 trx->mysql_log_offset,
3418 TRX_SYS_MYSQL_LOG_INFO, &mtr);
3419-@@ -827,6 +836,27 @@
3420+@@ -882,6 +891,27 @@
3421 trx->mysql_log_file_name = NULL;
3422 }
3423
3424
3425=== modified file 'innodb_pass_corrupt_table.patch'
3426--- innodb_pass_corrupt_table.patch 2011-05-10 11:57:42 +0000
3427+++ innodb_pass_corrupt_table.patch 2011-06-20 09:04:39 +0000
3428@@ -343,37 +343,35 @@
3429 if (!ready) {
3430
3431 return(block);
3432-@@ -2475,6 +2481,14 @@
3433+@@ -2475,6 +2481,13 @@
3434 return(NULL);
3435 }
3436
3437-+ if (srv_pass_corrupt_table) {
3438++ if (srv_pass_corrupt_table <= 1) {
3439 + if (bpage->is_corrupt) {
3440 + rw_lock_s_unlock(&buf_pool->page_hash_latch);
3441 + return(NULL);
3442 + }
3443 + }
3444-+ ut_a(!(bpage->is_corrupt));
3445 +
3446 block_mutex = buf_page_get_mutex_enter(bpage);
3447
3448 rw_lock_s_unlock(&buf_pool->page_hash_latch);
3449-@@ -3036,6 +3050,14 @@
3450+@@ -3036,6 +3049,13 @@
3451 return(NULL);
3452 }
3453
3454-+ if (srv_pass_corrupt_table) {
3455++ if (srv_pass_corrupt_table <= 1) {
3456 + if (block->page.is_corrupt) {
3457 + mutex_exit(block_mutex);
3458 + return(NULL);
3459 + }
3460 + }
3461-+ ut_a(!(block->page.is_corrupt));
3462 +
3463 switch (buf_block_get_state(block)) {
3464 buf_page_t* bpage;
3465 ibool success;
3466-@@ -3710,6 +3732,7 @@
3467+@@ -3710,6 +3730,7 @@
3468 bpage->newest_modification = 0;
3469 bpage->oldest_modification = 0;
3470 HASH_INVALIDATE(bpage, hash);
3471@@ -381,17 +379,7 @@
3472 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
3473 bpage->file_page_was_freed = FALSE;
3474 #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
3475-@@ -4220,7 +4243,8 @@
3476- void
3477- buf_page_io_complete(
3478- /*=================*/
3479-- buf_page_t* bpage) /*!< in: pointer to the block in question */
3480-+ buf_page_t* bpage, /*!< in: pointer to the block in question */
3481-+ trx_t* trx)
3482- {
3483- enum buf_io_fix io_type;
3484- buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
3485-@@ -4299,6 +4323,7 @@
3486+@@ -4299,6 +4320,7 @@
3487 (ulong) bpage->offset);
3488 }
3489
3490@@ -399,27 +387,31 @@
3491 /* From version 3.23.38 up we store the page checksum
3492 to the 4 first bytes of the page end lsn field */
3493
3494-@@ -4340,6 +4365,19 @@
3495+@@ -4340,6 +4362,23 @@
3496 REFMAN "forcing-innodb-recovery.html\n"
3497 "InnoDB: about forcing recovery.\n", stderr);
3498
3499 + if (srv_pass_corrupt_table && !trx_sys_sys_space(bpage->space)
3500 + && bpage->space < SRV_LOG_SPACE_FIRST_ID) {
3501++ trx_t* trx;
3502++
3503 + fprintf(stderr,
3504 + "InnoDB: space %u will be treated as corrupt.\n",
3505 + bpage->space);
3506 + fil_space_set_corrupt(bpage->space);
3507-+ if (trx && trx->dict_operation_lock_mode == 0) {
3508++
3509++ trx = innobase_get_trx();
3510++ if (trx && trx->dict_operation_lock_mode == RW_X_LATCH) {
3511++ dict_table_set_corrupt_by_space(bpage->space, FALSE);
3512++ } else {
3513 + dict_table_set_corrupt_by_space(bpage->space, TRUE);
3514-+ } else {
3515-+ dict_table_set_corrupt_by_space(bpage->space, FALSE);
3516 + }
3517 + bpage->is_corrupt = TRUE;
3518 + } else
3519 if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
3520 fputs("InnoDB: Ending processing because of"
3521 " a corrupt database page.\n",
3522-@@ -4347,6 +4385,7 @@
3523+@@ -4347,6 +4386,7 @@
3524 exit(1);
3525 }
3526 }
3527@@ -427,7 +419,7 @@
3528
3529 if (recv_recovery_is_on()) {
3530 /* Pages must be uncompressed for crash recovery. */
3531-@@ -4356,8 +4395,11 @@
3532+@@ -4356,8 +4396,11 @@
3533
3534 if (uncompressed && !recv_no_ibuf_operations) {
3535 ibuf_merge_or_delete_for_page(
3536@@ -442,7 +434,7 @@
3537 diff -ruN a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
3538 --- a/storage/innobase/buf/buf0rea.c 2010-12-04 15:37:50.557553380 +0900
3539 +++ b/storage/innobase/buf/buf0rea.c 2010-12-04 15:41:09.784467585 +0900
3540-@@ -193,12 +193,19 @@
3541+@@ -193,7 +193,14 @@
3542 ((buf_block_t*) bpage)->frame, bpage, trx);
3543 }
3544 thd_wait_end(NULL);
3545@@ -457,24 +449,18 @@
3546
3547 if (sync) {
3548 /* The i/o is already completed when we arrive from
3549- fil_read */
3550-- buf_page_io_complete(bpage);
3551-+ buf_page_io_complete(bpage, trx);
3552- }
3553-
3554- return(1);
3555 diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
3556 --- a/storage/innobase/dict/dict0dict.c 2010-12-03 17:30:16.248987063 +0900
3557 +++ b/storage/innobase/dict/dict0dict.c 2010-12-04 15:45:23.808513973 +0900
3558-@@ -55,6 +55,7 @@
3559- #include "srv0srv.h" /* srv_lower_case_table_names */
3560+@@ -54,6 +54,7 @@
3561+ #include "row0merge.h"
3562 #include "m_ctype.h" /* my_isspace() */
3563 #include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/
3564 +#include "srv0start.h" /* SRV_LOG_SPACE_FIRST_ID */
3565
3566 #include <ctype.h>
3567
3568-@@ -751,7 +752,7 @@
3569+@@ -750,7 +751,7 @@
3570
3571 mutex_exit(&(dict_sys->mutex));
3572
3573@@ -483,7 +469,7 @@
3574 /* If table->ibd_file_missing == TRUE, this will
3575 print an error message and return without doing
3576 anything. */
3577-@@ -1294,7 +1295,7 @@
3578+@@ -1293,7 +1294,7 @@
3579 + dict_sys->size) > srv_dict_size_limit ) {
3580 prev_table = UT_LIST_GET_PREV(table_LRU, table);
3581
3582@@ -492,7 +478,7 @@
3583 goto next_loop;
3584
3585 cached_foreign_tables = 0;
3586-@@ -4333,6 +4334,12 @@
3587+@@ -4332,6 +4333,12 @@
3588 heap = mem_heap_create(1000);
3589
3590 while (index) {
3591@@ -505,7 +491,7 @@
3592 size = btr_get_size(index, BTR_TOTAL_SIZE);
3593
3594 index->stat_index_size = size;
3595-@@ -4480,6 +4487,12 @@
3596+@@ -4479,6 +4486,12 @@
3597 heap = mem_heap_create(1000);
3598
3599 while (index) {
3600@@ -518,20 +504,21 @@
3601 /*===========================================*/
3602 {
3603 dict_table_t* sys_stats;
3604-@@ -4666,6 +4679,12 @@
3605+@@ -4671,6 +4684,13 @@
3606 || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
3607 && dict_index_is_clust(index)))) {
3608 ulint size;
3609 +
3610 + if (table->is_corrupt) {
3611 + ut_a(srv_pass_corrupt_table);
3612++ dict_table_stats_unlock(table, RW_X_LATCH);
3613 + return;
3614 + }
3615 +
3616 size = btr_get_size(index, BTR_TOTAL_SIZE);
3617
3618 index->stat_index_size = size;
3619-@@ -5462,4 +5481,42 @@
3620+@@ -5467,4 +5487,42 @@
3621 rw_lock_free(&dict_table_stats_latches[i]);
3622 }
3623 }
3624@@ -577,7 +564,7 @@
3625 diff -ruN a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
3626 --- a/storage/innobase/dict/dict0mem.c 2010-11-03 07:01:13.000000000 +0900
3627 +++ b/storage/innobase/dict/dict0mem.c 2010-12-04 15:38:18.126549463 +0900
3628-@@ -97,6 +97,8 @@
3629+@@ -96,6 +96,8 @@
3630 /* The number of transactions that are either waiting on the
3631 AUTOINC lock or have been granted the lock. */
3632 table->n_waiting_or_granted_auto_inc_locks = 0;
3633@@ -589,7 +576,7 @@
3634 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
3635 --- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:37:50.564551587 +0900
3636 +++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:38:18.128549252 +0900
3637-@@ -233,6 +233,7 @@
3638+@@ -235,6 +235,7 @@
3639 file we have written to */
3640 ibool is_in_unflushed_spaces; /*!< TRUE if this space is
3641 currently in unflushed_spaces */
3642@@ -597,7 +584,7 @@
3643 UT_LIST_NODE_T(fil_space_t) space_list;
3644 /*!< list of all spaces */
3645 ulint magic_n;/*!< FIL_SPACE_MAGIC_N */
3646-@@ -1291,6 +1292,8 @@
3647+@@ -1293,6 +1294,8 @@
3648 ut_fold_string(name), space);
3649 space->is_in_unflushed_spaces = FALSE;
3650
3651@@ -606,18 +593,18 @@
3652 UT_LIST_ADD_LAST(space_list, fil_system->space_list, space);
3653
3654 mutex_exit(&fil_system->mutex);
3655-@@ -4943,6 +4946,22 @@
3656+@@ -5267,6 +5270,34 @@
3657 ut_a(byte_offset % OS_FILE_LOG_BLOCK_SIZE == 0);
3658 ut_a((len % OS_FILE_LOG_BLOCK_SIZE) == 0);
3659
3660-+ if (srv_pass_corrupt_table && space->is_corrupt) {
3661++ if (srv_pass_corrupt_table == 1 && space->is_corrupt) {
3662 + /* should ignore i/o for the crashed space */
3663 + mutex_enter(&fil_system->mutex);
3664 + fil_node_complete_io(node, fil_system, type);
3665 + mutex_exit(&fil_system->mutex);
3666 + if (mode == OS_AIO_NORMAL) {
3667 + ut_a(space->purpose == FIL_TABLESPACE);
3668-+ buf_page_io_complete(message, trx);
3669++ buf_page_io_complete(message);
3670 + }
3671 + if (type == OS_FILE_READ) {
3672 + return(DB_TABLESPACE_DELETED);
3673@@ -625,11 +612,23 @@
3674 + return(DB_SUCCESS);
3675 + }
3676 + } else {
3677-+ ut_a(!space->is_corrupt);
3678++ if (srv_pass_corrupt_table > 1 && space->is_corrupt) {
3679++ /* should ignore write i/o for the crashed space */
3680++ if (type == OS_FILE_WRITE) {
3681++ mutex_enter(&fil_system->mutex);
3682++ fil_node_complete_io(node, fil_system, type);
3683++ mutex_exit(&fil_system->mutex);
3684++ if (mode == OS_AIO_NORMAL) {
3685++ ut_a(space->purpose == FIL_TABLESPACE);
3686++ buf_page_io_complete(message);
3687++ }
3688++ return(DB_SUCCESS);
3689++ }
3690++ }
3691 #ifdef UNIV_HOTBACKUP
3692 /* In ibbackup do normal i/o, not aio */
3693 if (type == OS_FILE_READ) {
3694-@@ -4957,6 +4976,8 @@
3695+@@ -5281,6 +5312,8 @@
3696 ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
3697 offset_low, offset_high, len, node, message, trx);
3698 #endif
3699@@ -638,16 +637,7 @@
3700 ut_a(ret);
3701
3702 if (mode == OS_AIO_SYNC) {
3703-@@ -5098,7 +5119,7 @@
3704-
3705- if (fil_node->space->purpose == FIL_TABLESPACE) {
3706- srv_set_io_thread_op_info(segment, "complete io for buf page");
3707-- buf_page_io_complete(message);
3708-+ buf_page_io_complete(message, NULL);
3709- } else {
3710- srv_set_io_thread_op_info(segment, "complete io for log");
3711- log_io_complete(message);
3712-@@ -5452,3 +5473,46 @@
3713+@@ -5780,3 +5813,46 @@
3714 return 0;
3715 }
3716 }
3717@@ -808,11 +798,11 @@
3718 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
3719 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:37:50.578486593 +0900
3720 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:38:18.137549396 +0900
3721-@@ -3959,6 +3959,12 @@
3722+@@ -3972,6 +3972,12 @@
3723 DBUG_RETURN(1);
3724 }
3725
3726-+ if (share->ib_table && share->ib_table->is_corrupt) {
3727++ if (srv_pass_corrupt_table <= 1 && share->ib_table && share->ib_table->is_corrupt) {
3728 + free_share(share);
3729 +
3730 + DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
3731@@ -821,11 +811,11 @@
3732 /* Create buffers for packing the fields of a record. Why
3733 table->reclength did not work here? Obviously, because char
3734 fields when packed actually became 1 byte longer, when we also
3735-@@ -3986,6 +3992,19 @@
3736+@@ -3999,6 +4005,19 @@
3737 /* Get pointer to a table object in InnoDB dictionary cache */
3738 ib_table = dict_table_get(norm_name, TRUE);
3739
3740-+ if (ib_table && ib_table->is_corrupt) {
3741++ if (srv_pass_corrupt_table <= 1 && ib_table && ib_table->is_corrupt) {
3742 + free_share(share);
3743 + my_free(upd_buff);
3744 +
3745@@ -841,7 +831,7 @@
3746 if (NULL == ib_table) {
3747 if (is_part && retries < 10) {
3748 ++retries;
3749-@@ -5150,6 +5169,10 @@
3750+@@ -5163,6 +5182,10 @@
3751
3752 ha_statistic_increment(&SSV::ha_write_count);
3753
3754@@ -852,7 +842,7 @@
3755 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
3756 table->timestamp_field->set_time();
3757
3758-@@ -5367,6 +5390,10 @@
3759+@@ -5380,6 +5403,10 @@
3760 func_exit:
3761 innobase_active_small();
3762
3763@@ -863,7 +853,7 @@
3764 DBUG_RETURN(error_result);
3765 }
3766
3767-@@ -5543,6 +5570,10 @@
3768+@@ -5556,6 +5583,10 @@
3769
3770 ha_statistic_increment(&SSV::ha_update_count);
3771
3772@@ -874,7 +864,7 @@
3773 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
3774 table->timestamp_field->set_time();
3775
3776-@@ -5632,6 +5663,10 @@
3777+@@ -5645,6 +5676,10 @@
3778
3779 innobase_active_small();
3780
3781@@ -885,7 +875,7 @@
3782 DBUG_RETURN(error);
3783 }
3784
3785-@@ -5653,6 +5688,10 @@
3786+@@ -5666,6 +5701,10 @@
3787
3788 ha_statistic_increment(&SSV::ha_delete_count);
3789
3790@@ -896,7 +886,7 @@
3791 if (!prebuilt->upd_node) {
3792 row_get_prebuilt_update_vector(prebuilt);
3793 }
3794-@@ -5679,6 +5718,10 @@
3795+@@ -5692,6 +5731,10 @@
3796
3797 innobase_active_small();
3798
3799@@ -907,62 +897,62 @@
3800 DBUG_RETURN(error);
3801 }
3802
3803-@@ -5918,6 +5961,10 @@
3804+@@ -5931,6 +5974,10 @@
3805
3806 ha_statistic_increment(&SSV::ha_read_key_count);
3807
3808-+ if (share->ib_table->is_corrupt) {
3809++ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
3810 + DBUG_RETURN(HA_ERR_CRASHED);
3811 + }
3812 +
3813 index = prebuilt->index;
3814
3815 if (UNIV_UNLIKELY(index == NULL)) {
3816-@@ -5983,6 +6030,10 @@
3817+@@ -5996,6 +6043,10 @@
3818 ret = DB_UNSUPPORTED;
3819 }
3820
3821-+ if (share->ib_table->is_corrupt) {
3822++ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
3823 + DBUG_RETURN(HA_ERR_CRASHED);
3824 + }
3825 +
3826 switch (ret) {
3827 case DB_SUCCESS:
3828 error = 0;
3829-@@ -6098,6 +6149,10 @@
3830+@@ -6111,6 +6162,10 @@
3831 {
3832 DBUG_ENTER("change_active_index");
3833
3834-+ if (share->ib_table->is_corrupt) {
3835++ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
3836 + DBUG_RETURN(HA_ERR_CRASHED);
3837 + }
3838 +
3839 ut_ad(user_thd == ha_thd());
3840 ut_a(prebuilt->trx == thd_to_trx(user_thd));
3841
3842-@@ -6188,6 +6243,10 @@
3843+@@ -6201,6 +6256,10 @@
3844
3845 DBUG_ENTER("general_fetch");
3846
3847-+ if (share->ib_table->is_corrupt) {
3848++ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
3849 + DBUG_RETURN(HA_ERR_CRASHED);
3850 + }
3851 +
3852 ut_a(prebuilt->trx == thd_to_trx(user_thd));
3853
3854 innodb_srv_conc_enter_innodb(prebuilt->trx);
3855-@@ -6197,6 +6256,10 @@
3856+@@ -6210,6 +6269,10 @@
3857
3858 innodb_srv_conc_exit_innodb(prebuilt->trx);
3859
3860-+ if (share->ib_table->is_corrupt) {
3861++ if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
3862 + DBUG_RETURN(HA_ERR_CRASHED);
3863 + }
3864 +
3865 switch (ret) {
3866 case DB_SUCCESS:
3867 error = 0;
3868-@@ -7467,10 +7530,18 @@
3869+@@ -7476,10 +7539,18 @@
3870
3871 update_thd(ha_thd());
3872
3873@@ -981,7 +971,7 @@
3874 error = convert_error_code_to_mysql(error, prebuilt->table->flags,
3875 NULL);
3876
3877-@@ -7975,6 +8046,16 @@
3878+@@ -7980,6 +8051,16 @@
3879 return(ranges + (double) rows / (double) total_rows * time_for_scan);
3880 }
3881
3882@@ -998,7 +988,7 @@
3883 /*********************************************************************//**
3884 Calculates the key number used inside MySQL for an Innobase index. We will
3885 first check the "index translation table" for a match of the index to get
3886-@@ -8152,7 +8233,7 @@
3887+@@ -8157,7 +8238,7 @@
3888 ib_table = prebuilt->table;
3889
3890 if (flag & HA_STATUS_TIME) {
3891@@ -1007,7 +997,7 @@
3892 /* In sql_show we call with this flag: update
3893 then statistics so that they are up-to-date */
3894
3895-@@ -8445,10 +8526,18 @@
3896+@@ -8450,10 +8531,18 @@
3897 THD* thd, /*!< in: connection thread handle */
3898 HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
3899 {
3900@@ -1026,7 +1016,7 @@
3901 return(0);
3902 }
3903
3904-@@ -8630,6 +8719,10 @@
3905+@@ -8635,6 +8724,10 @@
3906 my_error(ER_QUERY_INTERRUPTED, MYF(0));
3907 }
3908
3909@@ -1037,7 +1027,7 @@
3910 DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
3911 }
3912
3913-@@ -9400,6 +9493,10 @@
3914+@@ -9405,6 +9498,10 @@
3915
3916 update_thd(thd);
3917
3918@@ -1048,7 +1038,7 @@
3919 if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
3920 ut_print_timestamp(stderr);
3921 fprintf(stderr,
3922-@@ -11800,6 +11897,25 @@
3923+@@ -11807,6 +11904,26 @@
3924 "0 (the default) disables automatic dumps.",
3925 NULL, NULL, 0, 0, UINT_MAX32, 0);
3926
3927@@ -1056,6 +1046,7 @@
3928 +{
3929 + "assert", /* 0 */
3930 + "warn", /* 1 */
3931++ "salvage", /* 2 */
3932 + NullS
3933 +};
3934 +TYPELIB corrupt_table_action_typelib=
3935@@ -1074,7 +1065,7 @@
3936 static struct st_mysql_sys_var* innobase_system_variables[]= {
3937 MYSQL_SYSVAR(additional_mem_pool_size),
3938 MYSQL_SYSVAR(autoextend_increment),
3939-@@ -11886,6 +12002,7 @@
3940+@@ -11893,6 +12010,7 @@
3941 MYSQL_SYSVAR(purge_threads),
3942 MYSQL_SYSVAR(purge_batch_size),
3943 MYSQL_SYSVAR(rollback_segments),
3944@@ -1136,17 +1127,7 @@
3945 #endif /* UNIV_DEBUG */
3946 /*********************************************************************//**
3947 Gets the space id of a block.
3948-@@ -1118,7 +1118,8 @@
3949- void
3950- buf_page_io_complete(
3951- /*=================*/
3952-- buf_page_t* bpage); /*!< in: pointer to the block in question */
3953-+ buf_page_t* bpage, /*!< in: pointer to the block in question */
3954-+ trx_t* trx);
3955- /********************************************************************//**
3956- Calculates a folded value of a file page address to use in the page hash
3957- table.
3958-@@ -1433,6 +1434,7 @@
3959+@@ -1433,6 +1433,7 @@
3960 0 if the block was never accessed
3961 in the buffer pool */
3962 /* @} */
3963@@ -1201,7 +1182,7 @@
3964 diff -ruN a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
3965 --- a/storage/innobase/include/dict0mem.h 2010-11-03 07:01:13.000000000 +0900
3966 +++ b/storage/innobase/include/dict0mem.h 2010-12-04 15:38:18.171513956 +0900
3967-@@ -636,6 +636,7 @@
3968+@@ -640,6 +640,7 @@
3969 the AUTOINC lock on this table. */
3970 /* @} */
3971 /*----------------------*/
3972@@ -1296,7 +1277,7 @@
3973 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
3974 --- a/storage/innobase/include/srv0srv.h 2010-12-04 15:37:50.591516341 +0900
3975 +++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:38:18.180563749 +0900
3976-@@ -243,6 +243,7 @@
3977+@@ -240,6 +240,7 @@
3978 extern ulint srv_adaptive_flushing_method;
3979
3980 extern ulint srv_expand_import;
3981@@ -1354,7 +1335,7 @@
3982 diff -ruN a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
3983 --- a/storage/innobase/row/row0sel.c 2010-11-03 07:01:13.000000000 +0900
3984 +++ b/storage/innobase/row/row0sel.c 2010-12-04 15:38:18.205551115 +0900
3985-@@ -3848,6 +3848,13 @@
3986+@@ -3853,6 +3853,13 @@
3987 /* PHASE 4: Look for matching records in a loop */
3988
3989 rec = btr_pcur_get_rec(pcur);
3990@@ -1368,10 +1349,35 @@
3991 ut_ad(!!page_rec_is_comp(rec) == comp);
3992 #ifdef UNIV_SEARCH_DEBUG
3993 /*
3994+@@ -3930,7 +3937,13 @@
3995+ if (UNIV_UNLIKELY(next_offs >= UNIV_PAGE_SIZE - PAGE_DIR)) {
3996+
3997+ wrong_offs:
3998+- if (srv_force_recovery == 0 || moves_up == FALSE) {
3999++ if (srv_pass_corrupt_table && !trx_sys_sys_space(index->table->space)) {
4000++ index->table->is_corrupt = TRUE;
4001++ fil_space_set_corrupt(index->table->space);
4002++ }
4003++
4004++ if ((srv_force_recovery == 0 || moves_up == FALSE)
4005++ && srv_pass_corrupt_table <= 1) {
4006+ ut_print_timestamp(stderr);
4007+ buf_page_print(page_align(rec), 0);
4008+ fprintf(stderr,
4009+@@ -3981,7 +3994,8 @@
4010+
4011+ offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
4012+
4013+- if (UNIV_UNLIKELY(srv_force_recovery > 0)) {
4014++ if (UNIV_UNLIKELY(srv_force_recovery > 0)
4015++ || (srv_pass_corrupt_table == 2 && index->table->is_corrupt)) {
4016+ if (!rec_validate(rec, offsets)
4017+ || !btr_index_rec_validate(rec, index, FALSE)) {
4018+ fprintf(stderr,
4019 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
4020 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:37:50.602481253 +0900
4021 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:38:18.209513823 +0900
4022-@@ -436,6 +436,7 @@
4023+@@ -430,6 +430,7 @@
4024 UNIV_INTERN ulint srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
4025
4026 UNIV_INTERN ulint srv_expand_import = 0; /* 0:disable 1:enable */
4027
4028=== modified file 'innodb_recovery_patches.patch'
4029--- innodb_recovery_patches.patch 2011-05-10 11:57:42 +0000
4030+++ innodb_recovery_patches.patch 2011-06-20 09:04:39 +0000
4031@@ -117,7 +117,7 @@
4032 static my_bool innobase_locks_unsafe_for_binlog = FALSE;
4033 static my_bool innobase_overwrite_relay_log_info = FALSE;
4034 static my_bool innobase_rollback_on_timeout = FALSE;
4035-@@ -2562,6 +2563,8 @@
4036+@@ -2576,6 +2577,8 @@
4037
4038 srv_force_recovery = (ulint) innobase_force_recovery;
4039
4040@@ -126,7 +126,7 @@
4041 srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
4042 srv_use_checksums = (ibool) innobase_use_checksums;
4043
4044-@@ -11267,6 +11270,11 @@
4045+@@ -11274,6 +11277,11 @@
4046 "The common part for InnoDB table spaces.",
4047 NULL, NULL, NULL);
4048
4049@@ -138,7 +138,7 @@
4050 static MYSQL_SYSVAR_BOOL(recovery_update_relay_log, innobase_overwrite_relay_log_info,
4051 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
4052 "During InnoDB crash recovery on slave overwrite relay-log.info "
4053-@@ -11740,6 +11748,7 @@
4054+@@ -11747,6 +11755,7 @@
4055 MYSQL_SYSVAR(data_file_path),
4056 MYSQL_SYSVAR(data_home_dir),
4057 MYSQL_SYSVAR(doublewrite),
4058@@ -192,7 +192,7 @@
4059 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
4060 --- a/storage/innobase/include/srv0srv.h 2010-12-03 17:30:16.321953515 +0900
4061 +++ b/storage/innobase/include/srv0srv.h 2010-12-03 17:30:41.593985184 +0900
4062-@@ -129,6 +129,8 @@
4063+@@ -126,6 +126,8 @@
4064 extern ulint* srv_data_file_sizes;
4065 extern ulint* srv_data_file_is_raw_partition;
4066
4067@@ -441,8 +441,8 @@
4068 #ifndef UNIV_HOTBACKUP
4069 # include "os0sync.h"
4070 # include "os0thread.h"
4071-@@ -4262,6 +4263,18 @@
4072- os_thread_exit(NULL);
4073+@@ -4260,6 +4261,18 @@
4074+ INFINITE);
4075 }
4076
4077 + if (srv_recovery_stats && recv_recovery_is_on() && n_consecutive) {
4078@@ -459,11 +459,11 @@
4079 +
4080 os_mutex_enter(array->mutex);
4081
4082- slot = os_aio_array_get_nth_slot(array, i + segment * n);
4083+ if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS
4084 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
4085 --- a/storage/innobase/srv/srv0srv.c 2010-12-03 17:30:16.339955597 +0900
4086 +++ b/storage/innobase/srv/srv0srv.c 2010-12-03 17:30:41.604958138 +0900
4087-@@ -166,6 +166,8 @@
4088+@@ -160,6 +160,8 @@
4089 /* size in database pages */
4090 UNIV_INTERN ulint* srv_data_file_sizes = NULL;
4091
4092@@ -475,7 +475,7 @@
4093 diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
4094 --- a/storage/innobase/trx/trx0sys.c 2010-12-03 15:41:52.051986524 +0900
4095 +++ b/storage/innobase/trx/trx0sys.c 2010-12-03 17:30:41.607026818 +0900
4096-@@ -566,6 +566,12 @@
4097+@@ -567,6 +567,12 @@
4098 zip_size ? zip_size : UNIV_PAGE_SIZE,
4099 read_buf, NULL);
4100
4101@@ -488,7 +488,7 @@
4102 /* Check if the page is corrupt */
4103
4104 if (UNIV_UNLIKELY
4105-@@ -613,6 +619,13 @@
4106+@@ -614,6 +620,13 @@
4107 zip_size, page_no, 0,
4108 zip_size ? zip_size : UNIV_PAGE_SIZE,
4109 page, NULL);
4110
4111=== modified file 'innodb_separate_doublewrite.patch'
4112--- innodb_separate_doublewrite.patch 2011-05-10 11:57:42 +0000
4113+++ innodb_separate_doublewrite.patch 2011-06-20 09:04:39 +0000
4114@@ -105,7 +105,7 @@
4115 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
4116 --- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:35:29.143813775 +0900
4117 +++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:35:58.628498870 +0900
4118-@@ -655,7 +655,7 @@
4119+@@ -657,7 +657,7 @@
4120
4121 UT_LIST_ADD_LAST(chain, space->chain, node);
4122
4123@@ -114,7 +114,7 @@
4124
4125 fil_system->max_assigned_id = id;
4126 }
4127-@@ -719,14 +719,14 @@
4128+@@ -721,14 +721,14 @@
4129 size_bytes = (((ib_int64_t)size_high) << 32)
4130 + (ib_int64_t)size_low;
4131 #ifdef UNIV_HOTBACKUP
4132@@ -131,7 +131,7 @@
4133
4134 if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
4135 fprintf(stderr,
4136-@@ -772,7 +772,7 @@
4137+@@ -774,7 +774,7 @@
4138 }
4139
4140 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
4141@@ -140,7 +140,7 @@
4142 fprintf(stderr,
4143 "InnoDB: Error: tablespace id %lu"
4144 " in file %s is not sensible\n",
4145-@@ -840,7 +840,7 @@
4146+@@ -842,7 +842,7 @@
4147
4148 system->n_open++;
4149
4150@@ -149,7 +149,7 @@
4151 /* Put the node to the LRU list */
4152 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
4153 }
4154-@@ -873,7 +873,7 @@
4155+@@ -875,7 +875,7 @@
4156 ut_a(system->n_open > 0);
4157 system->n_open--;
4158
4159@@ -158,7 +158,7 @@
4160 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);
4161
4162 /* The node is in the LRU list, remove it */
4163-@@ -959,7 +959,7 @@
4164+@@ -961,7 +961,7 @@
4165 retry:
4166 mutex_enter(&fil_system->mutex);
4167
4168@@ -167,7 +167,7 @@
4169 /* We keep log files and system tablespace files always open;
4170 this is important in preventing deadlocks in this module, as
4171 a page read completion often performs another read from the
4172-@@ -1190,7 +1190,7 @@
4173+@@ -1192,7 +1192,7 @@
4174 " tablespace memory cache!\n",
4175 (ulong) space->id);
4176
4177@@ -176,7 +176,7 @@
4178
4179 mutex_exit(&fil_system->mutex);
4180
4181-@@ -1252,6 +1252,7 @@
4182+@@ -1254,6 +1254,7 @@
4183 space->mark = FALSE;
4184
4185 if (UNIV_LIKELY(purpose == FIL_TABLESPACE && !recv_recovery_on)
4186@@ -184,7 +184,7 @@
4187 && UNIV_UNLIKELY(id > fil_system->max_assigned_id)) {
4188 if (!fil_system->space_id_reuse_warned) {
4189 fil_system->space_id_reuse_warned = TRUE;
4190-@@ -1335,7 +1336,7 @@
4191+@@ -1337,7 +1338,7 @@
4192 (ulong) SRV_LOG_SPACE_FIRST_ID);
4193 }
4194
4195@@ -193,7 +193,7 @@
4196
4197 if (success) {
4198 *space_id = fil_system->max_assigned_id = id;
4199-@@ -1598,6 +1599,8 @@
4200+@@ -1600,6 +1601,8 @@
4201 UT_LIST_INIT(fil_system->LRU);
4202
4203 fil_system->max_n_open = max_n_open;
4204@@ -202,7 +202,7 @@
4205 }
4206
4207 /*******************************************************************//**
4208-@@ -1619,7 +1622,7 @@
4209+@@ -1621,7 +1624,7 @@
4210 space = UT_LIST_GET_FIRST(fil_system->space_list);
4211
4212 while (space != NULL) {
4213@@ -211,7 +211,7 @@
4214 node = UT_LIST_GET_FIRST(space->chain);
4215
4216 while (node != NULL) {
4217-@@ -1709,6 +1712,10 @@
4218+@@ -1711,6 +1714,10 @@
4219 ut_error;
4220 }
4221
4222@@ -222,7 +222,7 @@
4223 mutex_enter(&fil_system->mutex);
4224
4225 if (fil_system->max_assigned_id < max_id) {
4226-@@ -1727,6 +1734,7 @@
4227+@@ -1729,6 +1736,7 @@
4228 ulint
4229 fil_write_lsn_and_arch_no_to_file(
4230 /*==============================*/
4231@@ -230,7 +230,7 @@
4232 ulint sum_of_sizes, /*!< in: combined size of previous files
4233 in space, in database pages */
4234 ib_uint64_t lsn, /*!< in: lsn to write */
4235-@@ -1736,14 +1744,16 @@
4236+@@ -1738,14 +1746,16 @@
4237 byte* buf1;
4238 byte* buf;
4239
4240@@ -249,7 +249,7 @@
4241
4242 mem_free(buf1);
4243
4244-@@ -1779,7 +1789,7 @@
4245+@@ -1781,7 +1791,7 @@
4246 always open. */
4247
4248 if (space->purpose == FIL_TABLESPACE
4249@@ -258,7 +258,7 @@
4250 sum_of_sizes = 0;
4251
4252 node = UT_LIST_GET_FIRST(space->chain);
4253-@@ -1787,7 +1797,7 @@
4254+@@ -1789,7 +1799,7 @@
4255 mutex_exit(&fil_system->mutex);
4256
4257 err = fil_write_lsn_and_arch_no_to_file(
4258@@ -267,7 +267,7 @@
4259 if (err != DB_SUCCESS) {
4260
4261 return(err);
4262-@@ -3834,7 +3844,7 @@
4263+@@ -4158,7 +4168,7 @@
4264 }
4265
4266 #ifndef UNIV_HOTBACKUP
4267@@ -276,7 +276,7 @@
4268 fprintf(stderr,
4269 "InnoDB: Error: tablespace id %lu in file %s"
4270 " is not sensible\n",
4271-@@ -3843,7 +3853,7 @@
4272+@@ -4167,7 +4177,7 @@
4273 goto func_exit;
4274 }
4275 #else
4276@@ -285,7 +285,7 @@
4277 char* new_path;
4278
4279 fprintf(stderr,
4280-@@ -4664,7 +4674,7 @@
4281+@@ -4988,7 +4998,7 @@
4282 }
4283
4284 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
4285@@ -294,7 +294,7 @@
4286 /* The node is in the LRU list, remove it */
4287
4288 ut_a(UT_LIST_GET_LEN(system->LRU) > 0);
4289-@@ -4710,7 +4720,7 @@
4290+@@ -5034,7 +5044,7 @@
4291 }
4292
4293 if (node->n_pending == 0 && node->space->purpose == FIL_TABLESPACE
4294@@ -303,7 +303,7 @@
4295 /* The node must be put back to the LRU list */
4296 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
4297 }
4298-@@ -5316,7 +5326,7 @@
4299+@@ -5644,7 +5654,7 @@
4300 ut_a(fil_node->n_pending == 0);
4301 ut_a(fil_node->open);
4302 ut_a(fil_node->space->purpose == FIL_TABLESPACE);
4303@@ -348,7 +348,7 @@
4304
4305 /* The highest file format being used in the database. The value can be
4306 set by user, however, it will be adjusted to the newer file format if
4307-@@ -2458,6 +2459,8 @@
4308+@@ -2472,6 +2473,8 @@
4309 goto error;
4310 }
4311
4312@@ -357,7 +357,7 @@
4313 srv_use_sys_stats_table = (ibool) innobase_use_sys_stats_table;
4314
4315 /* -------------- Log files ---------------------------*/
4316-@@ -11634,6 +11637,11 @@
4317+@@ -11641,6 +11644,11 @@
4318 "Path to individual files and their sizes.",
4319 NULL, NULL, NULL);
4320
4321@@ -369,7 +369,7 @@
4322 static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
4323 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
4324 "The AUTOINC lock modes supported by InnoDB: "
4325-@@ -11801,6 +11809,7 @@
4326+@@ -11808,6 +11816,7 @@
4327 MYSQL_SYSVAR(commit_concurrency),
4328 MYSQL_SYSVAR(concurrency_tickets),
4329 MYSQL_SYSVAR(data_file_path),
4330@@ -403,7 +403,7 @@
4331 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
4332 --- a/storage/innobase/include/srv0srv.h 2010-12-04 15:35:29.177480351 +0900
4333 +++ b/storage/innobase/include/srv0srv.h 2010-12-04 15:35:58.646556250 +0900
4334-@@ -132,6 +132,8 @@
4335+@@ -129,6 +129,8 @@
4336 extern ulint* srv_data_file_sizes;
4337 extern ulint* srv_data_file_is_raw_partition;
4338
4339@@ -519,7 +519,7 @@
4340 diff -ruN a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
4341 --- a/storage/innobase/row/row0mysql.c 2010-12-03 17:30:16.334989510 +0900
4342 +++ b/storage/innobase/row/row0mysql.c 2010-12-04 15:35:58.652496484 +0900
4343-@@ -3449,7 +3449,7 @@
4344+@@ -3447,7 +3447,7 @@
4345 /* Do not drop possible .ibd tablespace if something went
4346 wrong: we do not want to delete valuable data of the user */
4347
4348@@ -531,7 +531,7 @@
4349 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
4350 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:35:29.180483212 +0900
4351 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:35:58.656550107 +0900
4352-@@ -169,6 +169,8 @@
4353+@@ -163,6 +163,8 @@
4354 /* size in database pages */
4355 UNIV_INTERN ulint* srv_data_file_sizes = NULL;
4356
4357@@ -768,7 +768,7 @@
4358 diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
4359 --- a/storage/innobase/trx/trx0sys.c 2010-12-03 17:32:15.651024019 +0900
4360 +++ b/storage/innobase/trx/trx0sys.c 2010-12-04 15:35:58.664550291 +0900
4361-@@ -414,6 +414,152 @@
4362+@@ -415,6 +415,152 @@
4363
4364 goto start_again;
4365 }
4366@@ -921,7 +921,7 @@
4367 }
4368
4369 /****************************************************************//**
4370-@@ -437,10 +583,19 @@
4371+@@ -438,10 +584,19 @@
4372 ulint source_page_no;
4373 byte* page;
4374 byte* doublewrite;
4375@@ -941,7 +941,7 @@
4376 /* We do the file i/o past the buffer pool */
4377
4378 unaligned_read_buf = ut_malloc(2 * UNIV_PAGE_SIZE);
4379-@@ -449,7 +604,7 @@
4380+@@ -450,7 +605,7 @@
4381 /* Read the trx sys header to check if we are using the doublewrite
4382 buffer */
4383
4384@@ -950,7 +950,7 @@
4385 UNIV_PAGE_SIZE, read_buf, NULL);
4386 doublewrite = read_buf + TRX_SYS_DOUBLEWRITE;
4387
4388-@@ -487,10 +642,10 @@
4389+@@ -488,10 +643,10 @@
4390
4391 /* Read the pages from the doublewrite buffer to memory */
4392
4393@@ -963,7 +963,7 @@
4394 TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE,
4395 buf + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE,
4396 NULL);
4397-@@ -546,7 +701,8 @@
4398+@@ -547,7 +702,8 @@
4399 " doublewrite buf.\n",
4400 (ulong) space_id, (ulong) page_no, (ulong) i);
4401
4402@@ -973,7 +973,7 @@
4403 && ((page_no >= block1
4404 && page_no
4405 < block1 + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)
4406-@@ -1015,6 +1171,83 @@
4407+@@ -1016,6 +1172,83 @@
4408 }
4409
4410 /*****************************************************************//**
4411@@ -1057,7 +1057,7 @@
4412 Creates and initializes the central memory structures for the transaction
4413 system. This is called when the database is started. */
4414 UNIV_INTERN
4415-@@ -1386,6 +1619,26 @@
4416+@@ -1387,6 +1620,26 @@
4417 /* Does nothing at the moment */
4418 }
4419
4420
4421=== modified file 'innodb_show_lock_name.patch'
4422--- innodb_show_lock_name.patch 2011-05-10 11:57:42 +0000
4423+++ innodb_show_lock_name.patch 2011-06-20 09:04:39 +0000
4424@@ -8,7 +8,7 @@
4425 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
4426 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:34:35.285040381 +0900
4427 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 17:35:12.974975252 +0900
4428-@@ -9588,9 +9588,8 @@
4429+@@ -9593,9 +9593,8 @@
4430 rw_lock_wait_time += mutex->lspent_time;
4431 }
4432 #else /* UNIV_DEBUG */
4433@@ -20,7 +20,7 @@
4434 buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
4435 (ulong) mutex->count_os_wait);
4436
4437-@@ -9605,10 +9604,8 @@
4438+@@ -9610,10 +9609,8 @@
4439
4440 if (block_mutex) {
4441 buf1len = (uint) my_snprintf(buf1, sizeof buf1,
4442@@ -33,7 +33,7 @@
4443 buf2len = (uint) my_snprintf(buf2, sizeof buf2,
4444 "os_waits=%lu",
4445 (ulong) block_mutex_oswait_count);
4446-@@ -9637,9 +9634,8 @@
4447+@@ -9642,9 +9639,8 @@
4448 continue;
4449 }
4450
4451@@ -45,7 +45,7 @@
4452 buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu",
4453 (ulong) lock->count_os_wait);
4454
4455-@@ -9653,10 +9649,8 @@
4456+@@ -9658,10 +9654,8 @@
4457
4458 if (block_lock) {
4459 buf1len = (uint) my_snprintf(buf1, sizeof buf1,
4460@@ -248,7 +248,7 @@
4461 /******************************************************************//**
4462 NOTE! Please use the corresponding macro mutex_enter(), not directly
4463 this function!
4464-@@ -722,9 +722,9 @@
4465+@@ -731,9 +731,9 @@
4466 ulint line; /*!< Line where the mutex was locked */
4467 ulint level; /*!< Level in the global latching order */
4468 #endif /* UNIV_SYNC_DEBUG */
4469@@ -259,7 +259,7 @@
4470 os_thread_id_t thread_id; /*!< The thread id of the thread
4471 which locked the mutex. */
4472 ulint magic_n; /*!< MUTEX_MAGIC_N */
4473-@@ -739,9 +739,9 @@
4474+@@ -748,9 +748,9 @@
4475 ulong count_os_yield; /*!< count of os_wait */
4476 ulonglong lspent_time; /*!< mutex os_wait timer msec */
4477 ulonglong lmax_spent_time;/*!< mutex os_wait timer msec */
4478
4479=== modified file 'innodb_show_status.patch'
4480--- innodb_show_status.patch 2011-05-10 11:57:42 +0000
4481+++ innodb_show_status.patch 2011-06-20 09:04:39 +0000
4482@@ -62,7 +62,7 @@
4483 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
4484 --- a/storage/innobase/fil/fil0fil.c 2010-11-03 07:01:13.000000000 +0900
4485 +++ b/storage/innobase/fil/fil0fil.c 2010-12-03 15:07:31.790357112 +0900
4486-@@ -4884,3 +4884,30 @@
4487+@@ -4888,3 +4888,30 @@
4488
4489 fil_system = NULL;
4490 }
4491@@ -105,7 +105,7 @@
4492 {"buffer_pool_pages_free",
4493 (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG},
4494 #ifdef UNIV_DEBUG
4495-@@ -11074,6 +11076,16 @@
4496+@@ -11081,6 +11083,16 @@
4497 "Force InnoDB to not use next-key locking, to use only row-level locking.",
4498 NULL, NULL, FALSE);
4499
4500@@ -122,7 +122,7 @@
4501 #ifdef UNIV_LOG_ARCHIVE
4502 static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,
4503 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
4504-@@ -11261,7 +11273,7 @@
4505+@@ -11268,7 +11280,7 @@
4506
4507 static MYSQL_SYSVAR_STR(version, innodb_version_str,
4508 PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
4509@@ -131,7 +131,7 @@
4510
4511 static MYSQL_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,
4512 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
4513-@@ -11354,6 +11366,8 @@
4514+@@ -11361,6 +11373,8 @@
4515 MYSQL_SYSVAR(thread_concurrency),
4516 MYSQL_SYSVAR(thread_sleep_delay),
4517 MYSQL_SYSVAR(autoinc_lock_mode),
4518@@ -186,7 +186,7 @@
4519 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
4520 --- a/storage/innobase/include/srv0srv.h 2010-11-03 07:01:13.000000000 +0900
4521 +++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:07:31.813958103 +0900
4522-@@ -145,6 +145,9 @@
4523+@@ -142,6 +142,9 @@
4524 extern char srv_adaptive_flushing;
4525
4526
4527@@ -196,7 +196,7 @@
4528 /* The sort order table of the MySQL latin1_swedish_ci character set
4529 collation */
4530 extern const byte* srv_latin1_ordering;
4531-@@ -326,6 +329,8 @@
4532+@@ -323,6 +326,8 @@
4533 buffer pool to disk */
4534 extern ulint srv_buf_pool_flushed;
4535
4536@@ -205,7 +205,7 @@
4537 /** Number of buffer pool reads that led to the
4538 reading of a disk page */
4539 extern ulint srv_buf_pool_reads;
4540-@@ -705,6 +710,7 @@
4541+@@ -702,6 +707,7 @@
4542 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */
4543 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
4544 ulint innodb_buffer_pool_pages_flushed; /*!< srv_buf_pool_flushed */
4545@@ -309,7 +309,7 @@
4546 #include "mysql/plugin.h"
4547 #include "mysql/service_thd_wait.h"
4548
4549-@@ -194,6 +195,9 @@
4550+@@ -188,6 +189,9 @@
4551 the checkpoints. */
4552 UNIV_INTERN char srv_adaptive_flushing = TRUE;
4553
4554@@ -319,7 +319,7 @@
4555 /** Maximum number of times allowed to conditionally acquire
4556 mutex before switching to blocking wait on the mutex */
4557 #define MAX_MUTEX_NOWAIT 20
4558-@@ -320,6 +324,7 @@
4559+@@ -314,6 +318,7 @@
4560 /* variable to count the number of pages that were written from buffer
4561 pool to the disk */
4562 UNIV_INTERN ulint srv_buf_pool_flushed = 0;
4563@@ -327,7 +327,7 @@
4564
4565 /** Number of buffer pool reads that led to the
4566 reading of a disk page */
4567-@@ -1814,6 +1819,13 @@
4568+@@ -1823,6 +1828,13 @@
4569 ulint n_reserved;
4570 ibool ret;
4571
4572@@ -341,7 +341,7 @@
4573 mutex_enter(&srv_innodb_monitor_mutex);
4574
4575 current_time = time(NULL);
4576-@@ -1862,31 +1874,6 @@
4577+@@ -1871,31 +1883,6 @@
4578
4579 mutex_exit(&dict_foreign_err_mutex);
4580
4581@@ -373,7 +373,7 @@
4582 fputs("--------\n"
4583 "FILE I/O\n"
4584 "--------\n", file);
4585-@@ -1917,10 +1904,78 @@
4586+@@ -1926,10 +1913,78 @@
4587 "BUFFER POOL AND MEMORY\n"
4588 "----------------------\n", file);
4589 fprintf(file,
4590@@ -456,7 +456,7 @@
4591 fprintf(file, "Dictionary memory allocated " ULINTPF "\n",
4592 dict_sys->size);
4593
4594-@@ -1936,6 +1991,16 @@
4595+@@ -1945,6 +2000,16 @@
4596 fprintf(file, "%lu read views open inside InnoDB\n",
4597 UT_LIST_GET_LEN(trx_sys->view_list));
4598
4599@@ -473,7 +473,7 @@
4600 n_reserved = fil_space_get_n_reserved_extents(0);
4601 if (n_reserved > 0) {
4602 fprintf(file,
4603-@@ -1979,6 +2044,31 @@
4604+@@ -1988,6 +2053,31 @@
4605 srv_n_rows_deleted_old = srv_n_rows_deleted;
4606 srv_n_rows_read_old = srv_n_rows_read;
4607
4608@@ -505,7 +505,7 @@
4609 fputs("----------------------------\n"
4610 "END OF INNODB MONITOR OUTPUT\n"
4611 "============================\n", file);
4612-@@ -2022,6 +2112,7 @@
4613+@@ -2031,6 +2121,7 @@
4614 = srv_buf_pool_write_requests;
4615 export_vars.innodb_buffer_pool_wait_free = srv_buf_pool_wait_free;
4616 export_vars.innodb_buffer_pool_pages_flushed = srv_buf_pool_flushed;
4617
4618=== modified file 'innodb_show_status_extend.patch'
4619--- innodb_show_status_extend.patch 2011-05-10 11:57:42 +0000
4620+++ innodb_show_status_extend.patch 2011-06-20 09:04:39 +0000
4621@@ -245,7 +245,7 @@
4622 diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
4623 --- a/storage/innobase/include/srv0srv.h 2011-01-21 19:53:42.380638228 +0900
4624 +++ b/storage/innobase/include/srv0srv.h 2011-01-21 19:54:44.662600032 +0900
4625-@@ -738,6 +738,11 @@
4626+@@ -735,6 +735,11 @@
4627
4628 /** Status variables to be passed to MySQL */
4629 struct export_var_struct{
4630@@ -257,7 +257,7 @@
4631 ulint innodb_data_pending_reads; /*!< Pending reads */
4632 ulint innodb_data_pending_writes; /*!< Pending writes */
4633 ulint innodb_data_pending_fsyncs; /*!< Pending fsyncs */
4634-@@ -755,6 +760,9 @@
4635+@@ -752,6 +757,9 @@
4636 #ifdef UNIV_DEBUG
4637 ulint innodb_buffer_pool_pages_latched; /*!< Latched pages */
4638 #endif /* UNIV_DEBUG */
4639@@ -267,7 +267,7 @@
4640 ulint innodb_buffer_pool_read_requests; /*!< buf_pool->stat.n_page_gets */
4641 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */
4642 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
4643-@@ -763,13 +771,43 @@
4644+@@ -760,13 +768,43 @@
4645 ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */
4646 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
4647 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
4648@@ -311,7 +311,7 @@
4649 ulint innodb_os_log_written; /*!< srv_os_log_written */
4650 ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */
4651 ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */
4652-@@ -778,6 +816,8 @@
4653+@@ -775,6 +813,8 @@
4654 ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */
4655 ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read */
4656 ulint innodb_pages_written; /*!< buf_pool->stat.n_pages_written */
4657@@ -320,7 +320,7 @@
4658 ulint innodb_row_lock_waits; /*!< srv_n_lock_wait_count */
4659 ulint innodb_row_lock_current_waits; /*!< srv_n_lock_wait_current_count */
4660 ib_int64_t innodb_row_lock_time; /*!< srv_n_lock_wait_time
4661-@@ -787,11 +827,18 @@
4662+@@ -784,11 +824,18 @@
4663 / srv_n_lock_wait_count */
4664 ulint innodb_row_lock_time_max; /*!< srv_n_lock_max_wait_time
4665 / 1000 */
4666@@ -342,7 +342,7 @@
4667 diff -ruN a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
4668 --- a/storage/innobase/include/sync0sync.h 2011-01-21 19:48:45.982637372 +0900
4669 +++ b/storage/innobase/include/sync0sync.h 2011-01-21 19:54:44.664638235 +0900
4670-@@ -760,6 +760,10 @@
4671+@@ -769,6 +769,10 @@
4672
4673 #define SYNC_SPIN_ROUNDS srv_n_spin_wait_rounds
4674
4675@@ -391,7 +391,7 @@
4676 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
4677 --- a/storage/innobase/srv/srv0srv.c 2011-01-21 19:53:42.390637840 +0900
4678 +++ b/storage/innobase/srv/srv0srv.c 2011-01-21 19:54:44.673637084 +0900
4679-@@ -2248,12 +2248,49 @@
4680+@@ -2258,12 +2258,49 @@
4681 ulint LRU_len;
4682 ulint free_len;
4683 ulint flush_list_len;
4684@@ -441,7 +441,7 @@
4685 export_vars.innodb_data_pending_reads
4686 = os_n_pending_reads;
4687 export_vars.innodb_data_pending_writes
4688-@@ -2290,6 +2327,92 @@
4689+@@ -2300,6 +2337,92 @@
4690
4691 export_vars.innodb_buffer_pool_pages_misc
4692 = buf_pool_get_n_pages() - LRU_len - free_len;
4693
4694=== modified file 'innodb_show_sys_tables.patch'
4695--- innodb_show_sys_tables.patch 2011-05-23 03:13:18 +0000
4696+++ innodb_show_sys_tables.patch 2011-06-20 09:04:39 +0000
4697@@ -41,7 +41,7 @@
4698 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
4699 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:53:54.615040167 +0900
4700 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 16:07:26.851357007 +0900
4701-@@ -11765,7 +11765,14 @@
4702+@@ -11772,7 +11772,14 @@
4703 i_s_innodb_cmp,
4704 i_s_innodb_cmp_reset,
4705 i_s_innodb_cmpmem,
4706
4707=== modified file 'innodb_split_buf_pool_mutex.patch'
4708--- innodb_split_buf_pool_mutex.patch 2011-05-10 11:57:42 +0000
4709+++ innodb_split_buf_pool_mutex.patch 2011-06-20 09:04:39 +0000
4710@@ -2282,7 +2282,7 @@
4711 return(count);
4712 }
4713 @@ -1722,13 +1754,15 @@
4714- || sync_thread_levels_empty_gen(TRUE));
4715+ || sync_thread_levels_empty_except_dict());
4716 #endif /* UNIV_SYNC_DEBUG */
4717
4718 - buf_pool_mutex_enter(buf_pool);
4719@@ -3033,8 +3033,19 @@
4720 b->state = b->oldest_modification
4721 ? BUF_BLOCK_ZIP_DIRTY
4722 : BUF_BLOCK_ZIP_PAGE;
4723-@@ -1614,7 +1748,9 @@
4724+@@ -1597,6 +1731,7 @@
4725+ buf_LRU_add_block_low(b, buf_page_is_old(b));
4726+ }
4727+
4728++ mutex_enter(&buf_pool->zip_mutex);
4729+ if (b->state == BUF_BLOCK_ZIP_PAGE) {
4730+ buf_LRU_insert_zip_clean(b);
4731+ } else {
4732+@@ -1612,9 +1747,12 @@
4733+ buf_pool->mutex and block_mutex. */
4734+ b->buf_fix_count++;
4735 b->io_fix = BUF_IO_READ;
4736++ mutex_exit(&buf_pool->zip_mutex);
4737 }
4738
4739 - buf_pool_mutex_exit(buf_pool);
4740@@ -3044,7 +3055,7 @@
4741 mutex_exit(block_mutex);
4742
4743 /* Remove possible adaptive hash index on the page.
4744-@@ -1646,7 +1782,9 @@
4745+@@ -1646,7 +1784,9 @@
4746 : BUF_NO_CHECKSUM_MAGIC);
4747 }
4748
4749@@ -3055,7 +3066,7 @@
4750 mutex_enter(block_mutex);
4751
4752 if (b) {
4753-@@ -1656,13 +1794,17 @@
4754+@@ -1656,13 +1796,17 @@
4755 mutex_exit(&buf_pool->zip_mutex);
4756 }
4757
4758@@ -3074,7 +3085,7 @@
4759 }
4760
4761 return(BUF_LRU_FREED);
4762-@@ -1674,13 +1816,14 @@
4763+@@ -1674,13 +1818,14 @@
4764 void
4765 buf_LRU_block_free_non_file_page(
4766 /*=============================*/
4767@@ -3091,7 +3102,7 @@
4768 ut_ad(mutex_own(&block->mutex));
4769
4770 switch (buf_block_get_state(block)) {
4771-@@ -1714,18 +1857,21 @@
4772+@@ -1714,18 +1859,21 @@
4773 if (data) {
4774 block->page.zip.data = NULL;
4775 mutex_exit(&block->mutex);
4776@@ -3117,7 +3128,7 @@
4777
4778 UNIV_MEM_ASSERT_AND_FREE(block->frame, UNIV_PAGE_SIZE);
4779 }
4780-@@ -1755,7 +1901,11 @@
4781+@@ -1755,7 +1903,11 @@
4782 buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
4783
4784 ut_ad(bpage);
4785@@ -3130,7 +3141,7 @@
4786 ut_ad(mutex_own(buf_page_get_mutex(bpage)));
4787
4788 ut_a(buf_page_get_io_fix(bpage) == BUF_IO_NONE);
4789-@@ -1863,7 +2013,9 @@
4790+@@ -1863,7 +2015,9 @@
4791
4792 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
4793 mutex_exit(buf_page_get_mutex(bpage));
4794@@ -3141,7 +3152,7 @@
4795 buf_print();
4796 buf_LRU_print();
4797 buf_validate();
4798-@@ -1884,18 +2036,18 @@
4799+@@ -1884,18 +2038,18 @@
4800 ut_a(bpage->zip.data);
4801 ut_a(buf_page_get_zip_size(bpage));
4802
4803@@ -3165,7 +3176,7 @@
4804
4805 UNIV_MEM_UNDESC(bpage);
4806 return(BUF_BLOCK_ZIP_FREE);
4807-@@ -1918,13 +2070,13 @@
4808+@@ -1918,13 +2072,13 @@
4809 ut_ad(!bpage->in_flush_list);
4810 ut_ad(!bpage->in_LRU_list);
4811 mutex_exit(&((buf_block_t*) bpage)->mutex);
4812@@ -3182,7 +3193,7 @@
4813 mutex_enter(&((buf_block_t*) bpage)->mutex);
4814 page_zip_set_size(&bpage->zip, 0);
4815 }
4816-@@ -1950,18 +2102,19 @@
4817+@@ -1950,18 +2104,19 @@
4818 void
4819 buf_LRU_block_free_hashed_page(
4820 /*===========================*/
4821@@ -3206,7 +3217,7 @@
4822 }
4823
4824 /**********************************************************************//**
4825-@@ -1988,7 +2141,8 @@
4826+@@ -1988,7 +2143,8 @@
4827 }
4828
4829 if (adjust) {
4830@@ -3216,7 +3227,7 @@
4831
4832 if (ratio != buf_pool->LRU_old_ratio) {
4833 buf_pool->LRU_old_ratio = ratio;
4834-@@ -2000,7 +2154,8 @@
4835+@@ -2000,7 +2156,8 @@
4836 }
4837 }
4838
4839@@ -3226,7 +3237,7 @@
4840 } else {
4841 buf_pool->LRU_old_ratio = ratio;
4842 }
4843-@@ -2105,7 +2260,8 @@
4844+@@ -2105,7 +2262,8 @@
4845 ulint new_len;
4846
4847 ut_ad(buf_pool);
4848@@ -3236,7 +3247,7 @@
4849
4850 if (UT_LIST_GET_LEN(buf_pool->LRU) >= BUF_LRU_OLD_MIN_LEN) {
4851
4852-@@ -2166,16 +2322,22 @@
4853+@@ -2166,16 +2324,22 @@
4854
4855 ut_a(buf_pool->LRU_old_len == old_len);
4856
4857@@ -3261,7 +3272,7 @@
4858 UT_LIST_VALIDATE(unzip_LRU, buf_block_t, buf_pool->unzip_LRU,
4859 ut_ad(ut_list_node_313->in_unzip_LRU_list
4860 && ut_list_node_313->page.in_LRU_list));
4861-@@ -2189,7 +2351,8 @@
4862+@@ -2189,7 +2353,8 @@
4863 ut_a(buf_page_belongs_to_unzip_LRU(&block->page));
4864 }
4865
4866@@ -3271,7 +3282,7 @@
4867 }
4868
4869 /**********************************************************************//**
4870-@@ -2225,7 +2388,8 @@
4871+@@ -2225,7 +2390,8 @@
4872 const buf_page_t* bpage;
4873
4874 ut_ad(buf_pool);
4875@@ -3281,7 +3292,7 @@
4876
4877 bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
4878
4879-@@ -2282,7 +2446,8 @@
4880+@@ -2282,7 +2448,8 @@
4881 bpage = UT_LIST_GET_NEXT(LRU, bpage);
4882 }
4883
4884@@ -3388,7 +3399,7 @@
4885 diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
4886 --- a/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:03.068954202 +0900
4887 +++ b/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:29.335988682 +0900
4888-@@ -3832,9 +3832,11 @@
4889+@@ -3821,9 +3821,11 @@
4890 ulint fold = buf_page_address_fold(space, page_no);
4891 buf_pool_t* buf_pool = buf_pool_get(space, page_no);
4892
4893@@ -3897,7 +3908,7 @@
4894 extern mysql_pfs_key_t cache_last_read_mutex_key;
4895 extern mysql_pfs_key_t dict_foreign_err_mutex_key;
4896 extern mysql_pfs_key_t dict_sys_mutex_key;
4897-@@ -659,7 +663,7 @@
4898+@@ -668,7 +672,7 @@
4899 #define SYNC_TRX_SYS_HEADER 290
4900 #define SYNC_PURGE_QUEUE 200
4901 #define SYNC_LOG 170
4902@@ -3906,7 +3917,7 @@
4903 #define SYNC_RECV 168
4904 #define SYNC_WORK_QUEUE 162
4905 #define SYNC_SEARCH_SYS_CONF 161 /* for assigning btr_search_enabled */
4906-@@ -669,8 +673,13 @@
4907+@@ -678,8 +682,13 @@
4908 SYNC_SEARCH_SYS, as memory allocation
4909 can call routines there! Otherwise
4910 the level is SYNC_MEM_HASH. */
4911@@ -3921,7 +3932,7 @@
4912 #define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */
4913 #define SYNC_DOUBLEWRITE 140
4914 #define SYNC_ANY_LATCH 135
4915-@@ -702,7 +711,7 @@
4916+@@ -711,7 +720,7 @@
4917 os_fast_mutex; /*!< We use this OS mutex in place of lock_word
4918 when atomic operations are not enabled */
4919 #endif
4920@@ -3933,7 +3944,7 @@
4921 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
4922 --- a/storage/innobase/srv/srv0srv.c 2010-12-03 15:48:03.080956216 +0900
4923 +++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:48:29.355023766 +0900
4924-@@ -3089,7 +3089,7 @@
4925+@@ -3098,7 +3098,7 @@
4926 level += log_sys->max_checkpoint_age
4927 - (lsn - oldest_modification);
4928 }
4929@@ -3942,7 +3953,7 @@
4930 n_blocks++;
4931 }
4932
4933-@@ -3175,7 +3175,7 @@
4934+@@ -3184,7 +3184,7 @@
4935 found = TRUE;
4936 break;
4937 }
4938@@ -3987,7 +3998,7 @@
4939 }
4940
4941 /******************************************************************//**
4942-@@ -1189,7 +1199,12 @@
4943+@@ -1234,7 +1244,12 @@
4944 ut_error;
4945 }
4946 break;
4947@@ -4000,7 +4011,7 @@
4948 case SYNC_BUF_POOL:
4949 /* We can have multiple mutexes of this type therefore we
4950 can only check whether the greater than condition holds. */
4951-@@ -1207,7 +1222,8 @@
4952+@@ -1252,7 +1267,8 @@
4953 buffer block (block->mutex or buf_pool->zip_mutex). */
4954 if (!sync_thread_levels_g(array, level, FALSE)) {
4955 ut_a(sync_thread_levels_g(array, level - 1, TRUE));
4956
4957=== modified file 'innodb_stats.patch'
4958--- innodb_stats.patch 2011-05-23 03:13:18 +0000
4959+++ innodb_stats.patch 2011-06-20 09:04:39 +0000
4960@@ -350,7 +350,7 @@
4961 diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
4962 --- a/storage/innobase/dict/dict0dict.c 2010-12-03 15:48:03.040222428 +0900
4963 +++ b/storage/innobase/dict/dict0dict.c 2010-12-03 17:19:24.841947690 +0900
4964-@@ -756,7 +756,7 @@
4965+@@ -755,7 +755,7 @@
4966 print an error message and return without doing
4967 anything. */
4968 dict_update_statistics(table, TRUE /* only update stats
4969@@ -359,7 +359,7 @@
4970 }
4971
4972 return(table);
4973-@@ -4310,6 +4310,289 @@
4974+@@ -4309,6 +4309,295 @@
4975 }
4976
4977 /*********************************************************************//**
4978@@ -592,6 +592,8 @@
4979 + break;
4980 + }
4981 +
4982++ btr_pcur_store_position(&pcur, &mtr);
4983++
4984 + if (rec_get_deleted_flag(rec, 0)) {
4985 + /* don't count */
4986 + i--;
4987@@ -626,6 +628,10 @@
4988 + rests--;
4989 +
4990 +next_rec:
4991++ mtr_commit(&mtr);
4992++ mtr_start(&mtr);
4993++ btr_pcur_restore_position(BTR_MODIFY_LEAF, &pcur, &mtr);
4994++
4995 + btr_pcur_move_to_next_user_rec(&pcur, &mtr);
4996 + }
4997 + btr_pcur_close(&pcur);
4998@@ -649,7 +655,7 @@
4999 Calculates new estimates for table and index statistics. The statistics
5000 are used in query optimization. */
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches