Merge lp:~percona-dev/percona-server/5.1.54-remove_warnings-yasufumi into lp:percona-server/release-5.1.54-12

Proposed by Yasufumi Kinoshita
Status: Merged
Approved by: Vadim Tkachenko
Approved revision: no longer in the source branch.
Merged at revision: 193
Proposed branch: lp:~percona-dev/percona-server/5.1.54-remove_warnings-yasufumi
Merge into: lp:percona-server/release-5.1.54-12
Diff against target: 1414 lines (+411/-238)
15 files modified
innodb_dict_size_limit.patch (+128/-81)
innodb_expand_import.patch (+2/-2)
innodb_extend_slow.patch (+4/-17)
innodb_files_extend.patch (+63/-9)
innodb_fix_misc.patch (+21/-1)
innodb_io_patches.patch (+14/-10)
innodb_lru_dump_restore.patch (+8/-25)
innodb_pass_corrupt_table.patch (+3/-3)
innodb_purge_thread.patch (+6/-6)
innodb_separate_doublewrite.patch (+12/-4)
innodb_show_lock_name.patch (+62/-22)
innodb_split_buf_pool_mutex.patch (+63/-43)
innodb_stats.patch (+1/-1)
profiling_slow.patch (+1/-1)
userstat.patch (+23/-13)
To merge this branch: bzr merge lp:~percona-dev/percona-server/5.1.54-remove_warnings-yasufumi
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Percona developers Pending
Review via email: mp+48326@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

I will fix same for 5.5.8 later.

Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

Alexey,

Please confirm to build with this branch, if you have time.
Is your compiler satisfied with it?

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Yes, when merged with my changes in the core server, it now builds with -Werror.

review: Approve
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

Thanks, but I cannot build with -Werror.

e.g.
many of
"warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result"
are from normal mysql code.

Your environment seems more looser than mine. :-)

Revision history for this message
Alexey Kopytov (akopytov) wrote :

> e.g.
> many of
> "warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result"
> are from normal mysql code.

> Your environment seems more looser than mine. :-)

See http://bugs.mysql.com/bug.php?id=58402.

Most likely it's a bug in the system headers on your machine.

Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

Aha.
I understand all of what you don't like is treated as bug...:-(
Are you bugs.mysql.com?

It is warning. Severely, return value of fwrite should not be ignored.

Naturally, each system have each criteria about warning.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innodb_dict_size_limit.patch'
2--- innodb_dict_size_limit.patch 2010-12-16 11:35:26 +0000
3+++ innodb_dict_size_limit.patch 2011-02-02 15:07:48 +0000
4@@ -8,7 +8,7 @@
5 diff -ruN a/storage/innodb_plugin/btr/btr0sea.c b/storage/innodb_plugin/btr/btr0sea.c
6 --- a/storage/innodb_plugin/btr/btr0sea.c 2010-08-04 02:24:19.000000000 +0900
7 +++ b/storage/innodb_plugin/btr/btr0sea.c 2010-08-27 16:09:42.926020757 +0900
8-@@ -1173,6 +1173,126 @@
9+@@ -1173,6 +1173,173 @@
10 mem_free(folds);
11 }
12
13@@ -20,7 +20,7 @@
14 +/*=====================================*/
15 + dict_index_t* index) /* in: record descriptor */
16 +{
17-+ buf_page_t* bpage;
18++
19 + hash_table_t* table;
20 + buf_block_t* block;
21 + ulint n_fields;
22@@ -36,96 +36,143 @@
23 + ulint i;
24 + mem_heap_t* heap = NULL;
25 + ulint* offsets;
26++ ibool released_search_latch;
27 +
28-+ rw_lock_x_lock(&btr_search_latch);
29-+ buf_pool_mutex_enter();
30++ rw_lock_s_lock(&btr_search_latch);
31 +
32 + table = btr_search_sys->hash_index;
33 +
34-+ bpage = UT_LIST_GET_LAST(buf_pool->LRU);
35-+
36-+ while (bpage != NULL) {
37-+ block = (buf_block_t*) bpage;
38-+ if (block->index == index && block->is_hashed) {
39-+ page = block->frame;
40-+
41-+ /* from btr_search_drop_page_hash_index() */
42-+ n_fields = block->curr_n_fields;
43-+ n_bytes = block->curr_n_bytes;
44-+
45-+ ut_a(n_fields + n_bytes > 0);
46-+
47-+ n_recs = page_get_n_recs(page);
48-+
49-+ /* Calculate and cache fold values into an array for fast deletion
50-+ from the hash index */
51-+
52-+ folds = mem_alloc(n_recs * sizeof(ulint));
53-+
54-+ n_cached = 0;
55-+
56-+ rec = page_get_infimum_rec(page);
57-+ rec = page_rec_get_next_low(rec, page_is_comp(page));
58-+
59-+ index_id = btr_page_get_index_id(page);
60++ do {
61++ buf_chunk_t* chunks = buf_pool->chunks;
62++ buf_chunk_t* chunk = chunks + buf_pool->n_chunks;
63++
64++ released_search_latch = FALSE;
65++
66++ while (--chunk >= chunks) {
67++ block = chunk->blocks;
68++ i = chunk->size;
69++
70++retry:
71++ for (; i--; block++) {
72++ if (buf_block_get_state(block)
73++ != BUF_BLOCK_FILE_PAGE
74++ || block->index != index
75++ || !block->is_hashed) {
76++ continue;
77++ }
78++
79++ page = block->frame;
80++
81++ /* from btr_search_drop_page_hash_index() */
82++ n_fields = block->curr_n_fields;
83++ n_bytes = block->curr_n_bytes;
84++
85++
86++ /* keeping latch order */
87++ rw_lock_s_unlock(&btr_search_latch);
88++ released_search_latch = TRUE;
89++ rw_lock_x_lock(&block->lock);
90++
91++
92++ ut_a(n_fields + n_bytes > 0);
93++
94++ n_recs = page_get_n_recs(page);
95++
96++ /* Calculate and cache fold values into an array for fast deletion
97++ from the hash index */
98++
99++ folds = mem_alloc(n_recs * sizeof(ulint));
100++
101++ n_cached = 0;
102++
103++ rec = page_get_infimum_rec(page);
104++ rec = page_rec_get_next_low(rec, page_is_comp(page));
105++
106++ index_id = btr_page_get_index_id(page);
107 +
108-+ ut_a(0 == ut_dulint_cmp(index_id, index->id));
109-+
110-+ prev_fold = 0;
111-+
112-+ offsets = NULL;
113-+
114-+ while (!page_rec_is_supremum(rec)) {
115-+ offsets = rec_get_offsets(rec, index, offsets,
116-+ n_fields + (n_bytes > 0), &heap);
117-+ ut_a(rec_offs_n_fields(offsets) == n_fields + (n_bytes > 0));
118-+ fold = rec_fold(rec, offsets, n_fields, n_bytes, index_id);
119-+
120-+ if (fold == prev_fold && prev_fold != 0) {
121-+
122-+ goto next_rec;
123-+ }
124-+
125-+ /* Remove all hash nodes pointing to this page from the
126-+ hash chain */
127-+
128-+ folds[n_cached] = fold;
129-+ n_cached++;
130++ ut_a(0 == ut_dulint_cmp(index_id, index->id));
131++
132++ prev_fold = 0;
133++
134++ offsets = NULL;
135++
136++ while (!page_rec_is_supremum(rec)) {
137++ offsets = rec_get_offsets(rec, index, offsets,
138++ n_fields + (n_bytes > 0), &heap);
139++ ut_a(rec_offs_n_fields(offsets) == n_fields + (n_bytes > 0));
140++ fold = rec_fold(rec, offsets, n_fields, n_bytes, index_id);
141++
142++ if (fold == prev_fold && prev_fold != 0) {
143++
144++ goto next_rec;
145++ }
146++
147++ /* Remove all hash nodes pointing to this page from the
148++ hash chain */
149++
150++ folds[n_cached] = fold;
151++ n_cached++;
152 +next_rec:
153-+ rec = page_rec_get_next_low(rec, page_rec_is_comp(rec));
154-+ prev_fold = fold;
155-+ }
156-+
157-+ for (i = 0; i < n_cached; i++) {
158-+
159-+ ha_remove_all_nodes_to_page(table, folds[i], page);
160-+ }
161-+
162-+ ut_a(index->search_info->ref_count > 0);
163-+ index->search_info->ref_count--;
164-+
165-+ block->is_hashed = FALSE;
166-+ block->index = NULL;
167-+
168++ rec = page_rec_get_next_low(rec, page_rec_is_comp(rec));
169++ prev_fold = fold;
170++ }
171++
172++ if (UNIV_LIKELY_NULL(heap)) {
173++ mem_heap_empty(heap);
174++ }
175++
176++ rw_lock_x_lock(&btr_search_latch);
177++
178++ if (UNIV_UNLIKELY(!block->is_hashed)) {
179++ goto cleanup;
180++ }
181++
182++ ut_a(block->index == index);
183++
184++ if (UNIV_UNLIKELY(block->curr_n_fields != n_fields)
185++ || UNIV_UNLIKELY(block->curr_n_bytes != n_bytes)) {
186++ rw_lock_x_unlock(&btr_search_latch);
187++ rw_lock_x_unlock(&block->lock);
188++
189++ mem_free(folds);
190++
191++ rw_lock_s_lock(&btr_search_latch);
192++ goto retry;
193++ }
194++
195++ for (i = 0; i < n_cached; i++) {
196++
197++ ha_remove_all_nodes_to_page(table, folds[i], page);
198++ }
199++
200++ ut_a(index->search_info->ref_count > 0);
201++ index->search_info->ref_count--;
202++
203++ block->is_hashed = FALSE;
204++ block->index = NULL;
205++
206++cleanup:
207 +#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
208-+ if (UNIV_UNLIKELY(block->n_pointers)) {
209-+ /* Corruption */
210-+ ut_print_timestamp(stderr);
211-+ fprintf(stderr,
212++ if (UNIV_UNLIKELY(block->n_pointers)) {
213++ /* Corruption */
214++ ut_print_timestamp(stderr);
215++ fprintf(stderr,
216 +" InnoDB: Corruption of adaptive hash index. After dropping\n"
217 +"InnoDB: the hash index to a page of %s, still %lu hash nodes remain.\n",
218-+ index->name, (ulong) block->n_pointers);
219-+ }
220++ index->name, (ulong) block->n_pointers);
221++ }
222 +#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
223-+
224-+ mem_free(folds);
225++ rw_lock_x_unlock(&btr_search_latch);
226++ rw_lock_x_unlock(&block->lock);
227++
228++ mem_free(folds);
229++
230++ rw_lock_s_lock(&btr_search_latch);
231++ }
232 + }
233-+
234-+ bpage = UT_LIST_GET_PREV(LRU, bpage);
235-+ }
236-+
237-+ buf_pool_mutex_exit();
238-+ rw_lock_x_unlock(&btr_search_latch);
239++ } while (released_search_latch);
240++
241++ rw_lock_s_unlock(&btr_search_latch);
242 +
243 + if (UNIV_LIKELY_NULL(heap)) {
244 + mem_heap_free(heap);
245
246=== modified file 'innodb_expand_import.patch'
247--- innodb_expand_import.patch 2010-12-16 11:35:26 +0000
248+++ innodb_expand_import.patch 2011-02-02 15:07:48 +0000
249@@ -34,8 +34,8 @@
250 space_id = fsp_header_get_space_id(page);
251 space_flags = fsp_header_get_flags(page);
252
253-+ if (srv_expand_import
254-+ && (space_id != id || space_flags != (flags & ~(~0 << DICT_TF_BITS)))) {
255++ if (srv_expand_import) {
256++
257 + ibool file_is_corrupt = FALSE;
258 + byte* buf3;
259 + byte* descr_page;
260
261=== modified file 'innodb_extend_slow.patch'
262--- innodb_extend_slow.patch 2010-12-16 11:35:26 +0000
263+++ innodb_extend_slow.patch 2011-02-02 15:07:48 +0000
264@@ -37,9 +37,9 @@
265 + block->page.offset, DPAH_SIZE << 3);
266 + block_hash_byte = block_hash >> 3;
267 + block_hash_offset = (byte) block_hash & 0x07;
268-+ if (block_hash_byte < 0 || block_hash_byte >= DPAH_SIZE)
269++ if (block_hash_byte >= DPAH_SIZE)
270 + fprintf(stderr, "!!! block_hash_byte = %lu block_hash_offset = %d !!!\n", block_hash_byte, block_hash_offset);
271-+ if (block_hash_offset < 0 || block_hash_offset > 7)
272++ if (block_hash_offset > 7)
273 + fprintf(stderr, "!!! block_hash_byte = %lu block_hash_offset = %d !!!\n", block_hash_byte, block_hash_offset);
274 + if ((trx->distinct_page_access_hash[block_hash_byte] & ((byte) 0x01 << block_hash_offset)) == 0)
275 + trx->distinct_page_access++;
276@@ -766,16 +766,6 @@
277
278 if ((ulint)ret == n) {
279
280-@@ -3356,7 +3390,8 @@
281- offset */
282- ulint offset_high, /*!< in: most significant 32 bits of
283- offset */
284-- ulint len) /*!< in: length of the block to read or write */
285-+ ulint len, /*!< in: length of the block to read or write */
286-+ trx_t* trx)
287- {
288- os_aio_slot_t* slot;
289- ulint i;
290 @@ -3642,10 +3677,11 @@
291 (can be used to identify a completed
292 aio operation); ignored if mode is
293@@ -800,7 +790,7 @@
294 }
295
296 ut_a(type == OS_FILE_WRITE);
297-@@ -3721,8 +3757,13 @@
298+@@ -3721,6 +3757,11 @@
299 ut_error;
300 }
301
302@@ -810,11 +800,8 @@
303 + trx->io_read += n;
304 + }
305 slot = os_aio_array_reserve_slot(type, array, message1, message2, file,
306-- name, buf, offset, offset_high, n);
307-+ name, buf, offset, offset_high, n, trx);
308+ name, buf, offset, offset_high, n);
309 if (type == OS_FILE_READ) {
310- if (os_aio_use_native_aio) {
311- #ifdef WIN_ASYNC_IO
312 diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
313 --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:27:30.233022109 +0900
314 +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:30:47.384058509 +0900
315
316=== modified file 'innodb_files_extend.patch'
317--- innodb_files_extend.patch 2010-12-16 11:35:26 +0000
318+++ innodb_files_extend.patch 2011-02-02 15:07:48 +0000
319@@ -20,6 +20,33 @@
320 diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
321 --- a/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:43:11.941989968 +0900
322 +++ b/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:44:21.668058937 +0900
323+@@ -690,7 +690,7 @@
324+ ut_a(space->purpose != FIL_LOG);
325+ ut_a(!trx_sys_sys_space(space->id));
326+
327+- if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
328++ if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
329+ fprintf(stderr,
330+ "InnoDB: Error: the size of single-table"
331+ " tablespace file %s\n"
332+@@ -3778,7 +3778,7 @@
333+
334+ size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
335+ #ifndef UNIV_HOTBACKUP
336+- if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
337++ if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
338+ fprintf(stderr,
339+ "InnoDB: Error: the size of single-table tablespace"
340+ " file %s\n"
341+@@ -3798,7 +3798,7 @@
342+ /* Align the memory for file i/o if we might have O_DIRECT set */
343+ page = ut_align(buf2, UNIV_PAGE_SIZE);
344+
345+- if (size >= FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
346++ if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
347+ success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
348+
349+ /* We have to read the tablespace id from the file */
350 @@ -4776,9 +4776,9 @@
351 ut_ad(ut_is_2pow(zip_size));
352 ut_ad(buf);
353@@ -36,28 +63,36 @@
354 diff -ruN a/storage/innodb_plugin/fsp/fsp0fsp.c b/storage/innodb_plugin/fsp/fsp0fsp.c
355 --- a/storage/innodb_plugin/fsp/fsp0fsp.c 2010-08-27 16:40:36.528021375 +0900
356 +++ b/storage/innodb_plugin/fsp/fsp0fsp.c 2010-08-27 16:44:21.673058570 +0900
357-@@ -658,15 +658,16 @@
358+@@ -657,16 +657,18 @@
359+ 0 for uncompressed pages */
360 ulint offset) /*!< in: page offset */
361 {
362- #ifndef DOXYGEN /* Doxygen gets confused of these */
363+-#ifndef DOXYGEN /* Doxygen gets confused of these */
364 -# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
365 - + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
366 -# error
367 -# endif
368+-# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
369+- + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
370+-# error
371+-# endif
372+-#endif /* !DOXYGEN */
373++//#ifndef DOXYGEN /* Doxygen gets confused of these */
374 +//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET
375 +// + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
376 +//# error
377 +//# endif
378- # if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
379- + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
380- # error
381- # endif
382- #endif /* !DOXYGEN */
383++//# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET
384++// + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
385++//# error
386++//# endif
387++//#endif /* !DOXYGEN */
388 + ut_a(UNIV_PAGE_SIZE > XDES_ARR_OFFSET + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
389++ ut_a(PAGE_ZIP_MIN_SIZE > XDES_ARR_OFFSET + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
390 ut_ad(ut_is_2pow(zip_size));
391
392 if (!zip_size) {
393-@@ -1465,12 +1466,12 @@
394+@@ -1465,12 +1467,12 @@
395 mtr);
396 xdes_init(descr, mtr);
397
398@@ -235,7 +270,7 @@
399 diff -ruN a/storage/innodb_plugin/include/buf0types.h b/storage/innodb_plugin/include/buf0types.h
400 --- a/storage/innodb_plugin/include/buf0types.h 2010-08-04 02:24:19.000000000 +0900
401 +++ b/storage/innodb_plugin/include/buf0types.h 2010-08-27 16:44:21.692071229 +0900
402-@@ -70,6 +70,7 @@
403+@@ -70,12 +70,13 @@
404 buddy system; must be at least
405 sizeof(buf_page_t) */
406 #define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
407@@ -243,6 +278,25 @@
408 /*!< number of buddy sizes */
409
410 /** twice the maximum block size of the buddy system;
411+ the underlying memory is aligned by this amount:
412+ this must be equal to UNIV_PAGE_SIZE */
413+-#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
414++#define BUF_BUDDY_HIGH ((ulint)BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
415+ /* @} */
416+
417+ #endif
418+diff -ruN a/storage/innodb_plugin/include/fsp0types.h b/storage/innodb_plugin/include/fsp0types.h
419+--- a/storage/innodb_plugin/include/fsp0types.h 2010-11-29 19:38:03.000000000 +0900
420++++ b/storage/innodb_plugin/include/fsp0types.h 2011-02-02 23:29:13.000000000 +0900
421+@@ -42,7 +42,7 @@
422+ /* @} */
423+
424+ /** File space extent size (one megabyte) in pages */
425+-#define FSP_EXTENT_SIZE (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
426++#define FSP_EXTENT_SIZE ((ulint)1 << (20 - UNIV_PAGE_SIZE_SHIFT))
427+
428+ /** On a page of any file segment, data may be put starting from this
429+ offset */
430 diff -ruN a/storage/innodb_plugin/include/log0log.h b/storage/innodb_plugin/include/log0log.h
431 --- a/storage/innodb_plugin/include/log0log.h 2010-11-03 22:39:54.000000000 +0900
432 +++ b/storage/innodb_plugin/include/log0log.h 2010-12-13 20:17:00.600329611 +0900
433
434=== modified file 'innodb_fix_misc.patch'
435--- innodb_fix_misc.patch 2010-12-20 21:54:44 +0000
436+++ innodb_fix_misc.patch 2011-02-02 15:07:48 +0000
437@@ -51,10 +51,30 @@
438
439 #define REFMAN "http://dev.mysql.com/doc/refman/5.1/en/"
440
441+diff -ruN a/storage/innodb_plugin/mtr/mtr0log.c b/storage/innodb_plugin/mtr/mtr0log.c
442+--- a/storage/innodb_plugin/mtr/mtr0log.c 2010-11-29 19:38:03.000000000 +0900
443++++ b/storage/innodb_plugin/mtr/mtr0log.c 2011-02-02 23:31:34.000000000 +0900
444+@@ -408,7 +408,7 @@
445+ ptr += 2;
446+
447+ if (UNIV_UNLIKELY(offset >= UNIV_PAGE_SIZE)
448+- || UNIV_UNLIKELY(len + offset) > UNIV_PAGE_SIZE) {
449++ || UNIV_UNLIKELY(len + offset > UNIV_PAGE_SIZE)) {
450+ recv_sys->found_corrupt_log = TRUE;
451+
452+ return(NULL);
453 diff -ruN a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
454 --- a/storage/innodb_plugin/row/row0mysql.c 2010-07-20 16:33:04.097866666 +0900
455 +++ b/storage/innodb_plugin/row/row0mysql.c 2010-07-20 16:33:53.995828763 +0900
456-@@ -1135,6 +1135,13 @@
457+@@ -51,6 +51,7 @@
458+ #include "btr0sea.h"
459+ #include "fil0fil.h"
460+ #include "ibuf0ibuf.h"
461++#include "ha_prototypes.h"
462+
463+ /** Provide optional 4.x backwards compatibility for 5.0 and above */
464+ UNIV_INTERN ibool row_rollback_on_timeout = FALSE;
465+@@ -1135,6 +1136,13 @@
466
467 thr = que_fork_get_first_thr(prebuilt->ins_graph);
468
469
470=== modified file 'innodb_io_patches.patch'
471--- innodb_io_patches.patch 2010-12-16 11:35:26 +0000
472+++ innodb_io_patches.patch 2011-02-02 15:07:48 +0000
473@@ -963,7 +963,7 @@
474 /*-------------------------------------------*/
475 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
476 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
477-@@ -2477,15 +2488,30 @@
478+@@ -2477,15 +2488,31 @@
479 ulint n_pages_purged = 0;
480 ulint n_bytes_merged;
481 ulint n_pages_flushed;
482@@ -985,7 +985,8 @@
483 + unsigned space:32;
484 + unsigned offset:32;
485 + ib_uint64_t oldest_modification;
486-+ } prev_flush_info;
487++ };
488++ struct t_prev_flush_info_struct prev_flush_info = {0,0,0,0};
489 +
490 + ib_uint64_t lsn_old;
491 +
492@@ -994,7 +995,7 @@
493 #ifdef UNIV_DEBUG_THREAD_CREATION
494 fprintf(stderr, "Master thread starts, id %lu\n",
495 os_thread_pf(os_thread_get_curr_id()));
496-@@ -2501,6 +2527,9 @@
497+@@ -2501,6 +2528,9 @@
498
499 mutex_exit(&kernel_mutex);
500
501@@ -1004,7 +1005,7 @@
502 loop:
503 /*****************************************************************/
504 /* ---- When there is database activity by users, we cycle in this
505-@@ -2528,16 +2557,38 @@
506+@@ -2528,16 +2558,40 @@
507 srv_last_log_flush_time = time(NULL);
508 skip_sleep = FALSE;
509
510@@ -1013,6 +1014,8 @@
511 for (i = 0; i < 10; i++) {
512 + ulint cur_time = ut_time_ms();
513 +
514++ n_pages_flushed = 0; /* initialize */
515++
516 n_ios_old = log_sys->n_log_ios + buf_pool->stat.n_pages_read
517 + buf_pool->stat.n_pages_written;
518 srv_main_thread_op_info = "sleeping";
519@@ -1044,7 +1047,7 @@
520 }
521
522 skip_sleep = FALSE;
523-@@ -2574,7 +2625,7 @@
524+@@ -2574,7 +2628,7 @@
525 if (n_pend_ios < SRV_PEND_IO_THRESHOLD
526 && (n_ios - n_ios_old < SRV_RECENT_IO_ACTIVITY)) {
527 srv_main_thread_op_info = "doing insert buffer merge";
528@@ -1053,7 +1056,7 @@
529
530 /* Flush logs if needed */
531 srv_sync_log_buffer_in_background();
532-@@ -2598,6 +2649,11 @@
533+@@ -2598,6 +2652,11 @@
534 iteration of this loop. */
535
536 skip_sleep = TRUE;
537@@ -1065,7 +1068,7 @@
538 } else if (srv_adaptive_flushing) {
539
540 /* Try to keep the rate of flushing of dirty
541-@@ -2619,6 +2675,255 @@
542+@@ -2619,6 +2678,256 @@
543 skip_sleep = TRUE;
544 }
545 }
546@@ -1221,7 +1224,8 @@
547 +
548 + if (prev_adaptive_checkpoint == 3) {
549 + lint n_flush;
550-+ lint blocks_sum, new_blocks_sum, flushed_blocks_sum;
551++ lint blocks_sum;
552++ ulint new_blocks_sum, flushed_blocks_sum;
553 +
554 + blocks_sum = new_blocks_sum = flushed_blocks_sum = 0;
555 +
556@@ -1321,7 +1325,7 @@
557 }
558
559 if (srv_activity_count == old_activity_count) {
560-@@ -2667,7 +2972,7 @@
561+@@ -2667,7 +2976,7 @@
562 even if the server were active */
563
564 srv_main_thread_op_info = "doing insert buffer merge";
565@@ -1330,7 +1334,7 @@
566
567 /* Flush logs if needed */
568 srv_sync_log_buffer_in_background();
569-@@ -2792,7 +3097,7 @@
570+@@ -2792,7 +3101,7 @@
571 buf_flush_batch below. Otherwise, the system favors
572 clean pages over cleanup throughput. */
573 n_bytes_merged = ibuf_contract_for_n_pages(FALSE,
574
575=== modified file 'innodb_lru_dump_restore.patch'
576--- innodb_lru_dump_restore.patch 2010-12-22 18:24:52 +0000
577+++ innodb_lru_dump_restore.patch 2011-02-02 15:07:48 +0000
578@@ -42,7 +42,7 @@
579 diff -ruN a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c
580 --- a/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:13:11.070058073 +0900
581 +++ b/storage/innodb_plugin/buf/buf0lru.c 2010-08-27 16:34:33.860400549 +0900
582-@@ -2122,6 +2122,278 @@
583+@@ -2122,6 +2122,277 @@
584 memset(&buf_LRU_stat_cur, 0, sizeof buf_LRU_stat_cur);
585 }
586
587@@ -285,8 +285,7 @@
588 + continue;
589 + }
590 +
591-+ if (fil_area_is_exist(space_id, zip_size, page_no, 0,
592-+ zip_size ? zip_size : UNIV_PAGE_SIZE)) {
593++ if (fil_is_exist(space_id, page_no)) {
594 +
595 + tablespace_version = fil_space_get_version(space_id);
596 +
597@@ -336,7 +335,7 @@
598 diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
599 --- a/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:32:40.298411400 +0900
600 +++ b/storage/innodb_plugin/fil/fil0fil.c 2010-08-27 16:34:33.868058362 +0900
601-@@ -4915,6 +4915,78 @@
602+@@ -4915,6 +4915,70 @@
603 return(DB_SUCCESS);
604 }
605
606@@ -344,18 +343,10 @@
607 +Confirm whether the parameters are valid or not */
608 +UNIV_INTERN
609 +ibool
610-+fil_area_is_exist(
611++fil_is_exist(
612 +/*==============*/
613 + ulint space_id, /*!< in: space id */
614-+ ulint zip_size, /*!< in: compressed page size in bytes;
615-+ 0 for uncompressed pages */
616-+ ulint block_offset, /*!< in: offset in number of blocks */
617-+ ulint byte_offset, /*!< in: remainder of offset in bytes; in
618-+ aio this must be divisible by the OS block
619-+ size */
620-+ ulint len) /*!< in: how many bytes to read or write; this
621-+ must not cross a file boundary; in aio this
622-+ must be a block size multiple */
623++ ulint block_offset) /*!< in: offset in number of blocks */
624 +{
625 + fil_space_t* space;
626 + fil_node_t* node;
627@@ -563,7 +554,7 @@
628 diff -ruN a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h
629 --- a/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:32:40.315012507 +0900
630 +++ b/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:34:33.878063455 +0900
631-@@ -643,6 +643,22 @@
632+@@ -643,6 +643,14 @@
633 void* message, /*!< in: message for aio handler if non-sync
634 aio used, else ignored */
635 trx_t* trx);
636@@ -571,18 +562,10 @@
637 +Confirm whether the parameters are valid or not */
638 +UNIV_INTERN
639 +ibool
640-+fil_area_is_exist(
641++fil_is_exist(
642 +/*==============*/
643 + ulint space_id, /*!< in: space id */
644-+ ulint zip_size, /*!< in: compressed page size in bytes;
645-+ 0 for uncompressed pages */
646-+ ulint block_offset, /*!< in: offset in number of blocks */
647-+ ulint byte_offset, /*!< in: remainder of offset in bytes; in
648-+ aio this must be divisible by the OS block
649-+ size */
650-+ ulint len); /*!< in: how many bytes to read or write; this
651-+ must not cross a file boundary; in aio this
652-+ must be a block size multiple */
653++ ulint block_offset); /*!< in: offset in number of blocks */
654 /**********************************************************************//**
655 Waits for an aio operation to complete. This function is used to write the
656 handler for completed requests. The aio array of pending requests is divided
657
658=== modified file 'innodb_pass_corrupt_table.patch'
659--- innodb_pass_corrupt_table.patch 2010-12-16 11:35:26 +0000
660+++ innodb_pass_corrupt_table.patch 2011-02-02 15:07:48 +0000
661@@ -608,7 +608,7 @@
662 ut_a(ret);
663
664 if (mode == OS_AIO_SYNC) {
665-@@ -5053,7 +5074,7 @@
666+@@ -5045,7 +5066,7 @@
667
668 if (fil_node->space->purpose == FIL_TABLESPACE) {
669 srv_set_io_thread_op_info(segment, "complete io for buf page");
670@@ -617,7 +617,7 @@
671 } else {
672 srv_set_io_thread_op_info(segment, "complete io for log");
673 log_io_complete(message);
674-@@ -5407,3 +5428,46 @@
675+@@ -5399,3 +5420,46 @@
676 return 0;
677 }
678 }
679@@ -1184,7 +1184,7 @@
680 diff -ruN a/storage/innodb_plugin/include/fil0fil.h b/storage/innodb_plugin/include/fil0fil.h
681 --- a/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:36:03.499987483 +0900
682 +++ b/storage/innodb_plugin/include/fil0fil.h 2010-08-27 16:39:03.015021314 +0900
683-@@ -756,6 +756,19 @@
684+@@ -748,6 +748,19 @@
685 fil_system_hash_nodes(void);
686 /*========================*/
687
688
689=== modified file 'innodb_purge_thread.patch'
690--- innodb_purge_thread.patch 2010-12-16 11:35:26 +0000
691+++ innodb_purge_thread.patch 2011-02-02 15:07:48 +0000
692@@ -154,7 +154,7 @@
693 /* if TRUE, then we auto-extend the last data file */
694 UNIV_INTERN ibool srv_auto_extend_last_data_file = FALSE;
695 /* if != 0, this tells the max size auto-extending may increase the
696-@@ -2625,10 +2627,10 @@
697+@@ -2626,10 +2628,10 @@
698 srv_main_thread_process_no = os_proc_get_number();
699 srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
700
701@@ -166,7 +166,7 @@
702 srv_n_threads_active[SRV_MASTER]++;
703
704 mutex_exit(&kernel_mutex);
705-@@ -3083,6 +3085,7 @@
706+@@ -3087,6 +3089,7 @@
707 /* Flush logs if needed */
708 srv_sync_log_buffer_in_background();
709
710@@ -174,7 +174,7 @@
711 /* We run a full purge every 10 seconds, even if the server
712 were active */
713 do {
714-@@ -3099,6 +3102,7 @@
715+@@ -3103,6 +3106,7 @@
716 srv_sync_log_buffer_in_background();
717
718 } while (n_pages_purged);
719@@ -182,7 +182,7 @@
720
721 srv_main_thread_op_info = "flushing buffer pool pages";
722
723-@@ -3167,6 +3171,7 @@
724+@@ -3171,6 +3175,7 @@
725 os_thread_sleep(100000);
726 }
727
728@@ -190,7 +190,7 @@
729 srv_main_thread_op_info = "purging";
730
731 /* Run a full purge */
732-@@ -3183,6 +3188,7 @@
733+@@ -3187,6 +3192,7 @@
734 srv_sync_log_buffer_in_background();
735
736 } while (n_pages_purged);
737@@ -198,7 +198,7 @@
738
739 srv_main_thread_op_info = "reserving kernel mutex";
740
741-@@ -3335,3 +3341,143 @@
742+@@ -3339,3 +3345,143 @@
743
744 OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */
745 }
746
747=== modified file 'innodb_separate_doublewrite.patch'
748--- innodb_separate_doublewrite.patch 2010-12-16 11:35:26 +0000
749+++ innodb_separate_doublewrite.patch 2011-02-02 15:07:48 +0000
750@@ -67,7 +67,15 @@
751 diff -ruN a/storage/innodb_plugin/dict/dict0load.c b/storage/innodb_plugin/dict/dict0load.c
752 --- a/storage/innodb_plugin/dict/dict0load.c 2010-08-27 16:22:04.223059346 +0900
753 +++ b/storage/innodb_plugin/dict/dict0load.c 2010-08-27 16:37:55.363104692 +0900
754-@@ -396,7 +396,7 @@
755+@@ -40,6 +40,7 @@
756+ #include "rem0cmp.h"
757+ #include "srv0start.h"
758+ #include "srv0srv.h"
759++#include "trx0sys.h"
760+
761+ /****************************************************************//**
762+ Compare the name of an index column.
763+@@ -396,7 +397,7 @@
764
765 mtr_commit(&mtr);
766
767@@ -76,7 +84,7 @@
768 /* The system tablespace always exists. */
769 } else if (in_crash_recovery) {
770 /* Check that the tablespace (the .ibd file) really
771-@@ -904,7 +904,7 @@
772+@@ -904,7 +905,7 @@
773 space = mach_read_from_4(field);
774
775 /* Check if the tablespace exists and has the right name */
776@@ -85,7 +93,7 @@
777 flags = dict_sys_tables_get_flags(rec);
778
779 if (UNIV_UNLIKELY(flags == ULINT_UNDEFINED)) {
780-@@ -957,7 +957,7 @@
781+@@ -957,7 +958,7 @@
782 }
783
784 /* See if the tablespace is available. */
785@@ -295,7 +303,7 @@
786 /* The node must be put back to the LRU list */
787 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
788 }
789-@@ -5271,7 +5281,7 @@
790+@@ -5263,7 +5273,7 @@
791 ut_a(fil_node->n_pending == 0);
792 ut_a(fil_node->open);
793 ut_a(fil_node->space->purpose == FIL_TABLESPACE);
794
795=== modified file 'innodb_show_lock_name.patch'
796--- innodb_show_lock_name.patch 2010-12-16 11:35:26 +0000
797+++ innodb_show_lock_name.patch 2011-02-02 15:07:48 +0000
798@@ -67,25 +67,38 @@
799 diff -ruN a/storage/innodb_plugin/include/sync0rw.h b/storage/innodb_plugin/include/sync0rw.h
800 --- a/storage/innodb_plugin/include/sync0rw.h 2010-08-04 02:24:19.000000000 +0900
801 +++ b/storage/innodb_plugin/include/sync0rw.h 2010-08-27 16:29:24.325059383 +0900
802-@@ -120,7 +120,7 @@
803+@@ -113,14 +113,14 @@
804+ #ifdef UNIV_DEBUG
805+ # ifdef UNIV_SYNC_DEBUG
806+ # define rw_lock_create(L, level) \
807+- rw_lock_create_func((L), (level), #L, __FILE__, __LINE__)
808++ rw_lock_create_func((L), (level), __FILE__, __LINE__, #L)
809+ # else /* UNIV_SYNC_DEBUG */
810+ # define rw_lock_create(L, level) \
811+- rw_lock_create_func((L), #L, __FILE__, __LINE__)
812++ rw_lock_create_func((L), __FILE__, __LINE__, #L)
813 # endif /* UNIV_SYNC_DEBUG */
814 #else /* UNIV_DEBUG */
815 # define rw_lock_create(L, level) \
816 - rw_lock_create_func((L), __FILE__, __LINE__)
817-+ rw_lock_create_func((L), #L, NULL, 0)
818++ rw_lock_create_func((L), #L)
819 #endif /* UNIV_DEBUG */
820
821 /******************************************************************//**
822-@@ -137,8 +137,8 @@
823+@@ -137,10 +137,10 @@
824 # ifdef UNIV_SYNC_DEBUG
825 ulint level, /*!< in: level */
826 # endif /* UNIV_SYNC_DEBUG */
827 - const char* cmutex_name, /*!< in: mutex name */
828- #endif /* UNIV_DEBUG */
829-+ const char* cmutex_name, /*!< in: mutex name */
830+-#endif /* UNIV_DEBUG */
831 const char* cfile_name, /*!< in: file name where created */
832- ulint cline); /*!< in: file line where created */
833+- ulint cline); /*!< in: file line where created */
834++ ulint cline, /*!< in: file line where created */
835++#endif /* UNIV_DEBUG */
836++ const char* cmutex_name); /*!< in: mutex name */
837 /******************************************************************//**
838+ Calling this function is obligatory only if the memory buffer containing
839+ the rw-lock is freed. Removes an rw-lock object from the global list. The
840 @@ -541,7 +541,8 @@
841 ulint level; /*!< Level in the global latching order. */
842 #endif /* UNIV_SYNC_DEBUG */
843@@ -108,25 +121,41 @@
844 diff -ruN a/storage/innodb_plugin/include/sync0sync.h b/storage/innodb_plugin/include/sync0sync.h
845 --- a/storage/innodb_plugin/include/sync0sync.h 2010-08-27 16:13:11.087074844 +0900
846 +++ b/storage/innodb_plugin/include/sync0sync.h 2010-08-27 16:29:24.327059254 +0900
847-@@ -80,7 +80,7 @@
848+@@ -73,14 +73,14 @@
849+ #ifdef UNIV_DEBUG
850+ # ifdef UNIV_SYNC_DEBUG
851+ # define mutex_create(M, level) \
852+- mutex_create_func((M), #M, (level), __FILE__, __LINE__)
853++ mutex_create_func((M), (level), __FILE__, __LINE__, #M)
854+ # else
855+ # define mutex_create(M, level) \
856+- mutex_create_func((M), #M, __FILE__, __LINE__)
857++ mutex_create_func((M), __FILE__, __LINE__, #M)
858 # endif
859 #else
860 # define mutex_create(M, level) \
861 - mutex_create_func((M), __FILE__, __LINE__)
862-+ mutex_create_func((M), #M, NULL, 0)
863++ mutex_create_func((M), #M)
864 #endif
865
866 /******************************************************************//**
867-@@ -93,8 +93,8 @@
868- mutex_create_func(
869+@@ -94,13 +94,13 @@
870 /*==============*/
871 mutex_t* mutex, /*!< in: pointer to memory */
872--#ifdef UNIV_DEBUG
873- const char* cmutex_name, /*!< in: mutex name */
874-+#ifdef UNIV_DEBUG
875+ #ifdef UNIV_DEBUG
876+- const char* cmutex_name, /*!< in: mutex name */
877 # ifdef UNIV_SYNC_DEBUG
878 ulint level, /*!< in: level */
879 # endif /* UNIV_SYNC_DEBUG */
880+-#endif /* UNIV_DEBUG */
881+ const char* cfile_name, /*!< in: file name where created */
882+- ulint cline); /*!< in: file line where created */
883++ ulint cline, /*!< in: file line where created */
884++#endif /* UNIV_DEBUG */
885++ const char* cmutex_name); /*!< in: mutex name */
886+
887+ #undef mutex_free /* Fix for MacOS X */
888+
889 @@ -536,9 +536,9 @@
890 ulint line; /*!< Line where the mutex was locked */
891 ulint level; /*!< Level in the global latching order */
892@@ -182,16 +211,20 @@
893 diff -ruN a/storage/innodb_plugin/sync/sync0rw.c b/storage/innodb_plugin/sync/sync0rw.c
894 --- a/storage/innodb_plugin/sync/sync0rw.c 2010-08-04 02:24:20.000000000 +0900
895 +++ b/storage/innodb_plugin/sync/sync0rw.c 2010-08-27 16:29:24.331058289 +0900
896-@@ -231,8 +231,8 @@
897+@@ -231,10 +231,10 @@
898 # ifdef UNIV_SYNC_DEBUG
899 ulint level, /*!< in: level */
900 # endif /* UNIV_SYNC_DEBUG */
901 - const char* cmutex_name, /*!< in: mutex name */
902- #endif /* UNIV_DEBUG */
903-+ const char* cmutex_name, /*!< in: mutex name */
904+-#endif /* UNIV_DEBUG */
905 const char* cfile_name, /*!< in: file name where created */
906- ulint cline) /*!< in: file line where created */
907+- ulint cline) /*!< in: file line where created */
908++ ulint cline, /*!< in: file line where created */
909++#endif /* UNIV_DEBUG */
910++ const char* cmutex_name) /*!< in: mutex name */
911 {
912+ /* If this is the very first time a synchronization object is
913+ created, then the following call initializes the sync system. */
914 @@ -242,14 +242,15 @@
915 #ifndef INNODB_RW_LOCKS_USE_ATOMICS
916 mutex_create(rw_lock_get_mutex(lock), SYNC_NO_ORDER_CHECK);
917@@ -275,16 +308,23 @@
918 diff -ruN a/storage/innodb_plugin/sync/sync0sync.c b/storage/innodb_plugin/sync/sync0sync.c
919 --- a/storage/innodb_plugin/sync/sync0sync.c 2010-08-27 16:13:11.113988290 +0900
920 +++ b/storage/innodb_plugin/sync/sync0sync.c 2010-08-27 16:29:24.333058256 +0900
921-@@ -238,8 +238,8 @@
922- mutex_create_func(
923+@@ -239,13 +239,13 @@
924 /*==============*/
925 mutex_t* mutex, /*!< in: pointer to memory */
926--#ifdef UNIV_DEBUG
927- const char* cmutex_name, /*!< in: mutex name */
928-+#ifdef UNIV_DEBUG
929+ #ifdef UNIV_DEBUG
930+- const char* cmutex_name, /*!< in: mutex name */
931 # ifdef UNIV_SYNC_DEBUG
932 ulint level, /*!< in: level */
933 # endif /* UNIV_SYNC_DEBUG */
934+-#endif /* UNIV_DEBUG */
935+ const char* cfile_name, /*!< in: file name where created */
936+- ulint cline) /*!< in: file line where created */
937++ ulint cline, /*!< in: file line where created */
938++#endif /* UNIV_DEBUG */
939++ const char* cmutex_name) /*!< in: mutex name */
940+ {
941+ #if defined(HAVE_ATOMIC_BUILTINS)
942+ mutex_reset_lock_word(mutex);
943 @@ -263,11 +263,13 @@
944 mutex->file_name = "not yet reserved";
945 mutex->level = level;
946
947=== modified file 'innodb_split_buf_pool_mutex.patch'
948--- innodb_split_buf_pool_mutex.patch 2010-12-16 11:35:26 +0000
949+++ innodb_split_buf_pool_mutex.patch 2011-02-02 15:07:48 +0000
950@@ -48,25 +48,7 @@
951 diff -ruN a/storage/innodb_plugin/btr/btr0sea.c b/storage/innodb_plugin/btr/btr0sea.c
952 --- a/storage/innodb_plugin/btr/btr0sea.c 2010-08-27 16:11:12.151975789 +0900
953 +++ b/storage/innodb_plugin/btr/btr0sea.c 2010-08-27 16:11:40.593021205 +0900
954-@@ -1199,7 +1199,7 @@
955- ulint* offsets;
956-
957- rw_lock_x_lock(&btr_search_latch);
958-- buf_pool_mutex_enter();
959-+ mutex_enter(&LRU_list_mutex);
960-
961- table = btr_search_sys->hash_index;
962-
963-@@ -1285,7 +1285,7 @@
964- bpage = UT_LIST_GET_PREV(LRU, bpage);
965- }
966-
967-- buf_pool_mutex_exit();
968-+ mutex_exit(&LRU_list_mutex);
969- rw_lock_x_unlock(&btr_search_latch);
970-
971- if (UNIV_LIKELY_NULL(heap)) {
972-@@ -1878,7 +1878,8 @@
973+@@ -1925,7 +1925,8 @@
974 rec_offs_init(offsets_);
975
976 rw_lock_x_lock(&btr_search_latch);
977@@ -76,7 +58,7 @@
978
979 cell_count = hash_get_n_cells(btr_search_sys->hash_index);
980
981-@@ -1886,11 +1887,13 @@
982+@@ -1933,11 +1934,13 @@
983 /* We release btr_search_latch every once in a while to
984 give other queries a chance to run. */
985 if ((i != 0) && ((i % chunk_size) == 0)) {
986@@ -92,7 +74,7 @@
987 }
988
989 node = hash_get_nth_cell(btr_search_sys->hash_index, i)->node;
990-@@ -1997,11 +2000,13 @@
991+@@ -2044,11 +2047,13 @@
992 /* We release btr_search_latch every once in a while to
993 give other queries a chance to run. */
994 if (i != 0) {
995@@ -108,7 +90,7 @@
996 }
997
998 if (!ha_validate(btr_search_sys->hash_index, i, end_index)) {
999-@@ -2009,7 +2014,8 @@
1000+@@ -2056,7 +2061,8 @@
1001 }
1002 }
1003
1004@@ -388,20 +370,33 @@
1005 ut_ad(!mutex_own(&buf_pool_zip_mutex));
1006 ut_ad(!ut_align_offset(src, size));
1007 ut_ad(!ut_align_offset(dst, size));
1008-@@ -434,6 +476,12 @@
1009+@@ -433,6 +475,13 @@
1010+ if (size >= PAGE_ZIP_MIN_SIZE) {
1011 /* This is a compressed page. */
1012 mutex_t* mutex;
1013-
1014++ ulint space, page_no;
1015++
1016 + if (!have_page_hash_mutex) {
1017 + mutex_exit(&zip_free_mutex);
1018 + mutex_enter(&LRU_list_mutex);
1019 + rw_lock_x_lock(&page_hash_latch);
1020 + }
1021-+
1022+
1023 /* The src block may be split into smaller blocks,
1024 some of which may be free. Thus, the
1025- mach_read_from_4() calls below may attempt to read
1026-@@ -458,6 +506,11 @@
1027+@@ -442,9 +491,9 @@
1028+ pool), so there is nothing wrong about this. The
1029+ mach_read_from_4() calls here will only trigger bogus
1030+ Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */
1031+- ulint space = mach_read_from_4(
1032++ space = mach_read_from_4(
1033+ (const byte*) src + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
1034+- ulint page_no = mach_read_from_4(
1035++ page_no = mach_read_from_4(
1036+ (const byte*) src + FIL_PAGE_OFFSET);
1037+ /* Suppress Valgrind warnings about conditional jump
1038+ on uninitialized value. */
1039+@@ -458,6 +507,11 @@
1040 added to buf_pool->page_hash yet. Obviously,
1041 it cannot be relocated. */
1042
1043@@ -413,7 +408,7 @@
1044 return(FALSE);
1045 }
1046
1047-@@ -467,18 +520,27 @@
1048+@@ -467,18 +521,27 @@
1049 For the sake of simplicity, give up. */
1050 ut_ad(page_zip_get_size(&bpage->zip) < size);
1051
1052@@ -444,7 +439,7 @@
1053 /* Relocate the compressed page. */
1054 ut_a(bpage->zip.data == src);
1055 memcpy(dst, src, size);
1056-@@ -493,10 +555,22 @@
1057+@@ -493,10 +556,22 @@
1058 buddy_stat->relocated_usec
1059 += ut_time_us(NULL) - usec;
1060 }
1061@@ -468,7 +463,7 @@
1062 } else if (i == buf_buddy_get_slot(sizeof(buf_page_t))) {
1063 /* This must be a buf_page_t object. */
1064 #if UNIV_WORD_SIZE == 4
1065-@@ -505,10 +579,31 @@
1066+@@ -505,10 +580,31 @@
1067 about uninitialized pad bytes. */
1068 UNIV_MEM_ASSERT_RW(src, size);
1069 #endif
1070@@ -500,7 +495,7 @@
1071 }
1072
1073 return(FALSE);
1074-@@ -522,13 +617,15 @@
1075+@@ -522,13 +618,15 @@
1076 /*===============*/
1077 void* buf, /*!< in: block to be freed, must not be
1078 pointed to by the buffer pool */
1079@@ -518,7 +513,7 @@
1080 ut_ad(!mutex_own(&buf_pool_zip_mutex));
1081 ut_ad(i <= BUF_BUDDY_SIZES);
1082 ut_ad(buf_buddy_stat[i].used > 0);
1083-@@ -539,7 +636,9 @@
1084+@@ -539,7 +637,9 @@
1085 ut_d(((buf_page_t*) buf)->state = BUF_BLOCK_ZIP_FREE);
1086
1087 if (i == BUF_BUDDY_SIZES) {
1088@@ -529,7 +524,7 @@
1089 return;
1090 }
1091
1092-@@ -584,7 +683,7 @@
1093+@@ -584,7 +684,7 @@
1094 ut_a(bpage != buf);
1095
1096 {
1097@@ -538,7 +533,7 @@
1098 UNIV_MEM_ASSERT_AND_FREE(bpage, BUF_BUDDY_LOW << i);
1099 bpage = next;
1100 }
1101-@@ -593,13 +692,13 @@
1102+@@ -593,13 +693,13 @@
1103 #ifndef UNIV_DEBUG_VALGRIND
1104 buddy_nonfree:
1105 /* Valgrind would complain about accessing free memory. */
1106@@ -554,7 +549,7 @@
1107
1108 if (bpage) {
1109 /* Remove the block from the free list, because a successful
1110-@@ -609,7 +708,7 @@
1111+@@ -609,7 +709,7 @@
1112 buf_buddy_remove_from_free(bpage, i);
1113
1114 /* Try to relocate the buddy of buf to the free block. */
1115@@ -563,7 +558,7 @@
1116
1117 ut_d(buddy->state = BUF_BLOCK_ZIP_FREE);
1118 goto buddy_free2;
1119-@@ -629,14 +728,14 @@
1120+@@ -629,14 +729,14 @@
1121
1122 (Parts of the buddy can be free in
1123 buf_pool->zip_free[j] with j < i.) */
1124@@ -1283,6 +1278,15 @@
1125 #if UNIV_WORD_SIZE == 4
1126 /* On 32-bit systems, there is no padding in buf_page_t. On
1127 other systems, Valgrind could complain about uninitialized pad
1128+@@ -2283,7 +2395,7 @@
1129+ /* Try to evict the block from the buffer pool, to use the
1130+ insert buffer as much as possible. */
1131+
1132+- if (buf_LRU_free_block(&block->page, TRUE, NULL)
1133++ if (buf_LRU_free_block(&block->page, TRUE, NULL, FALSE)
1134+ == BUF_LRU_FREED) {
1135+ buf_pool_mutex_exit();
1136+ mutex_exit(&block->mutex);
1137 @@ -2305,13 +2417,14 @@
1138
1139 buf_block_buf_fix_inc(block, file, line);
1140@@ -3803,7 +3807,15 @@
1141
1142 return(bpage != NULL);
1143 }
1144-@@ -1038,11 +1076,14 @@
1145+@@ -1031,18 +1069,21 @@
1146+ buf_block_t* block, /*!< in: buffer block */
1147+ ulint rw_latch, /*!< in: RW_S_LATCH, RW_X_LATCH,
1148+ RW_NO_LATCH */
1149+- mtr_t* mtr) /*!< in: mtr */
1150++ mtr_t* mtr __attribute__((unused))) /*!< in: mtr */
1151+ {
1152+ ut_ad(block);
1153+
1154 ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
1155 ut_a(block->page.buf_fix_count > 0);
1156
1157@@ -3975,7 +3987,15 @@
1158 diff -ruN a/storage/innodb_plugin/mtr/mtr0mtr.c b/storage/innodb_plugin/mtr/mtr0mtr.c
1159 --- a/storage/innodb_plugin/mtr/mtr0mtr.c 2010-08-04 02:24:20.000000000 +0900
1160 +++ b/storage/innodb_plugin/mtr/mtr0mtr.c 2010-08-27 16:11:40.631020912 +0900
1161-@@ -105,6 +105,38 @@
1162+@@ -33,6 +33,7 @@
1163+ #include "page0types.h"
1164+ #include "mtr0log.h"
1165+ #include "log0log.h"
1166++#include "buf0flu.h"
1167+
1168+ #ifndef UNIV_HOTBACKUP
1169+ # include "log0recv.h"
1170+@@ -105,6 +106,38 @@
1171 }
1172 }
1173
1174@@ -4014,7 +4034,7 @@
1175 /************************************************************//**
1176 Writes the contents of a mini-transaction log, if any, to the database log. */
1177 static
1178-@@ -188,6 +220,8 @@
1179+@@ -188,6 +221,8 @@
1180
1181 if (write_log) {
1182 mtr_log_reserve_and_write(mtr);
1183@@ -4023,7 +4043,7 @@
1184 }
1185
1186 /* We first update the modification info to buffer pages, and only
1187-@@ -198,11 +232,13 @@
1188+@@ -198,11 +233,13 @@
1189 required when we insert modified buffer pages in to the flush list
1190 which must be sorted on oldest_modification. */
1191
1192@@ -4039,7 +4059,7 @@
1193 #endif /* !UNIV_HOTBACKUP */
1194
1195 ut_d(mtr->state = MTR_COMMITTED);
1196-@@ -273,6 +309,12 @@
1197+@@ -273,6 +310,12 @@
1198 slot = dyn_array_get_element(memo, offset);
1199
1200 if ((object == slot->object) && (type == slot->type)) {
1201@@ -4055,7 +4075,7 @@
1202 diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
1203 --- a/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:11:12.194989878 +0900
1204 +++ b/storage/innodb_plugin/srv/srv0srv.c 2010-08-27 16:11:40.634022489 +0900
1205-@@ -2852,7 +2852,7 @@
1206+@@ -2855,7 +2855,7 @@
1207
1208 mutex_exit(&(log_sys->mutex));
1209
1210@@ -4064,7 +4084,7 @@
1211
1212 level = 0;
1213 bpage = UT_LIST_GET_FIRST(buf_pool->flush_list);
1214-@@ -2874,7 +2874,7 @@
1215+@@ -2877,7 +2877,7 @@
1216 bpl = 0;
1217 }
1218
1219
1220=== modified file 'innodb_stats.patch'
1221--- innodb_stats.patch 2010-12-16 11:35:26 +0000
1222+++ innodb_stats.patch 2011-02-02 15:07:48 +0000
1223@@ -1134,7 +1134,7 @@
1224 table->status = 0;
1225 +#ifdef EXTENDED_FOR_USERSTAT
1226 + rows_read++;
1227-+ if (active_index >= 0 && active_index < MAX_KEY)
1228++ if (active_index < MAX_KEY)
1229 + index_rows_read[active_index]++;
1230 +#endif
1231 break;
1232
1233=== modified file 'profiling_slow.patch'
1234--- profiling_slow.patch 2011-01-10 13:38:39 +0000
1235+++ profiling_slow.patch 2011-02-02 15:07:48 +0000
1236@@ -273,7 +273,7 @@
1237 + my_b_printf(log_file, "# ");
1238 +
1239 + void *entry_iterator;
1240-+ PROF_MEASUREMENT *entry, *previous= NULL, *first= NULL;
1241++ PROF_MEASUREMENT *entry= NULL, *previous= NULL, *first= NULL;
1242 + /* ...and for each query, go through all its state-change steps. */
1243 + for (entry_iterator= query->entries.new_iterator();
1244 + entry_iterator != NULL;
1245
1246=== modified file 'userstat.patch'
1247--- userstat.patch 2011-01-10 13:38:39 +0000
1248+++ userstat.patch 2011-02-02 15:07:48 +0000
1249@@ -1923,7 +1923,7 @@
1250 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
1251 return 1;
1252 #else
1253-@@ -6072,6 +6105,30 @@
1254+@@ -6072,6 +6105,32 @@
1255 lex_start(thd);
1256 mysql_reset_thd_for_next_command(thd);
1257
1258@@ -1934,7 +1934,9 @@
1259 + double end_usecs = 0;
1260 + /* cpu time */
1261 + int cputime_error = 0;
1262++#ifdef HAVE_CLOCK_GETTIME
1263 + struct timespec tp;
1264++#endif
1265 + double start_cpu_nsecs = 0;
1266 + double end_cpu_nsecs = 0;
1267 +
1268@@ -1954,7 +1956,7 @@
1269 if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0)
1270 {
1271 LEX *lex= thd->lex;
1272-@@ -6152,6 +6209,43 @@
1273+@@ -6152,6 +6211,43 @@
1274 *found_semicolon= NULL;
1275 }
1276
1277@@ -1998,7 +2000,7 @@
1278 DBUG_VOID_RETURN;
1279 }
1280
1281-@@ -7017,6 +7111,13 @@
1282+@@ -7017,6 +7113,13 @@
1283 if (flush_error_log())
1284 result=1;
1285 }
1286@@ -2012,7 +2014,7 @@
1287 #ifdef HAVE_QUERY_CACHE
1288 if (options & REFRESH_QUERY_CACHE_FREE)
1289 {
1290-@@ -7117,6 +7218,40 @@
1291+@@ -7117,6 +7220,40 @@
1292 #endif
1293 if (options & REFRESH_USER_RESOURCES)
1294 reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */
1295@@ -2066,7 +2068,7 @@
1296 /**
1297 A result class used to send cursor rows using the binary protocol.
1298 */
1299-@@ -2103,8 +2106,32 @@
1300+@@ -2103,8 +2106,34 @@
1301 /* First of all clear possible warnings from the previous command */
1302 mysql_reset_thd_for_next_command(thd);
1303
1304@@ -2077,7 +2079,9 @@
1305 + double end_usecs = 0;
1306 + /* cpu time */
1307 + int cputime_error = 0;
1308++#ifdef HAVE_CLOCK_GETTIME
1309 + struct timespec tp;
1310++#endif
1311 + double start_cpu_nsecs = 0;
1312 + double end_cpu_nsecs = 0;
1313 +
1314@@ -2100,7 +2104,7 @@
1315
1316 if (thd->stmt_map.insert(thd, stmt))
1317 {
1318-@@ -2112,7 +2139,7 @@
1319+@@ -2112,7 +2141,7 @@
1320 The error is set in the insert. The statement itself
1321 will be also deleted there (this is how the hash works).
1322 */
1323@@ -2109,7 +2113,7 @@
1324 }
1325
1326 /* Reset warnings from previous command */
1327-@@ -2139,6 +2166,44 @@
1328+@@ -2139,6 +2168,44 @@
1329 thd->protocol= save_protocol;
1330
1331 /* check_prepared_statemnt sends the metadata packet in case of success */
1332@@ -2154,7 +2158,7 @@
1333 DBUG_VOID_RETURN;
1334 }
1335
1336-@@ -2489,12 +2554,36 @@
1337+@@ -2489,12 +2556,38 @@
1338 /* First of all clear possible warnings from the previous command */
1339 mysql_reset_thd_for_next_command(thd);
1340
1341@@ -2165,7 +2169,9 @@
1342 + double end_usecs = 0;
1343 + /* cpu time */
1344 + int cputime_error = 0;
1345++#ifdef HAVE_CLOCK_GETTIME
1346 + struct timespec tp;
1347++#endif
1348 + double start_cpu_nsecs = 0;
1349 + double end_cpu_nsecs = 0;
1350 +
1351@@ -2192,7 +2198,7 @@
1352 }
1353
1354 #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
1355-@@ -2515,6 +2604,44 @@
1356+@@ -2515,6 +2608,44 @@
1357 /* Close connection socket; for use with client testing (Bug#43560). */
1358 DBUG_EXECUTE_IF("close_conn_after_stmt_execute", vio_close(thd->net.vio););
1359
1360@@ -2237,7 +2243,7 @@
1361 DBUG_VOID_RETURN;
1362
1363 }
1364-@@ -2588,20 +2715,45 @@
1365+@@ -2588,20 +2719,47 @@
1366
1367 /* First of all clear possible warnings from the previous command */
1368 mysql_reset_thd_for_next_command(thd);
1369@@ -2249,7 +2255,9 @@
1370 + double end_usecs = 0;
1371 + /* cpu time */
1372 + int cputime_error = 0;
1373++#ifdef HAVE_CLOCK_GETTIME
1374 + struct timespec tp;
1375++#endif
1376 + double start_cpu_nsecs = 0;
1377 + double end_cpu_nsecs = 0;
1378 +
1379@@ -2285,7 +2293,7 @@
1380 }
1381
1382 thd->stmt_arena= stmt;
1383-@@ -2625,6 +2777,44 @@
1384+@@ -2625,6 +2783,44 @@
1385 thd->restore_backup_statement(stmt, &stmt_backup);
1386 thd->stmt_arena= thd;
1387
1388@@ -2330,7 +2338,7 @@
1389 DBUG_VOID_RETURN;
1390 }
1391
1392-@@ -2655,13 +2845,37 @@
1393+@@ -2655,13 +2851,39 @@
1394 /* First of all clear possible warnings from the previous command */
1395 mysql_reset_thd_for_next_command(thd);
1396
1397@@ -2341,7 +2349,9 @@
1398 + double end_usecs = 0;
1399 + /* cpu time */
1400 + int cputime_error = 0;
1401++#ifdef HAVE_CLOCK_GETTIME
1402 + struct timespec tp;
1403++#endif
1404 + double start_cpu_nsecs = 0;
1405 + double end_cpu_nsecs = 0;
1406 +
1407@@ -2369,7 +2379,7 @@
1408 }
1409
1410 stmt->close_cursor();
1411-@@ -2678,6 +2892,44 @@
1412+@@ -2678,6 +2900,44 @@
1413
1414 my_ok(thd);
1415

Subscribers

People subscribed via source and target branches

to all changes: