[packages/percona-server/v5.1.x: 13/21] - up to 5.1.58

glen glen at pld-linux.org
Wed Oct 21 16:09:14 CEST 2015


commit 4eec382962c153f57202e0e40ad85237539c42bb
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Sep 16 19:49:26 2011 +0000

    - up to 5.1.58
    
    Changed files:
        bug53761.patch -> 1.1.2.1
        bug813587.patch -> 1.1.2.1
        disable_query_cache_28249_test_sporadic_failure.patch -> 1.1.2.1
        innodb_bug47167_test_fix.patch -> 1.1.2.1
        mysql-bug580324.patch -> 1.1.2.2.4.1
        mysql-bug677407.patch -> 1.1.2.2.4.1
        mysql-bugfix48929.patch -> 1.1.2.2.4.1
        mysql-control_online_alter_index.patch -> 1.1.2.2.4.1
        mysql-error_pad.patch -> 1.1.2.2.4.1
        mysql-fix-bug671764.patch -> 1.1.2.2.4.1
        mysql-i_s_innodb_buffer_pool_pages.patch -> 1.1.2.3.4.1
        mysql-innodb_adjust_defaults.patch -> 1.1.2.3.4.1
        mysql-innodb_admin_command_base.patch -> 1.1.2.3.4.1
        mysql-innodb_buffer_pool_shm.patch -> 1.1.2.3.4.1
        mysql-innodb_bug60788.patch -> 1.1.2.1.4.1
        mysql-innodb_deadlock_count.patch -> 1.1.2.4.4.1
        mysql-innodb_dict_size_limit.patch -> 1.2.2.3.4.1
        mysql-innodb_expand_fast_index_creation.patch -> 1.1.2.1.4.1
        mysql-innodb_expand_import.patch -> 1.1.2.4.4.1
        mysql-innodb_expand_undo_slots.patch -> 1.1.2.3.4.1
        mysql-innodb_extend_slow.patch -> 1.2.2.3.4.1
        mysql-innodb_extra_rseg.patch -> 1.2.2.3.4.1
        mysql-innodb_fast_checksum.patch -> 1.1.2.4.4.1
        mysql-innodb_fast_shutdown.patch -> 1.1.2.2.4.1
        mysql-innodb_files_extend.patch -> 1.1.2.4.4.1
        mysql-innodb_fix_misc.patch -> 1.1.2.5.4.1
        mysql-innodb_io_patches.patch -> 1.1.4.3.4.1
        mysql-innodb_lru_dump_restore.patch -> 1.1.2.4.4.1
        mysql-innodb_opt_lru_count.patch -> 1.1.2.2.4.1
        mysql-innodb_overwrite_relay_log_info.patch -> 1.1.2.3.4.1
        mysql-innodb_pass_corrupt_table.patch -> 1.1.2.4.4.1
        mysql-innodb_purge_thread.patch -> 1.1.2.3.4.1
        mysql-innodb_recovery_patches.patch -> 1.1.4.3.4.1
        mysql-innodb_separate_doublewrite.patch -> 1.1.2.4.4.1
        mysql-innodb_show_enhancements.patch -> 1.1.2.3.4.1
        mysql-innodb_show_lock_name.patch -> 1.1.2.3.4.1
        mysql-innodb_show_status.patch -> 1.1.2.3.4.1
        mysql-innodb_show_sys_tables.patch -> 1.1.2.3.4.1
        mysql-innodb_split_buf_pool_mutex.patch -> 1.3.2.2.4.1
        mysql-innodb_stats.patch -> 1.1.2.3.4.1
        mysql-innodb_swap_builtin_plugin.patch -> 1.1.2.4.4.1
        mysql-innodb_thread_concurrency_timer_based.patch -> 1.2.2.3.4.1
        mysql-log_connection_error.patch -> 1.1.2.2.4.1
        mysql-microsec_process.patch -> 1.3.2.2.4.1
        mysql-mysql-syslog.patch -> 1.1.2.2.4.1
        mysql-mysql_remove_eol_carret.patch -> 1.1.2.2.4.1
        mysql-optimizer_fix.patch -> 1.1.2.3.4.1
        mysql-profiling_slow.patch -> 1.2.2.3.4.1
        mysql-query_cache_enhance.patch -> 1.1.2.3.4.1
        mysql-remove_fcntl_excessive_calls.patch -> 1.1.2.1.4.1
        mysql-show_patches.patch -> 1.1.4.3.4.1
        mysql-show_slave_status_nolock.patch -> 1.1.2.2.4.1
        mysql-show_temp_51.patch -> 1.1.2.3.4.1
        mysql-slow_extended.patch -> 1.1.2.3.4.1
        mysql-sql_no_fcache.patch -> 1.1.2.2.4.1
        mysql-suppress_log_warning_1592.patch -> 1.1.2.3.4.1
        mysql-userstat.patch -> 1.2.2.3.4.1
        mysql.spec -> 1.496.2.12.4.1
        response_time_distribution.patch -> 1.7.2.1
        slave_timeout_fix.patch -> 1.2.2.1
        utf8_general50_ci.patch -> 1.1.2.1
        xtradb_bug317074.patch -> 1.1.2.1

 bug53761.patch                                     |  409 +++
 bug813587.patch                                    |    5 +-
 ...e_query_cache_28249_test_sporadic_failure.patch |    8 +
 innodb_bug47167_test_fix.patch                     |   52 +
 mysql-bug580324.patch                              |   21 +-
 mysql-bug677407.patch                              |    5 +-
 mysql-bugfix48929.patch                            |   34 +-
 mysql-control_online_alter_index.patch             |   38 +-
 mysql-error_pad.patch                              |    5 +-
 mysql-fix-bug671764.patch                          |    9 +-
 mysql-i_s_innodb_buffer_pool_pages.patch           |   32 +-
 mysql-innodb_adjust_defaults.patch                 |   13 +-
 mysql-innodb_admin_command_base.patch              |   37 +-
 mysql-innodb_buffer_pool_shm.patch                 | 1125 +-------
 mysql-innodb_bug60788.patch                        |   21 +-
 mysql-innodb_deadlock_count.patch                  |  120 +-
 mysql-innodb_dict_size_limit.patch                 |   64 +-
 mysql-innodb_expand_fast_index_creation.patch      |  246 +-
 mysql-innodb_expand_import.patch                   |  702 ++++-
 mysql-innodb_expand_undo_slots.patch               |   36 +-
 mysql-innodb_extend_slow.patch                     |  154 +-
 mysql-innodb_extra_rseg.patch                      |   63 +-
 mysql-innodb_fast_checksum.patch                   |  128 +-
 mysql-innodb_fast_shutdown.patch                   |   46 +-
 mysql-innodb_files_extend.patch                    |  123 +-
 mysql-innodb_fix_misc.patch                        |  940 ++++++-
 mysql-innodb_io_patches.patch                      |  416 ++-
 mysql-innodb_lru_dump_restore.patch                |  100 +-
 mysql-innodb_opt_lru_count.patch                   |   40 +-
 mysql-innodb_overwrite_relay_log_info.patch        |   50 +-
 mysql-innodb_pass_corrupt_table.patch              |  315 +--
 mysql-innodb_purge_thread.patch                    |   46 +-
 mysql-innodb_recovery_patches.patch                |   59 +-
 mysql-innodb_separate_doublewrite.patch            |  173 +-
 mysql-innodb_show_enhancements.patch               |   38 +-
 mysql-innodb_show_lock_name.patch                  |   43 +-
 mysql-innodb_show_status.patch                     |   61 +-
 mysql-innodb_show_sys_tables.patch                 |   54 +-
 mysql-innodb_split_buf_pool_mutex.patch            |  309 +--
 mysql-innodb_stats.patch                           |  170 +-
 mysql-innodb_swap_builtin_plugin.patch             |   74 +-
 mysql-innodb_thread_concurrency_timer_based.patch  |   24 +-
 mysql-log_connection_error.patch                   |  111 +-
 mysql-microsec_process.patch                       |   12 +-
 mysql-mysql-syslog.patch                           |   10 +-
 mysql-mysql_remove_eol_carret.patch                |   20 +-
 mysql-optimizer_fix.patch                          |   40 +-
 mysql-profiling_slow.patch                         |  103 +-
 mysql-query_cache_enhance.patch                    | 2767 +++++++++++++++++++-
 mysql-remove_fcntl_excessive_calls.patch           |   10 +-
 mysql-show_patches.patch                           |   88 +-
 mysql-show_slave_status_nolock.patch               |  115 +-
 mysql-show_temp_51.patch                           |  285 +-
 mysql-slow_extended.patch                          | 1361 +++++++++-
 mysql-sql_no_fcache.patch                          |   98 +-
 mysql-suppress_log_warning_1592.patch              |  117 +-
 mysql-userstat.patch                               |  421 ++-
 mysql.spec                                         |   22 +-
 response_time_distribution.patch                   | 2041 ++++++++++++---
 utf8_general50_ci.patch                            |   96 +-
 xtradb_bug317074.patch                             |    7 +-
 61 files changed, 10203 insertions(+), 3929 deletions(-)
---
diff --git a/mysql.spec b/mysql.spec
index 97ef1c5..9603a5c 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -31,13 +31,13 @@ Summary(ru.UTF-8):	MySQL - быстрый SQL-сервер
 Summary(uk.UTF-8):	MySQL - швидкий SQL-сервер
 Summary(zh_CN.UTF-8):	MySQL数据库服务器
 Name:		mysql
-Version:	5.1.57
+Version:	5.1.58
 Release:	1
 License:	GPL + MySQL FLOSS Exception
 Group:		Applications/Databases
 #Source0Download: http://dev.mysql.com/downloads/mysql/5.1.html#source
 Source0:	http://vesta.informatik.rwth-aachen.de/mysql/Downloads/MySQL-5.1/%{name}-%{version}.tar.gz
-# Source0-md5:	8d6998ef0f2e2d1dac2a761348c71c21
+# Source0-md5:	ae5aef506088e521e4b1cc4f668e96d2
 Source100:	http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz
 # Source100-md5:	7b9b618cb9b378f949bb1b91ddcc4f54
 Source1:	%{name}.init
@@ -116,8 +116,8 @@ Patch139:	%{name}-control_online_alter_index.patch
 Patch140:	%{name}-log_connection_error.patch
 Patch141:	%{name}-mysql-syslog.patch
 Patch142:	%{name}-innodb_buffer_pool_shm.patch
-Patch143:	%{name}-response-time-distribution.patch
-Patch144:	%{name}-error_pad.patch
+Patch143:	%{name}-error_pad.patch
+Patch144:	response_time_distribution.patch
 Patch145:	%{name}-remove_fcntl_excessive_calls.patch
 Patch146:	%{name}-sql_no_fcache.patch
 Patch147:	%{name}-show_slave_status_nolock.patch
@@ -127,6 +127,13 @@ Patch150:	%{name}-fix-bug671764.patch
 Patch151:	%{name}-mysql_remove_eol_carret.patch
 Patch152:	%{name}-innodb_expand_fast_index_creation.patch
 Patch153:	%{name}-innodb_bug60788.patch
+Patch154:	slave_timeout_fix.patch
+Patch155:	utf8_general50_ci.patch
+Patch156:	bug813587.patch
+Patch157:	innodb_bug47167_test_fix.patch
+Patch158:	disable_query_cache_28249_test_sporadic_failure.patch
+Patch159:	bug53761.patch
+Patch160:	xtradb_bug317074.patch
 # </percona>
 URL:		http://www.mysql.com/products/community/
 BuildRequires:	autoconf
@@ -629,6 +636,13 @@ mv sphinx-*/mysqlse storage/sphinx
 %patch151 -p1
 %patch152 -p1
 %patch153 -p1
+%patch154 -p1
+%patch155 -p1
+%patch156 -p1
+%patch157 -p1
+%patch158 -p1
+%patch159 -p1
+%patch160 -p1
 # </percona>
 
 %build
diff --git a/bug53761.patch b/bug53761.patch
new file mode 100644
index 0000000..945cf17
--- /dev/null
+++ b/bug53761.patch
@@ -0,0 +1,409 @@
+# name       : bug53761.patch
+# maintainer : Alexey
+#
+# Backport of the fix for MySQL bug #53761 to 5.1
+#
+--- a/storage/innodb_plugin/btr/btr0cur.c
++++ b/storage/innodb_plugin/btr/btr0cur.c
+@@ -3117,6 +3117,7 @@
+ {
+ 	btr_path_t*	slot;
+ 	rec_t*		rec;
++	page_t*		page;
+ 
+ 	ut_a(cursor->path_arr);
+ 
+@@ -3139,8 +3140,155 @@
+ 
+ 	slot = cursor->path_arr + (root_height - height);
+ 
++	page = page_align(rec);
++
+ 	slot->nth_rec = page_rec_get_n_recs_before(rec);
+-	slot->n_recs = page_get_n_recs(page_align(rec));
++	slot->n_recs = page_get_n_recs(page);
++	slot->page_no = page_get_page_no(page);
++	slot->page_level = btr_page_get_level_low(page);
++}
++
++/*******************************************************************//**
++Estimate the number of rows between slot1 and slot2 for any level on a
++B-tree. This function starts from slot1->page and reads a few pages to
++the right, counting their records. If we reach slot2->page quickly then
++we know exactly how many records there are between slot1 and slot2 and
++we set is_n_rows_exact to TRUE. If we cannot reach slot2->page quickly
++then we calculate the average number of records in the pages scanned
++so far and assume that all pages that we did not scan up to slot2->page
++contain the same number of records, then we multiply that average to
++the number of pages between slot1->page and slot2->page (which is
++n_rows_on_prev_level). In this case we set is_n_rows_exact to FALSE.
++ at return	number of rows (exact or estimated) */
++static
++ib_int64_t
++btr_estimate_n_rows_in_range_on_level(
++/*==================================*/
++	dict_index_t*	index,			/*!< in: index */
++	btr_path_t*	slot1,			/*!< in: left border */
++	btr_path_t*	slot2,			/*!< in: right border */
++	ib_int64_t	n_rows_on_prev_level,	/*!< in: number of rows
++						on the previous level for the
++						same descend paths; used to
++						determine the numbe of pages
++						on this level */
++	ibool*		is_n_rows_exact)	/*!< out: TRUE if the returned
++						value is exact i.e. not an
++						estimation */
++{
++	ulint		space;
++	ib_int64_t	n_rows;
++	ulint		n_pages_read;
++	ulint		page_no;
++	ulint		zip_size;
++	ulint		level;
++
++	space = dict_index_get_space(index);
++
++	n_rows = 0;
++	n_pages_read = 0;
++
++	/* Assume by default that we will scan all pages between
++	slot1->page_no and slot2->page_no */
++	*is_n_rows_exact = TRUE;
++
++	/* add records from slot1->page_no which are to the right of
++	the record which serves as a left border of the range, if any */
++	if (slot1->nth_rec < slot1->n_recs) {
++		n_rows += slot1->n_recs - slot1->nth_rec;
++	}
++
++	/* add records from slot2->page_no which are to the left of
++	the record which servers as a right border of the range, if any */
++	if (slot2->nth_rec > 1) {
++		n_rows += slot2->nth_rec - 1;
++	}
++
++	/* count the records in the pages between slot1->page_no and
++	slot2->page_no (non inclusive), if any */
++
++	zip_size = fil_space_get_zip_size(space);
++
++	/* Do not read more than this number of pages in order not to hurt
++	performance with this code which is just an estimation. If we read
++	this many pages before reaching slot2->page_no then we estimate the
++	average from the pages scanned so far */
++	#define N_PAGES_READ_LIMIT	10
++
++	page_no = slot1->page_no;
++	level = slot1->page_level;
++
++	do {
++		mtr_t		mtr;
++		page_t*		page;
++		buf_block_t*	block;
++
++		mtr_start(&mtr);
++
++		/* fetch the page */
++		block = buf_page_get(space, zip_size, page_no, RW_S_LATCH,
++				     &mtr);
++
++		page = buf_block_get_frame(block);
++
++		/* It is possible that the tree has been reorganized in the
++		meantime and this is a different page. If this happens the
++		calculated estimate will be bogus, which is not fatal as
++		this is only an estimate. We are sure that a page with
++		page_no exists because InnoDB never frees pages, only
++		reuses them. */
++		if (fil_page_get_type(page) != FIL_PAGE_INDEX
++		    || ut_dulint_cmp(btr_page_get_index_id(page), index->id)
++		    || btr_page_get_level_low(page) != level) {
++
++			/* The page got reused for something else */
++			goto inexact;
++		}
++
++		n_pages_read++;
++
++		if (page_no != slot1->page_no) {
++			/* Do not count the records on slot1->page_no,
++			we already counted them before this loop. */
++			n_rows += page_get_n_recs(page);
++		}
++
++		page_no = btr_page_get_next(page, &mtr);
++
++		mtr_commit(&mtr);
++
++		if (n_pages_read == N_PAGES_READ_LIMIT
++		    || page_no == FIL_NULL) {
++			/* Either we read too many pages or
++			we reached the end of the level without passing
++			through slot2->page_no, the tree must have changed
++			in the meantime */
++			goto inexact;
++		}
++
++	} while (page_no != slot2->page_no);
++
++	return(n_rows);
++
++inexact:
++
++	*is_n_rows_exact = FALSE;
++
++	/* We did interrupt before reaching slot2->page */
++
++	if (n_pages_read > 0) {
++		/* The number of pages on this level is
++		n_rows_on_prev_level, multiply it by the
++		average number of recs per page so far */
++		n_rows = n_rows_on_prev_level
++			* n_rows / n_pages_read;
++	} else {
++		/* The tree changed before we could even
++		start with slot1->page_no */
++		n_rows = 10;
++	}
++
++	return(n_rows);
+ }
+ 
+ /*******************************************************************//**
+@@ -3165,6 +3313,7 @@
+ 	ibool		diverged_lot;
+ 	ulint		divergence_level;
+ 	ib_int64_t	n_rows;
++	ibool		is_n_rows_exact;
+ 	ulint		i;
+ 	mtr_t		mtr;
+ 
+@@ -3207,6 +3356,7 @@
+ 	/* We have the path information for the range in path1 and path2 */
+ 
+ 	n_rows = 1;
++	is_n_rows_exact = TRUE;
+ 	diverged = FALSE;	    /* This becomes true when the path is not
+ 				    the same any more */
+ 	diverged_lot = FALSE;	    /* This becomes true when the paths are
+@@ -3222,7 +3372,7 @@
+ 		if (slot1->nth_rec == ULINT_UNDEFINED
+ 		    || slot2->nth_rec == ULINT_UNDEFINED) {
+ 
+-			if (i > divergence_level + 1) {
++			if (i > divergence_level + 1 && !is_n_rows_exact) {
+ 				/* In trees whose height is > 1 our algorithm
+ 				tends to underestimate: multiply the estimate
+ 				by 2: */
+@@ -3234,7 +3384,9 @@
+ 			to over 1 / 2 of the estimated rows in the whole
+ 			table */
+ 
+-			if (n_rows > index->table->stat_n_rows / 2) {
++			if (n_rows > index->table->stat_n_rows / 2
++			    && !is_n_rows_exact) {
++
+ 				n_rows = index->table->stat_n_rows / 2;
+ 
+ 				/* If there are just 0 or 1 rows in the table,
+@@ -3260,10 +3412,15 @@
+ 					divergence_level = i;
+ 				}
+ 			} else {
+-				/* Maybe the tree has changed between
+-				searches */
+-
+-				return(10);
++				/* It is possible that
++				slot1->nth_rec >= slot2->nth_rec
++				if, for example, we have a single page
++				tree which contains (inf, 5, 6, supr)
++				and we select where x > 20 and x < 30;
++				in this case slot1->nth_rec will point
++				to the supr record and slot2->nth_rec
++				will point to 6 */
++				n_rows = 0;
+ 			}
+ 
+ 		} else if (diverged && !diverged_lot) {
+@@ -3287,8 +3444,9 @@
+ 			}
+ 		} else if (diverged_lot) {
+ 
+-			n_rows = (n_rows * (slot1->n_recs + slot2->n_recs))
+-				/ 2;
++			n_rows = btr_estimate_n_rows_in_range_on_level(
++				index, slot1, slot2, n_rows,
++				&is_n_rows_exact);
+ 		}
+ 	}
+ }
+--- a/storage/innodb_plugin/include/btr0cur.h
++++ b/storage/innodb_plugin/include/btr0cur.h
+@@ -652,6 +652,11 @@
+ 				order); value ULINT_UNDEFINED
+ 				denotes array end */
+ 	ulint	n_recs;		/*!< number of records on the page */
++	ulint	page_no;	/*!< no of the page containing the record */
++	ulint	page_level;	/*!< level of the page, if later we fetch
++				the page under page_no and it is no different
++				level then we know that the tree has been
++				reorganized */
+ };
+ 
+ #define BTR_PATH_ARRAY_N_SLOTS	250	/*!< size of path array (in slots) */
+--- a/mysql-test/suite/innodb_plugin/r/innodb_gis.result
++++ b/mysql-test/suite/innodb_plugin/r/innodb_gis.result
+@@ -572,7 +572,7 @@
+ EXPLAIN 
+ SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+-1	SIMPLE	t2	ref	p	p	28	const	1	Using where
++1	SIMPLE	t2	ref	p	p	28	const	2	Using where
+ SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+ COUNT(*)
+ 2
+--- a/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
++++ b/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
+@@ -889,13 +889,13 @@
+ id	1
+ select_type	SIMPLE
+ table	t1
+-type	range
++type	index
+ possible_keys	bkey
+-key	bkey
+-key_len	5
++key	PRIMARY
++key_len	4
+ ref	NULL
+-rows	16
+-Extra	Using where; Using index; Using filesort
++rows	32
++Extra	Using where
+ SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
+ a	b
+ 1	2
+@@ -934,12 +934,12 @@
+ id	1
+ select_type	SIMPLE
+ table	t1
+-type	range
++type	index
+ possible_keys	bkey
+ key	bkey
+ key_len	5
+ ref	NULL
+-rows	16
++rows	32
+ Extra	Using where; Using index
+ SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
+ a	b
+@@ -989,7 +989,7 @@
+ key	bkey
+ key_len	5
+ ref	const
+-rows	8
++rows	16
+ Extra	Using where; Using index; Using filesort
+ SELECT * FROM t2 WHERE b=1 ORDER BY a;
+ a	b	c
+@@ -1018,7 +1018,7 @@
+ key	bkey
+ key_len	10
+ ref	const,const
+-rows	8
++rows	16
+ Extra	Using where; Using index
+ SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
+ a	b	c
+@@ -1047,7 +1047,7 @@
+ key	bkey
+ key_len	10
+ ref	const,const
+-rows	8
++rows	16
+ Extra	Using where; Using index
+ SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
+ a	b	c
+@@ -1076,7 +1076,7 @@
+ key	bkey
+ key_len	10
+ ref	const,const
+-rows	8
++rows	16
+ Extra	Using where; Using index
+ SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
+ a	b	c
+@@ -1211,7 +1211,7 @@
+ key	b
+ key_len	5
+ ref	const
+-rows	1
++rows	2
+ Extra	Using where; Using index
+ SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
+ a	b
+@@ -1226,7 +1226,7 @@
+ key	b
+ key_len	5
+ ref	const
+-rows	1
++rows	2
+ Extra	Using where; Using index
+ SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
+ a	b
+@@ -1370,7 +1370,7 @@
+ INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
+ EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
+ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+-1	SIMPLE	t1	index	t1_b	PRIMARY	4	NULL	8	Using where
++1	SIMPLE	t1	range	t1_b	t1_b	5	NULL	8	Using where
+ SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
+ a	b	c
+ 8	1	1
+@@ -1729,7 +1729,7 @@
+ FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
+ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+ 1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	1	
+-2	DERIVED	t1	index	c3,c2	c2	10	NULL	5	
++2	DERIVED	t1	ALL	c3,c2	c3	5		5	Using filesort
+ DROP TABLE t1;
+ CREATE TABLE t1 (c1 REAL, c2 REAL, c3 REAL, KEY (c3), KEY (c2, c3))
+ ENGINE=InnoDB;
+@@ -1743,7 +1743,7 @@
+ FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
+ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+ 1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	1	
+-2	DERIVED	t1	index	c3,c2	c2	18	NULL	5	
++2	DERIVED	t1	ALL	c3,c2	c3	9		5	Using filesort
+ DROP TABLE t1;
+ CREATE TABLE t1 (c1 DECIMAL(12,2), c2 DECIMAL(12,2), c3 DECIMAL(12,2), 
+ KEY (c3), KEY (c2, c3))
+@@ -1758,7 +1758,7 @@
+ FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
+ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+ 1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	1	
+-2	DERIVED	t1	index	c3,c2	c2	14	NULL	5	
++2	DERIVED	t1	ALL	c3,c2	c3	7		5	Using filesort
+ DROP TABLE t1;
+ End of 5.1 tests
+ drop table if exists t1, t2, t3;
+@@ -1834,7 +1834,7 @@
+ key	b
+ key_len	5
+ ref	NULL
+-rows	3
++rows	5
+ Extra	Using where; Using index
+ EXPLAIN SELECT c FROM bar WHERE c>2;;
+ id	1
+@@ -2430,7 +2430,7 @@
+ WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+ 1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Select tables optimized away
+-2	DERIVED	t1	index_merge	PRIMARY,idx	idx,PRIMARY	5,4	NULL	3537	Using sort_union(idx,PRIMARY); Using where
++2	DERIVED	t1	index_merge	PRIMARY,idx	idx,PRIMARY	5,4	NULL	1536	Using sort_union(idx,PRIMARY); Using where
+ SELECT COUNT(*) FROM
+ (SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+ WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
diff --git a/bug813587.patch b/bug813587.patch
index ea8e838..a33a67b 100644
--- a/bug813587.patch
+++ b/bug813587.patch
@@ -8,16 +8,15 @@
 #
 --- a/storage/federated/ha_federated.cc
 +++ b/storage/federated/ha_federated.cc
-@@ -1675,6 +1675,8 @@
+@@ -1641,6 +1641,7 @@
  
  int ha_federated::close(void)
  {
 +  THD *thd= current_thd;
-+
    DBUG_ENTER("ha_federated::close");
  
    free_result();
-@@ -1685,6 +1687,10 @@
+@@ -1651,6 +1652,10 @@
    mysql_close(mysql);
    mysql= NULL;
  
diff --git a/disable_query_cache_28249_test_sporadic_failure.patch b/disable_query_cache_28249_test_sporadic_failure.patch
new file mode 100644
index 0000000..e1598a2
--- /dev/null
+++ b/disable_query_cache_28249_test_sporadic_failure.patch
@@ -0,0 +1,8 @@
+--- a/mysql-test/t/disabled.def
++++ b/mysql-test/t/disabled.def
+@@ -12,4 +12,4 @@
+ kill                     : Bug#11748945 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
+ read_many_rows_innodb    : Bug#11748886 2010-11-15 mattiasj report already exists
+ main.log_tables-big      : Bug#11756699 2010-11-15 mattiasj report already exists
+-
++main.query_cache_28249   : http://bugs.mysql.com/bug.php?id=41098
diff --git a/innodb_bug47167_test_fix.patch b/innodb_bug47167_test_fix.patch
new file mode 100644
index 0000000..b6c249e
--- /dev/null
+++ b/innodb_bug47167_test_fix.patch
@@ -0,0 +1,52 @@
+--- a/mysql-test/suite/innodb_plugin/r/innodb_bug47167.result
++++ b/mysql-test/suite/innodb_plugin/r/innodb_bug47167.result
+@@ -1,7 +1,4 @@
+ set @old_innodb_file_format_check=@@innodb_file_format_check;
+-select @old_innodb_file_format_check;
+- at old_innodb_file_format_check
+-Antelope
+ set global innodb_file_format_check = Barracuda;
+ select @@innodb_file_format_check;
+ @@innodb_file_format_check
+@@ -11,9 +8,9 @@
+ @@innodb_file_format_check
+ Barracuda
+ set global innodb_file_format_check = @old_innodb_file_format_check;
+-select @@innodb_file_format_check;
+-@@innodb_file_format_check
+-Antelope
++select @@innodb_file_format_check = @old_innodb_file_format_check;
++@@innodb_file_format_check = @old_innodb_file_format_check
++1
+ set global innodb_file_format_check = cheetah;
+ ERROR HY000: Incorrect arguments to SET
+ set global innodb_file_format_check = Bear;
+--- a/mysql-test/suite/innodb_plugin/t/innodb_bug47167.test
++++ b/mysql-test/suite/innodb_plugin/t/innodb_bug47167.test
+@@ -9,9 +9,6 @@
+ # 'old_innodb_file_format_check'
+ set @old_innodb_file_format_check=@@innodb_file_format_check;
+ 
+-# @old_innodb_file_format_check shall have the value of 'Antelope'
+-select @old_innodb_file_format_check;
+-
+ # Reset the value in 'innodb_file_format_check' to 'Barracuda'
+ set global innodb_file_format_check = Barracuda;
+ 
+@@ -27,7 +24,7 @@
+ set global innodb_file_format_check = @old_innodb_file_format_check;
+ 
+ # Check whether 'innodb_file_format_check' get its original value.
+-select @@innodb_file_format_check;
++select @@innodb_file_format_check = @old_innodb_file_format_check;
+ 
+ # Following are negative tests, all should fail.
+ --disable_warnings
+--- a/mysql-test/include/have_innodb.inc
++++ b/mysql-test/include/have_innodb.inc
+@@ -1,4 +1,4 @@
+-if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
++if (`select count(*)>0 from information_schema.plugins where plugin_name like 'xtradb%'`)
+ {
+   --skip Test requires InnoDB.
+ }
diff --git a/mysql-bug580324.patch b/mysql-bug580324.patch
index cfe6e89..01535b1 100644
--- a/mysql-bug580324.patch
+++ b/mysql-bug580324.patch
@@ -5,9 +5,8 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/sql/sql_base.cc b/sql/sql_base.cc
---- a/sql/sql_base.cc	2010-05-27 19:54:18.000000000 +0400
-+++ b/sql/sql_base.cc	2010-05-27 19:55:20.000000000 +0400
+--- a/sql/sql_base.cc
++++ b/sql/sql_base.cc
 @@ -233,8 +233,12 @@
  uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list,
                            bool tmp_table)
@@ -23,10 +22,9 @@ diff -ruN a/sql/sql_base.cc b/sql/sql_base.cc
    if (tmp_table)
    {
      int4store(key + key_length, thd->server_id);
-diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
---- a/sql/sql_parse.cc	2010-05-27 19:54:18.000000000 +0400
-+++ b/sql/sql_parse.cc	2010-05-27 20:03:20.000000000 +0400
-@@ -1341,10 +1341,12 @@
+--- a/sql/sql_parse.cc
++++ b/sql/sql_parse.cc
+@@ -1342,10 +1342,12 @@
      break;
  #else
    {
@@ -41,7 +39,7 @@ diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
  
      /* used as fields initializator */
      lex_start(thd);
-@@ -1356,26 +1358,22 @@
+@@ -1357,26 +1359,22 @@
      /*
        We have name + wildcard in packet, separated by endzero
      */
@@ -79,7 +77,7 @@ diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
  
      if (is_schema_db(table_list.db, table_list.db_length))
      {
-@@ -1384,9 +1382,6 @@
+@@ -1385,9 +1383,6 @@
          table_list.schema_table= schema_table;
      }
  
@@ -89,9 +87,8 @@ diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
      thd->set_query(fields, query_length);
      general_log_print(thd, command, "%s %s", table_list.table_name, fields);
      if (lower_case_table_names)
-diff -ruN a/strings/ctype-utf8.c b/strings/ctype-utf8.c
---- a/strings/ctype-utf8.c	2010-05-06 19:28:05.000000000 +0400
-+++ b/strings/ctype-utf8.c	2010-05-27 20:04:20.000000000 +0400
+--- a/strings/ctype-utf8.c
++++ b/strings/ctype-utf8.c
 @@ -4116,6 +4116,10 @@
  {
    int code;
diff --git a/mysql-bug677407.patch b/mysql-bug677407.patch
index 4c4f9aa..996e8d8 100644
--- a/mysql-bug677407.patch
+++ b/mysql-bug677407.patch
@@ -49,9 +49,8 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-diff -ruN a/storage/innodb_plugin/trx/trx0i_s.c b/storage/innodb_plugin/trx/trx0i_s.c
---- a/storage/innodb_plugin/trx/trx0i_s.c	2010-11-03 16:39:54.000000000 +0300
-+++ b/storage/innodb_plugin/trx/trx0i_s.c	2010-11-30 13:57:03.000000000 +0300
+--- a/storage/innodb_plugin/trx/trx0i_s.c
++++ b/storage/innodb_plugin/trx/trx0i_s.c
 @@ -157,10 +157,6 @@
  	ullint		last_read;	/*!< last time the cache was read;
  					measured in microseconds since
diff --git a/mysql-bugfix48929.patch b/mysql-bugfix48929.patch
index d40e88d..d97953f 100644
--- a/mysql-bugfix48929.patch
+++ b/mysql-bugfix48929.patch
@@ -5,9 +5,8 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/configure.in b/configure.in
---- a/configure.in	2010-07-07 03:33:05.008972002 +0400
-+++ b/configure.in	2010-07-07 03:33:05.788972002 +0400
+--- a/configure.in
++++ b/configure.in
 @@ -815,7 +815,7 @@
  AC_HEADER_STDC
  AC_HEADER_SYS_WAIT
@@ -17,23 +16,8 @@ diff -ruN a/configure.in b/configure.in
   stdlib.h stddef.h \
   strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
   sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
-diff -ruN a/configure b/configure
-diff -ruN a/include/config.h.in b/include/config.h.in
---- a/include/config.h.in	2010-07-26 18:29:12.192113524 +0900
-+++ b/include/config.h.in	2010-07-26 20:46:08.265182869 +0900
-@@ -609,6 +609,9 @@
- /* Define to 1 if you have the `poll' function. */
- #undef HAVE_POLL
- 
-+/* Define to 1 if you have the <poll.h> header file. */
-+#undef HAVE_POLL_H
-+
- /* Define to 1 if you have the `port_create' function. */
- #undef HAVE_PORT_CREATE
- 
-diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
---- a/sql/mysqld.cc	2010-07-07 03:33:05.278972002 +0400
-+++ b/sql/mysqld.cc	2010-07-07 03:33:05.788972002 +0400
+--- a/sql/mysqld.cc
++++ b/sql/mysqld.cc
 @@ -55,6 +55,10 @@
  #include "sp_rcontext.h"
  #include "sp_cache.h"
@@ -45,7 +29,7 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
  #define mysqld_charset &my_charset_latin1
  
  #ifdef HAVE_purify
-@@ -5124,28 +5128,49 @@
+@@ -5136,28 +5140,49 @@
  {
    my_socket sock,new_sock;
    uint error_count=0;
@@ -98,7 +82,7 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
  #ifdef HAVE_FCNTL
    socket_flags=fcntl(unix_sock, F_GETFL, 0);
  #endif
-@@ -5155,12 +5180,15 @@
+@@ -5167,12 +5192,15 @@
    MAYBE_BROKEN_SYSCALL;
    while (!abort_loop)
    {
@@ -119,7 +103,7 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
      {
        if (socket_errno != SOCKET_EINTR)
        {
-@@ -5170,7 +5198,7 @@
+@@ -5182,7 +5210,7 @@
        MAYBE_BROKEN_SYSCALL
        continue;
      }
@@ -128,7 +112,7 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
      if (abort_loop)
      {
        MAYBE_BROKEN_SYSCALL;
-@@ -5178,6 +5206,21 @@
+@@ -5190,6 +5218,21 @@
      }
  
      /* Is this a new connection request ? */
@@ -150,7 +134,7 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
  #ifdef HAVE_SYS_UN_H
      if (FD_ISSET(unix_sock,&readFDs))
      {
-@@ -5185,11 +5228,12 @@
+@@ -5197,11 +5240,12 @@
        flags= socket_flags;
      }
      else
diff --git a/mysql-control_online_alter_index.patch b/mysql-control_online_alter_index.patch
index 861d06f..5c463cf 100644
--- a/mysql-control_online_alter_index.patch
+++ b/mysql-control_online_alter_index.patch
@@ -5,10 +5,9 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/sql/handler.h b/sql/handler.h
---- a/sql/handler.h	2010-07-21 22:49:53.660561079 +0900
-+++ b/sql/handler.h	2010-07-21 22:50:24.106530090 +0900
-@@ -169,6 +169,19 @@
+--- a/sql/handler.h
++++ b/sql/handler.h
+@@ -170,6 +170,19 @@
  #define HA_ONLINE_DROP_UNIQUE_INDEX             (1L << 9) /*drop uniq. online*/
  #define HA_ONLINE_ADD_PK_INDEX                  (1L << 10)/*add prim. online*/
  #define HA_ONLINE_DROP_PK_INDEX                 (1L << 11)/*drop prim. online*/
@@ -28,10 +27,9 @@ diff -ruN a/sql/handler.h b/sql/handler.h
  /*
    HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
    supported at all.
-diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
---- a/sql/mysqld.cc	2010-07-21 22:49:54.011529414 +0900
-+++ b/sql/mysqld.cc	2010-07-21 22:50:24.112527179 +0900
-@@ -5898,6 +5898,7 @@
+--- a/sql/mysqld.cc
++++ b/sql/mysqld.cc
+@@ -5911,6 +5911,7 @@
    OPT_USERSTAT_RUNNING,
    OPT_THREAD_STATISTICS,
    OPT_OPTIMIZER_FIX,
@@ -39,7 +37,7 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
    OPT_SUPPRESS_LOG_WARNING_1592,
    OPT_QUERY_CACHE_STRIP_COMMENTS,
    OPT_USE_GLOBAL_LONG_QUERY_TIME,
-@@ -5930,6 +5931,13 @@
+@@ -5943,6 +5944,13 @@
     "from libc.so",
     &opt_allow_suspicious_udfs, &opt_allow_suspicious_udfs,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -53,9 +51,8 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
    {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode "
     "will also set transaction isolation level 'serializable'.", 0, 0, 0,
     GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-diff -ruN a/sql/set_var.cc b/sql/set_var.cc
---- a/sql/set_var.cc	2010-07-21 22:49:54.019529438 +0900
-+++ b/sql/set_var.cc	2010-07-21 22:50:24.122532110 +0900
+--- a/sql/set_var.cc
++++ b/sql/set_var.cc
 @@ -758,6 +758,11 @@
  sys_engine_condition_pushdown(&vars, "engine_condition_pushdown",
  			      &SV::engine_condition_pushdown);
@@ -68,9 +65,8 @@ diff -ruN a/sql/set_var.cc b/sql/set_var.cc
  #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
  /* ndb thread specific variable settings */
  static sys_var_thd_ulong
-diff -ruN a/sql/sql_class.h b/sql/sql_class.h
---- a/sql/sql_class.h	2010-07-21 22:49:53.742561560 +0900
-+++ b/sql/sql_class.h	2010-07-21 22:50:24.130529404 +0900
+--- a/sql/sql_class.h
++++ b/sql/sql_class.h
 @@ -381,6 +381,8 @@
    my_bool ndb_use_transactions;
    my_bool ndb_index_stat_enable;
@@ -80,9 +76,8 @@ diff -ruN a/sql/sql_class.h b/sql/sql_class.h
    my_bool old_alter_table;
    my_bool old_passwords;
  
-diff -ruN a/sql/sql_partition.cc b/sql/sql_partition.cc
---- a/sql/sql_partition.cc	2010-06-04 00:50:11.000000000 +0900
-+++ b/sql/sql_partition.cc	2010-07-21 22:50:24.140530183 +0900
+--- a/sql/sql_partition.cc
++++ b/sql/sql_partition.cc
 @@ -4381,7 +4381,12 @@
          alter_info->no_parts= curr_part_no - new_part_no;
        }
@@ -97,10 +92,9 @@ diff -ruN a/sql/sql_partition.cc b/sql/sql_partition.cc
      {
        my_error(ER_PARTITION_FUNCTION_FAILURE, MYF(0));
        DBUG_RETURN(1);
-diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
---- a/sql/sql_table.cc	2010-06-04 00:50:11.000000000 +0900
-+++ b/sql/sql_table.cc	2010-07-21 22:50:24.146531063 +0900
-@@ -7003,6 +7003,10 @@
+--- a/sql/sql_table.cc
++++ b/sql/sql_table.cc
+@@ -7005,6 +7005,10 @@
      uint  *idx_end_p;
  
      alter_flags= table->file->alter_table_flags(alter_info->flags);
diff --git a/mysql-error_pad.patch b/mysql-error_pad.patch
index aa3e8fa..c97b181 100644
--- a/mysql-error_pad.patch
+++ b/mysql-error_pad.patch
@@ -5,9 +5,8 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/extra/comp_err.c b/extra/comp_err.c
---- a/extra/comp_err.c	2010-08-03 17:24:24.000000000 +0000
-+++ b/extra/comp_err.c	2010-09-14 16:49:28.000000000 +0000
+--- a/extra/comp_err.c
++++ b/extra/comp_err.c
 @@ -30,11 +30,12 @@
  #include <assert.h>
  #include <my_dir.h>
diff --git a/mysql-fix-bug671764.patch b/mysql-fix-bug671764.patch
index 1a49e9b..bda76b2 100644
--- a/mysql-fix-bug671764.patch
+++ b/mysql-fix-bug671764.patch
@@ -5,10 +5,9 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/configure.in b/configure.in
---- a/configure.in	2010-11-29 18:45:47.000000000 +0000
-+++ b/configure.in	2010-11-29 18:45:51.000000000 +0000
-@@ -2727,7 +2727,7 @@
+--- a/configure.in
++++ b/configure.in
+@@ -2772,7 +2772,7 @@
      MAN_DROP="$MAN_DROP embedded"
      grep -v 'embedded' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
    fi
@@ -17,7 +16,7 @@ diff -ruN a/configure.in b/configure.in
    then
      MAN_DROP="$MAN_DROP innodb"
      grep -v 'inno' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
-@@ -2806,7 +2806,7 @@
+@@ -2851,7 +2851,7 @@
  fi
  
  # "innochecksum" is not in the "innobase/" subdirectory, but should be switched
diff --git a/mysql-i_s_innodb_buffer_pool_pages.patch b/mysql-i_s_innodb_buffer_pool_pages.patch
index 01e9505..fb7bc48 100644
--- a/mysql-i_s_innodb_buffer_pool_pages.patch
+++ b/mysql-i_s_innodb_buffer_pool_pages.patch
@@ -5,9 +5,8 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c
---- a/storage/innodb_plugin/buf/buf0buf.c	2010-07-14 15:57:23.322321253 +0900
-+++ b/storage/innodb_plugin/buf/buf0buf.c	2010-07-14 16:04:45.521321527 +0900
+--- a/storage/innodb_plugin/buf/buf0buf.c
++++ b/storage/innodb_plugin/buf/buf0buf.c
 @@ -269,14 +269,6 @@
  UNIV_INTERN ibool		buf_debug_prints = FALSE;
  #endif /* UNIV_DEBUG */
@@ -23,10 +22,9 @@ diff -ruN a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0
  #endif /* !UNIV_HOTBACKUP */
  
  /********************************************************************//**
-diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
---- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-04-29 15:55:25.000000000 +0900
-+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-04-29 16:04:05.000000000 +0900
-@@ -11256,6 +11256,9 @@
+--- a/storage/innodb_plugin/handler/ha_innodb.cc
++++ b/storage/innodb_plugin/handler/ha_innodb.cc
+@@ -11252,6 +11252,9 @@
    innobase_system_variables, /* system variables */
    NULL /* reserved */
  },
@@ -36,9 +34,8 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
  i_s_innodb_trx,
  i_s_innodb_locks,
  i_s_innodb_lock_waits,
-diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
---- a/storage/innodb_plugin/handler/i_s.cc	2010-04-29 15:28:20.000000000 +0900
-+++ b/storage/innodb_plugin/handler/i_s.cc	2010-04-29 16:04:05.000000000 +0900
+--- a/storage/innodb_plugin/handler/i_s.cc
++++ b/storage/innodb_plugin/handler/i_s.cc
 @@ -42,6 +42,7 @@
  #include "buf0buf.h" /* for buf_pool and PAGE_ZIP_MIN_SIZE */
  #include "ha_prototypes.h" /* for innobase_convert_name() */
@@ -753,9 +750,8 @@ diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler
  /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
  static ST_FIELD_INFO	innodb_trx_fields_info[] =
  {
-diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h
---- a/storage/innodb_plugin/handler/i_s.h	2010-04-29 15:28:20.000000000 +0900
-+++ b/storage/innodb_plugin/handler/i_s.h	2010-04-29 16:04:05.000000000 +0900
+--- a/storage/innodb_plugin/handler/i_s.h
++++ b/storage/innodb_plugin/handler/i_s.h
 @@ -26,6 +26,9 @@
  #ifndef i_s_h
  #define i_s_h
@@ -766,9 +762,8 @@ diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/
  extern struct st_mysql_plugin	i_s_innodb_trx;
  extern struct st_mysql_plugin	i_s_innodb_locks;
  extern struct st_mysql_plugin	i_s_innodb_lock_waits;
-diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
---- a/storage/innodb_plugin/handler/innodb_patch_info.h	2010-04-29 16:03:34.000000000 +0900
-+++ b/storage/innodb_plugin/handler/innodb_patch_info.h	2010-04-29 16:04:05.000000000 +0900
+--- a/storage/innodb_plugin/handler/innodb_patch_info.h
++++ b/storage/innodb_plugin/handler/innodb_patch_info.h
 @@ -27,5 +27,6 @@
  {"innodb_show_status","Improvements to SHOW INNODB STATUS","Memory information and lock info fixes","http://www.percona.com/docs/wiki/percona-xtradb"},
  {"innodb_io","Improvements to InnoDB IO","","http://www.percona.com/docs/wiki/percona-xtradb"},
@@ -776,9 +771,8 @@ diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_p
 +{"innodb_buffer_pool_pages","Information of buffer pool content","","http://www.percona.com/docs/wiki/percona-xtradb"},
  {NULL, NULL, NULL, NULL}
  };
-diff -ruN a/storage/innodb_plugin/include/buf0buf.h b/storage/innodb_plugin/include/buf0buf.h
---- a/storage/innodb_plugin/include/buf0buf.h	2010-07-14 15:57:23.333331973 +0900
-+++ b/storage/innodb_plugin/include/buf0buf.h	2010-07-14 16:03:45.885392395 +0900
+--- a/storage/innodb_plugin/include/buf0buf.h
++++ b/storage/innodb_plugin/include/buf0buf.h
 @@ -1286,6 +1286,15 @@
  #define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b))
  /* @} */
diff --git a/mysql-innodb_adjust_defaults.patch b/mysql-innodb_adjust_defaults.patch
index aaf55ef..eb8302b 100644
--- a/mysql-innodb_adjust_defaults.patch
+++ b/mysql-innodb_adjust_defaults.patch
@@ -5,10 +5,9 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
---- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-04-30 16:39:14.000000000 +0900
-+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-04-30 16:43:26.000000000 +0900
-@@ -11300,7 +11300,7 @@
+--- a/storage/innodb_plugin/handler/ha_innodb.cc
++++ b/storage/innodb_plugin/handler/ha_innodb.cc
+@@ -11296,7 +11296,7 @@
  static MYSQL_SYSVAR_ULONG(use_purge_thread, srv_use_purge_thread,
    PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
    "Number of purge devoted threads. #### over 1 is EXPERIMENTAL ####",
@@ -17,7 +16,7 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
  
  static MYSQL_SYSVAR_BOOL(overwrite_relay_log_info, innobase_overwrite_relay_log_info,
    PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
-@@ -11400,7 +11400,7 @@
+@@ -11396,7 +11396,7 @@
  static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
    PLUGIN_VAR_NOCMDARG,
    "Attempt flushing dirty pages to avoid IO bursts at checkpoints.",
@@ -26,7 +25,7 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
  
  static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
    PLUGIN_VAR_RQCMDARG,
-@@ -11633,7 +11633,7 @@
+@@ -11629,7 +11629,7 @@
  static MYSQL_SYSVAR_ULONG(ibuf_active_contract, srv_ibuf_active_contract,
    PLUGIN_VAR_RQCMDARG,
    "Enable/Disable active_contract of insert buffer. 0:disable 1:enable",
@@ -35,7 +34,7 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
  
  static MYSQL_SYSVAR_ULONG(ibuf_accel_rate, srv_ibuf_accel_rate,
    PLUGIN_VAR_RQCMDARG,
-@@ -11713,8 +11713,8 @@
+@@ -11709,8 +11709,8 @@
  };
  static MYSQL_SYSVAR_ENUM(adaptive_checkpoint, srv_adaptive_checkpoint,
    PLUGIN_VAR_RQCMDARG,
diff --git a/mysql-innodb_admin_command_base.patch b/mysql-innodb_admin_command_base.patch
index 72eec5f..6ec2d8a 100644
--- a/mysql-innodb_admin_command_base.patch
+++ b/mysql-innodb_admin_command_base.patch
@@ -5,10 +5,9 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
---- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-27 16:27:30.222410116 +0900
-+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-27 16:27:44.073104773 +0900
-@@ -11612,6 +11612,7 @@
+--- a/storage/innodb_plugin/handler/ha_innodb.cc
++++ b/storage/innodb_plugin/handler/ha_innodb.cc
+@@ -11608,6 +11608,7 @@
  i_s_innodb_cmpmem_reset,
  i_s_innodb_table_stats,
  i_s_innodb_index_stats,
@@ -16,9 +15,8 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
  i_s_innodb_patches
  mysql_declare_plugin_end;
  
-diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
---- a/storage/innodb_plugin/handler/i_s.cc	2010-08-27 16:22:04.261021936 +0900
-+++ b/storage/innodb_plugin/handler/i_s.cc	2010-08-27 16:27:44.077058655 +0900
+--- a/storage/innodb_plugin/handler/i_s.cc
++++ b/storage/innodb_plugin/handler/i_s.cc
 @@ -2947,3 +2947,139 @@
  	STRUCT_FLD(system_vars, NULL),
  	STRUCT_FLD(__reserved1, NULL)
@@ -159,9 +157,8 @@ diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler
 +	STRUCT_FLD(system_vars, NULL),
 +	STRUCT_FLD(__reserved1, NULL)
 +};
-diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h
---- a/storage/innodb_plugin/handler/i_s.h	2010-08-27 16:22:04.261987654 +0900
-+++ b/storage/innodb_plugin/handler/i_s.h	2010-08-27 16:27:44.079059299 +0900
+--- a/storage/innodb_plugin/handler/i_s.h
++++ b/storage/innodb_plugin/handler/i_s.h
 @@ -40,5 +40,6 @@
  extern struct st_mysql_plugin	i_s_innodb_rseg;
  extern struct st_mysql_plugin	i_s_innodb_table_stats;
@@ -169,9 +166,8 @@ diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/
 +extern struct st_mysql_plugin	i_s_innodb_admin_command;
  
  #endif /* i_s_h */
-diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
---- a/storage/innodb_plugin/handler/innodb_patch_info.h	2010-08-27 16:27:30.223001821 +0900
-+++ b/storage/innodb_plugin/handler/innodb_patch_info.h	2010-08-27 16:27:44.074104321 +0900
+--- a/storage/innodb_plugin/handler/innodb_patch_info.h
++++ b/storage/innodb_plugin/handler/innodb_patch_info.h
 @@ -38,5 +38,6 @@
  {"innodb_stats","Additional features about InnoDB statistics/optimizer","","http://www.percona.com/docs/wiki/percona-xtradb"},
  {"innodb_recovery_patches","Bugfixes and adjustments about recovery process","","http://www.percona.com/docs/wiki/percona-xtradb"},
@@ -179,3 +175,18 @@ diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_p
 +{"innodb_admin_command_base","XtraDB specific command interface through i_s","","http://www.percona.com/docs/wiki/percona-xtradb"},
  {NULL, NULL, NULL, NULL}
  };
+--- /dev/null
++++ b/mysql-test/r/percona_xtradb_admin_command.result
+@@ -0,0 +1,6 @@
++select * from information_schema.XTRADB_ADMIN_COMMAND;
++result_message
++No XTRA_* command in the SQL statement. Please add /*!XTRA_xxxx*/ to the SQL.
++select * from information_schema.XTRADB_ADMIN_COMMAND /*!XTRA_HELLO*/;
++result_message
++Hello!
+--- /dev/null
++++ b/mysql-test/t/percona_xtradb_admin_command.test
+@@ -0,0 +1,3 @@
++--source include/have_innodb.inc
++select * from information_schema.XTRADB_ADMIN_COMMAND;
++select * from information_schema.XTRADB_ADMIN_COMMAND /*!XTRA_HELLO*/;
diff --git a/mysql-innodb_buffer_pool_shm.patch b/mysql-innodb_buffer_pool_shm.patch
index 3e18bbf..d6ae663 100644
--- a/mysql-innodb_buffer_pool_shm.patch
+++ b/mysql-innodb_buffer_pool_shm.patch
@@ -5,303 +5,22 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c
---- a/storage/innodb_plugin/buf/buf0buf.c	2010-07-14 16:32:49.669501663 +0900
-+++ b/storage/innodb_plugin/buf/buf0buf.c	2010-07-14 16:40:16.149438645 +0900
-@@ -53,6 +53,10 @@
- #include "page0zip.h"
- #include "trx0trx.h"
- #include "srv0start.h"
-+#include "que0que.h"
-+#include "read0read.h"
-+#include "row0row.h"
-+#include "ha_prototypes.h"
- 
- /* prototypes for new functions added to ha_innodb.cc */
- trx_t* innobase_get_trx();
-@@ -310,6 +314,30 @@
- UNIV_INTERN ibool		buf_debug_prints = FALSE;
- #endif /* UNIV_DEBUG */
- 
-+/* Buffer pool shared memory segment information */
-+typedef	struct buf_shm_info_struct	buf_shm_info_t;
-+
-+struct buf_shm_info_struct {
-+	char	head_str[8];
-+	ulint	binary_id;
-+	ibool	is_new;		/* during initializing */
-+	ibool	clean;		/* clean shutdowned and free */
-+	ibool	reusable;	/* reusable */
-+	ulint	buf_pool_size;	/* backup value */
-+	ulint	page_size;	/* backup value */
-+	ulint	frame_offset;	/* offset of the first frame based on chunk->mem */
-+	ulint	zip_hash_offset;
-+	ulint	zip_hash_n;
-+
-+	ulint	checksum;
-+
-+	buf_pool_t	buf_pool_backup;
-+	buf_chunk_t	chunk_backup;
-+
-+	ib_uint64_t	dummy;
-+};
-+
-+#define BUF_SHM_INFO_HEAD "XTRA_SHM"
- #endif /* !UNIV_HOTBACKUP */
- 
- /********************************************************************//**
-@@ -756,6 +784,45 @@
- #endif /* UNIV_SYNC_DEBUG */
- }
- 
-+static
-+void
-+buf_block_reuse(
-+/*============*/
-+	buf_block_t*	block,
-+	ptrdiff_t	frame_offset)
-+{
-+	/* block_init */
-+	block->frame += frame_offset;
-+
-+	UNIV_MEM_DESC(block->frame, UNIV_PAGE_SIZE, block);
-+
-+	block->index = NULL;
-+
-+#ifdef UNIV_DEBUG
-+	/* recreate later */
-+	block->page.in_page_hash = FALSE;
-+	block->page.in_zip_hash = FALSE;
-+#endif /* UNIV_DEBUG */
-+
-+#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
-+	block->n_pointers = 0;
-+#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
-+
-+	if (block->page.zip.data)
-+		block->page.zip.data += frame_offset;
-+
-+	block->is_hashed = FALSE;
-+
-+	mutex_create(&block->mutex, SYNC_BUF_BLOCK);
-+
-+	rw_lock_create(&block->lock, SYNC_LEVEL_VARYING);
-+	ut_ad(rw_lock_validate(&(block->lock)));
-+
-+#ifdef UNIV_SYNC_DEBUG
-+	rw_lock_create(&block->debug_latch, SYNC_NO_ORDER_CHECK);
-+#endif /* UNIV_SYNC_DEBUG */
-+}
-+
- /********************************************************************//**
- Allocates a chunk of buffer frames.
- @return	chunk, or NULL on failure */
-@@ -768,26 +835,190 @@
- {
+--- a/storage/innodb_plugin/buf/buf0buf.c
++++ b/storage/innodb_plugin/buf/buf0buf.c
+@@ -773,10 +773,12 @@
  	buf_block_t*	block;
  	byte*		frame;
-+	ulint		zip_hash_n = 0;
-+	ulint		zip_hash_mem_size = 0;
-+	hash_table_t*	zip_hash_tmp = NULL;
  	ulint		i;
 +	ulint		size_target;
-+	buf_shm_info_t*	shm_info = NULL;
  
  	/* Round down to a multiple of page size,
  	although it already should be. */
  	mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE);
 +	size_target = (mem_size / UNIV_PAGE_SIZE) - 1;
-+
-+	srv_buffer_pool_shm_is_reused = FALSE;
-+
-+	if (srv_buffer_pool_shm_key) {
-+		/* zip_hash size */
-+		zip_hash_n = (mem_size / UNIV_PAGE_SIZE) * 2;
-+		zip_hash_mem_size = ut_2pow_round(hash_create_needed(zip_hash_n)
-+						  + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
-+	}
-+
  	/* Reserve space for the block descriptors. */
  	mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block)
  				  + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
-+	if (srv_buffer_pool_shm_key) {
-+		 mem_size += ut_2pow_round(sizeof(buf_shm_info_t)
-+					   + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
-+		 mem_size += zip_hash_mem_size;
-+	}
- 
- 	chunk->mem_size = mem_size;
-+
-+	if (srv_buffer_pool_shm_key) {
-+		ulint	binary_id;
-+		ibool	is_new;
-+
-+		ut_a(buf_pool->n_chunks == 1);
-+
-+		fprintf(stderr,
-+		"InnoDB: Warning: The innodb_buffer_pool_shm_key option has been specified.\n"
-+		"InnoDB: Do not change the following between restarts of the server while this option is being used:\n"
-+		"InnoDB:   * the mysqld executable between restarts of the server.\n"
-+		"InnoDB:   * the value of innodb_buffer_pool_size.\n"
-+		"InnoDB:   * the value of innodb_page_size.\n"
-+		"InnoDB:   * datafiles created by InnoDB during this session.\n"
-+		"InnoDB: Otherwise, data corruption in datafiles may result.\n");
-+
-+		/* FIXME: This is vague id still */
-+		binary_id = (ulint) ((byte*)mtr_commit - (byte*)btr_root_get)
-+			  + (ulint) ((byte*)os_get_os_version - (byte*)buf_calc_page_new_checksum)
-+			  + (ulint) ((byte*)page_dir_find_owner_slot - (byte*)dfield_data_is_binary_equal)
-+			  + (ulint) ((byte*)que_graph_publish - (byte*)dict_casedn_str)
-+			  + (ulint) ((byte*)read_view_oldest_copy_or_open_new - (byte*)fil_space_get_version)
-+			  + (ulint) ((byte*)rec_get_n_extern_new - (byte*)fsp_get_size_low)
-+			  + (ulint) ((byte*)row_get_trx_id_offset - (byte*)ha_create_func)
-+			  + (ulint) ((byte*)srv_set_io_thread_op_info - (byte*)thd_is_replication_slave_thread)
-+			  + (ulint) ((byte*)mutex_create_func - (byte*)ibuf_inside)
-+			  + (ulint) ((byte*)trx_set_detailed_error - (byte*)lock_check_trx_id_sanity)
-+			  + (ulint) ((byte*)ut_time - (byte*)mem_heap_strdup);
-+
-+		chunk->mem = os_shm_alloc(&chunk->mem_size, srv_buffer_pool_shm_key, &is_new);
-+
-+		if (UNIV_UNLIKELY(chunk->mem == NULL)) {
-+			return(NULL);
-+		}
-+init_again:
-+#ifdef UNIV_SET_MEM_TO_ZERO
-+		if (is_new) {
-+			memset(chunk->mem, '\0', chunk->mem_size);
-+		}
-+#endif
-+		/* for ut_fold_binary_32(), these values should be 32-bit aligned */
-+		ut_a(sizeof(buf_shm_info_t) % 4 == 0);
-+		ut_a((ulint)chunk->mem % 4 == 0);
-+		ut_a(chunk->mem_size % 4 == 0);
-+
-+		shm_info = chunk->mem;
-+
-+		zip_hash_tmp = (hash_table_t*)((byte*)chunk->mem + chunk->mem_size - zip_hash_mem_size);
-+
-+		if (is_new) {
-+			strncpy(shm_info->head_str, BUF_SHM_INFO_HEAD, 8);
-+			shm_info->binary_id = binary_id;
-+			shm_info->is_new = TRUE;	/* changed to FALSE when the initialization is finished */
-+			shm_info->clean = FALSE;	/* changed to TRUE when free the segment. */
-+			shm_info->reusable = FALSE;	/* changed to TRUE when validation is finished. */
-+			shm_info->buf_pool_size = srv_buf_pool_size;
-+			shm_info->page_size = srv_page_size;
-+			shm_info->zip_hash_offset = chunk->mem_size - zip_hash_mem_size;
-+			shm_info->zip_hash_n = zip_hash_n;
-+		} else {
-+			ulint	checksum;
-+
-+			if (strncmp(shm_info->head_str, BUF_SHM_INFO_HEAD, 8)) {
-+				fprintf(stderr,
-+				"InnoDB: Error: The shared memory segment seems not to be for buffer pool.\n");
-+				return(NULL);
-+			}
-+			if (shm_info->binary_id != binary_id) {
-+				fprintf(stderr,
-+				"InnoDB: Error: The shared memory segment seems not to be for this binary.\n");
-+				return(NULL);
-+			}
-+			if (shm_info->is_new) {
-+				fprintf(stderr,
-+				"InnoDB: Error: The shared memory was not initialized yet.\n");
-+				return(NULL);
-+			}
-+			if (shm_info->buf_pool_size != srv_buf_pool_size) {
-+				fprintf(stderr,
-+				"InnoDB: Error: srv_buf_pool_size is different (shm=%lu current=%lu).\n",
-+				shm_info->buf_pool_size, srv_buf_pool_size);
-+				return(NULL);
-+			}
-+			if (shm_info->page_size != srv_page_size) {
-+				fprintf(stderr,
-+				"InnoDB: Error: srv_page_size is different (shm=%lu current=%lu).\n",
-+				shm_info->page_size, srv_page_size);
-+				return(NULL);
-+			}
-+			if (!shm_info->reusable) {
-+				fprintf(stderr,
-+				"InnoDB: Warning: The shared memory has unrecoverable contents.\n"
-+				"InnoDB: The shared memory segment is initialized.\n");
-+				is_new = TRUE;
-+				goto init_again;
-+			}
-+			if (!shm_info->clean) {
-+				fprintf(stderr,
-+				"InnoDB: Warning: The shared memory was not shut down cleanly.\n"
-+				"InnoDB: The shared memory segment is initialized.\n");
-+				is_new = TRUE;
-+				goto init_again;
-+			}
-+
-+			ut_a(shm_info->zip_hash_offset == chunk->mem_size - zip_hash_mem_size);
-+			ut_a(shm_info->zip_hash_n == zip_hash_n);
-+
-+			/* check checksum */
-+			if (srv_buffer_pool_shm_checksum) {
-+				checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
-+							     chunk->mem_size - sizeof(buf_shm_info_t));
-+			} else {
-+				checksum = BUF_NO_CHECKSUM_MAGIC;
-+			}
-+
-+			if (shm_info->checksum != BUF_NO_CHECKSUM_MAGIC
-+			    && shm_info->checksum != checksum) {
-+				fprintf(stderr,
-+				"InnoDB: Error: checksum of the shared memory is not match. "
-+				"(stored=%lu calculated=%lu)\n",
-+				shm_info->checksum, checksum);
-+				return(NULL);
-+			}
-+
-+			/* flag to use the segment. */
-+			shm_info->clean = FALSE;	/* changed to TRUE when free the segment. */
-+		}
-+
-+		/* init zip_hash contents */
-+		if (is_new) {
-+			hash_create_init(zip_hash_tmp, zip_hash_n);
-+		} else {
-+			/* adjust offset is done later */
-+			hash_create_reuse(zip_hash_tmp);
-+
-+			srv_buffer_pool_shm_is_reused = TRUE;
-+		}
-+	} else {
- 	chunk->mem = os_mem_alloc_large(&chunk->mem_size);
- 
- 	if (UNIV_UNLIKELY(chunk->mem == NULL)) {
- 
- 		return(NULL);
- 	}
-+	}
- 
- 	/* Allocate the block descriptors from
- 	the start of the memory block. */
-+	if (srv_buffer_pool_shm_key) {
-+		chunk->blocks = (buf_block_t*)((byte*)chunk->mem + sizeof(buf_shm_info_t));
-+	} else {
- 	chunk->blocks = chunk->mem;
-+	}
- 
- 	/* Align a pointer to the first frame.  Note that when
- 	os_large_page_size is smaller than UNIV_PAGE_SIZE,
-@@ -795,8 +1026,13 @@
- 	it is bigger, we may allocate more blocks than requested. */
- 
- 	frame = ut_align(chunk->mem, UNIV_PAGE_SIZE);
-+	if (srv_buffer_pool_shm_key) {
-+		/* reserve zip_hash space and always -1 for reproductibity */
-+		chunk->size = (chunk->mem_size - zip_hash_mem_size) / UNIV_PAGE_SIZE - 1;
-+	} else {
- 	chunk->size = chunk->mem_size / UNIV_PAGE_SIZE
- 		- (frame != chunk->mem);
-+	}
- 
- 	/* Subtract the space needed for block descriptors. */
- 	{
-@@ -810,6 +1046,102 @@
+@@ -814,6 +816,10 @@
  		chunk->size = size;
  	}
  
@@ -309,404 +28,51 @@ diff -ruN a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0
 +		chunk->size = size_target;
 +	}
 +
-+	if (shm_info && !(shm_info->is_new)) {
-+		/* convert the shared memory segment for reuse */
-+		ptrdiff_t	phys_offset;
-+		ptrdiff_t	logi_offset;
-+		ptrdiff_t	blocks_offset;
-+		void*		previous_frame_address;
-+
-+		if (chunk->size < shm_info->chunk_backup.size) {
-+			fprintf(stderr,
-+			"InnoDB: Error: The buffer pool became smaller because of allocated address.\n"
-+			"InnoDB: Retrying may avoid this situation.\n");
-+			shm_info->clean = TRUE; /* release the flag for retrying */
-+			return(NULL);
-+		}
-+
-+		chunk->size = shm_info->chunk_backup.size;
-+		phys_offset = frame - ((byte*)chunk->mem + shm_info->frame_offset);
-+		logi_offset = frame - chunk->blocks[0].frame;
-+		previous_frame_address = chunk->blocks[0].frame;
-+		blocks_offset = (byte*)chunk->blocks - (byte*)shm_info->chunk_backup.blocks;
-+
-+		if (phys_offset || logi_offset || blocks_offset) {
-+			fprintf(stderr,
-+			"InnoDB: Buffer pool in the shared memory segment should be converted.\n"
-+			"InnoDB: Previous frames in address      : %p\n"
-+			"InnoDB: Previous frames were located    : %p\n"
-+			"InnoDB: Current frames should be located: %p\n"
-+			"InnoDB: Pysical offset                  : %ld (%#lx)\n"
-+			"InnoDB: Logical offset (frames)         : %ld (%#lx)\n"
-+			"InnoDB: Logical offset (blocks)         : %ld (%#lx)\n",
-+				(byte*)chunk->mem + shm_info->frame_offset,
-+				chunk->blocks[0].frame, frame,
-+				phys_offset, phys_offset, logi_offset, logi_offset,
-+				blocks_offset, blocks_offset);
-+		} else {
-+			fprintf(stderr,
-+			"InnoDB: Buffer pool in the shared memory segment can be used as it is.\n");
-+		}
-+
-+		if (phys_offset) {
-+			fprintf(stderr,
-+			"InnoDB: Aligning physical offset...");
-+
-+			memmove(frame, (byte*)chunk->mem + shm_info->frame_offset,
-+				chunk->size * UNIV_PAGE_SIZE);
-+
-+			fprintf(stderr,
-+			" Done.\n");
-+		}
-+
-+		/* buf_block_t */
-+		block = chunk->blocks;
-+		for (i = chunk->size; i--; ) {
-+			buf_block_reuse(block, logi_offset);
-+			block++;
-+		}
-+
-+		if (logi_offset || blocks_offset) {
-+			fprintf(stderr,
-+			"InnoDB: Aligning logical offset...");
-+
-+
-+			/* buf_pool_t buf_pool_backup */
-+			UT_LIST_OFFSET(flush_list, buf_page_t, shm_info->buf_pool_backup.flush_list,
-+					previous_frame_address, logi_offset, blocks_offset);
-+			UT_LIST_OFFSET(free, buf_page_t, shm_info->buf_pool_backup.free,
-+					previous_frame_address, logi_offset, blocks_offset);
-+			UT_LIST_OFFSET(LRU, buf_page_t, shm_info->buf_pool_backup.LRU,
-+					previous_frame_address, logi_offset, blocks_offset);
-+			if (shm_info->buf_pool_backup.LRU_old)
-+				shm_info->buf_pool_backup.LRU_old =
-+					(buf_page_t*)((byte*)(shm_info->buf_pool_backup.LRU_old)
-+						+ (((void*)shm_info->buf_pool_backup.LRU_old > previous_frame_address)
-+						  ? logi_offset : blocks_offset));
-+
-+			UT_LIST_OFFSET(unzip_LRU, buf_block_t, shm_info->buf_pool_backup.unzip_LRU,
-+					previous_frame_address, logi_offset, blocks_offset);
-+
-+			UT_LIST_OFFSET(zip_list, buf_page_t, shm_info->buf_pool_backup.zip_clean,
-+					previous_frame_address, logi_offset, blocks_offset);
-+			for (i = 0; i < BUF_BUDDY_SIZES_MAX; i++) {
-+				UT_LIST_OFFSET(zip_list, buf_page_t, shm_info->buf_pool_backup.zip_free[i],
-+					previous_frame_address, logi_offset, blocks_offset);
-+			}
-+
-+			HASH_OFFSET(zip_hash_tmp, buf_page_t, hash,
-+					previous_frame_address, logi_offset, blocks_offset);
-+
-+			fprintf(stderr,
-+			" Done.\n");
-+		}
-+	} else {
  	/* Init block structs and assign frames for them. Then we
  	assign the frames to the first blocks (we already mapped the
  	memory above). */
-@@ -833,6 +1165,11 @@
- 		block++;
- 		frame += UNIV_PAGE_SIZE;
- 	}
-+	}
-+
-+	if (shm_info) {
-+		shm_info->frame_offset = chunk->blocks[0].frame - (byte*)chunk->mem;
-+	}
- 
- 	return(chunk);
- }
-@@ -1014,6 +1351,8 @@
- 		UNIV_MEM_UNDESC(block);
- 	}
- 
-+	ut_a(!srv_buffer_pool_shm_key);
-+
- 	os_mem_free_large(chunk->mem, chunk->mem_size);
- }
- 
-@@ -1063,7 +1402,10 @@
- 	srv_buf_pool_curr_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
- 
- 	buf_pool->page_hash = hash_create(2 * buf_pool->curr_size);
-+	/* zip_hash is allocated to shm when srv_buffer_pool_shm_key is enabled */
-+	if (!srv_buffer_pool_shm_key) {
- 	buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size);
-+	}
- 
- 	buf_pool->last_printout_time = time(NULL);
- 
-@@ -1078,6 +1420,86 @@
- 	--------------------------- */
- 	/* All fields are initialized by mem_zalloc(). */
- 
-+	if (srv_buffer_pool_shm_key) {
-+		buf_shm_info_t*	shm_info;
-+
-+		ut_a((byte*)chunk->blocks == (byte*)chunk->mem + sizeof(buf_shm_info_t));
-+		shm_info = chunk->mem;
-+
-+		buf_pool->zip_hash = (hash_table_t*)((byte*)chunk->mem + shm_info->zip_hash_offset);
-+
-+		if(shm_info->is_new) {
-+			shm_info->is_new = FALSE; /* initialization was finished */
-+		} else {
-+			buf_block_t*	block = chunk->blocks;
-+			buf_page_t*	b;
-+
-+			/* shm_info->buf_pool_backup should be converted */
-+			/* at buf_chunk_init(). So copy simply. */
-+			buf_pool->flush_list 		= shm_info->buf_pool_backup.flush_list;
-+			buf_pool->freed_page_clock 	= shm_info->buf_pool_backup.freed_page_clock;
-+			buf_pool->free			= shm_info->buf_pool_backup.free;
-+			buf_pool->LRU			= shm_info->buf_pool_backup.LRU;
-+			buf_pool->LRU_old		= shm_info->buf_pool_backup.LRU_old;
-+			buf_pool->LRU_old_len		= shm_info->buf_pool_backup.LRU_old_len;
-+			buf_pool->unzip_LRU		= shm_info->buf_pool_backup.unzip_LRU;
-+			buf_pool->zip_clean		= shm_info->buf_pool_backup.zip_clean;
-+			for (i = 0; i < BUF_BUDDY_SIZES_MAX; i++) {
-+				buf_pool->zip_free[i]	= shm_info->buf_pool_backup.zip_free[i];
-+			}
-+
-+			for (i = 0; i < chunk->size; i++, block++) {
-+				if (buf_block_get_state(block)
-+				    == BUF_BLOCK_FILE_PAGE) {
-+					ut_d(block->page.in_page_hash = TRUE);
-+					HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
-+						    buf_page_address_fold(
-+							    block->page.space,
-+							    block->page.offset),
-+						    &block->page);
-+				}
-+			}
-+
-+			for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b;
-+			     b = UT_LIST_GET_NEXT(zip_list, b)) {
-+				ut_ad(!b->in_flush_list);
-+				ut_ad(b->in_LRU_list);
-+
-+				ut_d(b->in_page_hash = TRUE);
-+				HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
-+					    buf_page_address_fold(b->space, b->offset), b);
-+			}
-+
-+			for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b;
-+			     b = UT_LIST_GET_NEXT(flush_list, b)) {
-+				ut_ad(b->in_flush_list);
-+				ut_ad(b->in_LRU_list);
-+
-+				switch (buf_page_get_state(b)) {
-+				case BUF_BLOCK_ZIP_DIRTY:
-+					ut_d(b->in_page_hash = TRUE);
-+					HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
-+						    buf_page_address_fold(b->space,
-+							    		  b->offset), b);
-+					break;
-+				case BUF_BLOCK_FILE_PAGE:
-+					/* uncompressed page */
-+					break;
-+				case BUF_BLOCK_ZIP_FREE:
-+				case BUF_BLOCK_ZIP_PAGE:
-+				case BUF_BLOCK_NOT_USED:
-+				case BUF_BLOCK_READY_FOR_USE:
-+				case BUF_BLOCK_MEMORY:
-+				case BUF_BLOCK_REMOVE_HASH:
-+					ut_error;
-+					break;
-+				}
-+			}
-+
-+
-+		}
-+	}
-+
- 	mutex_exit(&LRU_list_mutex);
- 	rw_lock_x_unlock(&page_hash_latch);
- 	buf_pool_mutex_exit();
-@@ -1102,6 +1524,34 @@
- 	buf_chunk_t*	chunk;
- 	buf_chunk_t*	chunks;
- 
-+	if (srv_buffer_pool_shm_key) {
-+		buf_shm_info_t*	shm_info;
-+
-+		ut_a(buf_pool->n_chunks == 1);
-+
-+		chunk = buf_pool->chunks;
-+		shm_info = chunk->mem;
-+		ut_a((byte*)chunk->blocks == (byte*)chunk->mem + sizeof(buf_shm_info_t));
-+
-+		/* validation the shared memory segment doesn't have unrecoverable contents. */
-+		/* Currently, validation became not needed */
-+		shm_info->reusable = TRUE;
-+
-+		memcpy(&(shm_info->buf_pool_backup), buf_pool, sizeof(buf_pool_t));
-+		memcpy(&(shm_info->chunk_backup), chunk, sizeof(buf_chunk_t));
-+
-+		if (srv_fast_shutdown < 2) {
-+			if (srv_buffer_pool_shm_checksum) {
-+				shm_info->checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
-+								       chunk->mem_size - sizeof(buf_shm_info_t));
-+			} else {
-+				shm_info->checksum = BUF_NO_CHECKSUM_MAGIC;
-+			}
-+			shm_info->clean = TRUE;
-+		}
-+
-+		os_shm_free(chunk->mem, chunk->mem_size);
-+	} else {
- 	chunks = buf_pool->chunks;
- 	chunk = chunks + buf_pool->n_chunks;
- 
-@@ -1110,10 +1560,13 @@
- 		would fail at shutdown. */
- 		os_mem_free_large(chunk->mem, chunk->mem_size);
- 	}
-+	}
- 
- 	mem_free(buf_pool->chunks);
- 	hash_table_free(buf_pool->page_hash);
-+	if (!srv_buffer_pool_shm_key) {
- 	hash_table_free(buf_pool->zip_hash);
-+	}
- 	mem_free(buf_pool);
- 	buf_pool = NULL;
- }
-@@ -1308,6 +1761,11 @@
- 	//buf_pool_mutex_enter();
- 	mutex_enter(&LRU_list_mutex);
- 
-+	if (srv_buffer_pool_shm_key) {
-+		/* Cannot support shrink */
-+		goto func_done;
-+	}
-+
- shrink_again:
- 	if (buf_pool->n_chunks <= 1) {
- 
-@@ -1551,6 +2009,11 @@
- buf_pool_resize(void)
- /*=================*/
- {
-+	if (srv_buffer_pool_shm_key) {
-+		/* Cannot support resize */
-+		return;
-+	}
-+
- 	//buf_pool_mutex_enter();
- 	mutex_enter(&LRU_list_mutex);
- 
-diff -ruN a/storage/innodb_plugin/ha/hash0hash.c b/storage/innodb_plugin/ha/hash0hash.c
---- a/storage/innodb_plugin/ha/hash0hash.c	2010-06-04 00:49:59.000000000 +0900
-+++ b/storage/innodb_plugin/ha/hash0hash.c	2010-07-14 16:40:16.150438366 +0900
-@@ -128,6 +128,70 @@
- }
- 
- /*************************************************************//**
-+*/
-+UNIV_INTERN
-+ulint
-+hash_create_needed(
-+/*===============*/
-+	ulint	n)
-+{
-+	ulint	prime;
-+	ulint	offset;
-+
-+	prime = ut_find_prime(n);
-+
-+	offset = (sizeof(hash_table_t) + 7) / 8;
-+	offset *= 8;
-+
-+	return(offset + sizeof(hash_cell_t) * prime);
-+}
-+
-+UNIV_INTERN
-+void
-+hash_create_init(
-+/*=============*/
-+	hash_table_t*	table,
-+	ulint		n)
-+{
-+	ulint	prime;
-+	ulint	offset;
-+
-+	prime = ut_find_prime(n);
-+
-+	offset = (sizeof(hash_table_t) + 7) / 8;
-+	offset *= 8;
-+
-+	table->array = (hash_cell_t*)(((byte*)table) + offset);
-+	table->n_cells = prime;
-+# if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
-+	table->adaptive = FALSE;
-+# endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
-+	table->n_mutexes = 0;
-+	table->mutexes = NULL;
-+	table->heaps = NULL;
-+	table->heap = NULL;
-+	ut_d(table->magic_n = HASH_TABLE_MAGIC_N);
-+
-+	/* Initialize the cell array */
-+	hash_table_clear(table);
-+}
-+
-+UNIV_INTERN
-+void
-+hash_create_reuse(
-+/*==============*/
-+	hash_table_t*	table)
-+{
-+	ulint	offset;
-+
-+	offset = (sizeof(hash_table_t) + 7) / 8;
-+	offset *= 8;
-+
-+	table->array = (hash_cell_t*)(((byte*)table) + offset);
-+	ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
-+}
-+
-+/*************************************************************//**
- Frees a hash table. */
- UNIV_INTERN
- void
-diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
---- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-07-14 16:34:18.597725479 +0900
-+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-07-14 16:40:16.159323612 +0900
-@@ -198,6 +198,7 @@
+--- a/storage/innodb_plugin/handler/ha_innodb.cc
++++ b/storage/innodb_plugin/handler/ha_innodb.cc
+@@ -198,6 +198,8 @@
  static my_bool	innobase_create_status_file		= FALSE;
  static my_bool	innobase_stats_on_metadata		= TRUE;
  static my_bool	innobase_use_sys_stats_table		= FALSE;
 +static my_bool	innobase_buffer_pool_shm_checksum	= TRUE;
++static uint	innobase_buffer_pool_shm_key		= 0;
  
  static char*	internal_innobase_data_file_path	= NULL;
  
-@@ -2476,6 +2477,7 @@
- 	srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
- 	srv_use_checksums = (ibool) innobase_use_checksums;
- 	srv_fast_checksum = (ibool) innobase_fast_checksum;
-+	srv_buffer_pool_shm_checksum = (ibool) innobase_buffer_pool_shm_checksum;
+@@ -2460,6 +2462,12 @@
+ 
+ 	srv_buf_pool_size = (ulint) innobase_buffer_pool_size;
  
- #ifdef HAVE_LARGE_PAGES
-         if ((os_use_large_pages = (ibool) my_use_large_pages))
-@@ -11476,6 +11478,16 @@
++	if (innobase_buffer_pool_shm_key) {
++		fprintf(stderr,
++			"InnoDB: Warning: innodb_buffer_pool_shm_key is deprecated function.\n"
++			"InnoDB:          innodb_buffer_pool_shm_key was ignored.\n");
++	}
++
+ 	srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
+ 
+ 	srv_n_file_io_threads = (ulint) innobase_file_io_threads;
+@@ -11472,6 +11480,16 @@
    "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
    NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
  
-+static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, srv_buffer_pool_shm_key,
++static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, innobase_buffer_pool_shm_key,
 +  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
-+  "[experimental] The key value of shared memory segment for the buffer pool. 0 (default) disables the feature.",
++  "[Deprecated option] no effect",
 +  NULL, NULL, 0, 0, INT_MAX32, 0);
 +
 +static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum,
 +  PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
-+  "Enable buffer_pool_shm checksum validation (enabled by default).",
++  "[Deprecated option] no effect",
 +  NULL, NULL, TRUE);
 +
  static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
    PLUGIN_VAR_RQCMDARG,
    "Helps in performance tuning in heavily concurrent environments.",
-@@ -11764,6 +11776,8 @@
+@@ -11760,6 +11778,8 @@
    MYSQL_SYSVAR(additional_mem_pool_size),
    MYSQL_SYSVAR(autoextend_increment),
    MYSQL_SYSVAR(buffer_pool_size),
@@ -715,428 +81,21 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
    MYSQL_SYSVAR(checksums),
    MYSQL_SYSVAR(fast_checksum),
    MYSQL_SYSVAR(commit_concurrency),
-diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
---- a/storage/innodb_plugin/handler/innodb_patch_info.h	2010-07-14 16:34:18.603733950 +0900
-+++ b/storage/innodb_plugin/handler/innodb_patch_info.h	2010-07-14 16:40:16.164323927 +0900
-@@ -47,5 +47,6 @@
- {"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
- {"innodb_files_extend","allow >4GB transaction log files, and can vary universal page size of datafiles","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
- {"innodb_sys_tables_sys_indexes","Expose InnoDB SYS_TABLES and SYS_INDEXES schema tables","","http://www.percona.com/docs/wiki/percona-xtradb"},
-+{"innodb_buffer_pool_shm","Put buffer pool contents to shared memory segment and reuse it at clean restart [experimental]","","http://www.percona.com/docs/wiki/percona-xtradb"},
- {NULL, NULL, NULL, NULL}
- };
-diff -ruN a/storage/innodb_plugin/include/buf0buf.h b/storage/innodb_plugin/include/buf0buf.h
---- a/storage/innodb_plugin/include/buf0buf.h	2010-07-14 16:33:23.823323393 +0900
-+++ b/storage/innodb_plugin/include/buf0buf.h	2010-07-14 16:40:16.166323436 +0900
-@@ -36,6 +36,7 @@
- #include "ut0rbt.h"
- #ifndef UNIV_HOTBACKUP
- #include "os0proc.h"
-+#include "srv0srv.h"
- 
- /** @name Modes for buf_page_get_gen */
- /* @{ */
-@@ -1302,7 +1303,10 @@
- /**********************************************************************//**
- Compute the hash fold value for blocks in buf_pool->zip_hash. */
- /* @{ */
--#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / UNIV_PAGE_SIZE)
-+/* the fold should be relative when srv_buffer_pool_shm_key is enabled */
-+#define BUF_POOL_ZIP_FOLD_PTR(ptr) (!srv_buffer_pool_shm_key\
-+					?((ulint) (ptr) / UNIV_PAGE_SIZE)\
-+					:((ulint) ((byte*)ptr - (byte*)(buf_pool->chunks->blocks->frame)) / UNIV_PAGE_SIZE))
- #define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame)
- #define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b))
- /* @} */
-diff -ruN a/storage/innodb_plugin/include/hash0hash.h b/storage/innodb_plugin/include/hash0hash.h
---- a/storage/innodb_plugin/include/hash0hash.h	2010-06-04 00:49:59.000000000 +0900
-+++ b/storage/innodb_plugin/include/hash0hash.h	2010-07-14 16:40:16.168323262 +0900
-@@ -49,6 +49,28 @@
- hash_create(
- /*========*/
- 	ulint	n);	/*!< in: number of array cells */
-+
-+/*************************************************************//**
-+*/
-+UNIV_INTERN
-+ulint
-+hash_create_needed(
-+/*===============*/
-+	ulint	n);
+--- /dev/null
++++ b/mysql-test/r/percona_innodb_buffer_pool_shm.result
+@@ -0,0 +1,4 @@
++show variables like 'innodb_buffer_pool_shm%';
++Variable_name	Value
++innodb_buffer_pool_shm_checksum	ON
++innodb_buffer_pool_shm_key	123456
+--- /dev/null
++++ b/mysql-test/t/percona_innodb_buffer_pool_shm-master.opt
+@@ -0,0 +1,2 @@
++--innodb_buffer_pool_shm_key=123456
++--innodb=FORCE
+--- /dev/null
++++ b/mysql-test/t/percona_innodb_buffer_pool_shm.test
+@@ -0,0 +1,3 @@
++--source include/have_innodb.inc
++show variables like 'innodb_buffer_pool_shm%';
 +
-+UNIV_INTERN
-+void
-+hash_create_init(
-+/*=============*/
-+	hash_table_t*	table,
-+	ulint		n);
-+
-+UNIV_INTERN
-+void
-+hash_create_reuse(
-+/*==============*/
-+	hash_table_t*	table);
-+
- #ifndef UNIV_HOTBACKUP
- /*************************************************************//**
- Creates a mutex array to protect a hash table. */
-@@ -327,6 +349,33 @@
- 		}\
- 	}\
- } while (0)
-+
-+/********************************************************************//**
-+Align nodes with moving location.*/
-+#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \
-+do {\
-+	ulint		i2222;\
-+	ulint		cell_count2222;\
-+\
-+	cell_count2222 = hash_get_n_cells(TABLE);\
-+\
-+	for (i2222 = 0; i2222 < cell_count2222; i2222++) {\
-+		NODE_TYPE*	node2222;\
-+\
-+		if ((TABLE)->array[i2222].node) \
-+			(TABLE)->array[i2222].node = (void*)((byte*)(TABLE)->array[i2222].node \
-+			+ (((TABLE)->array[i2222].node > (void*)FADDR)?FOFFSET:BOFFSET));\
-+		node2222 = HASH_GET_FIRST((TABLE), i2222);\
-+\
-+		while (node2222) {\
-+			if (node2222->PTR_NAME) \
-+				node2222->PTR_NAME = (void*)((byte*)(node2222->PTR_NAME) \
-+				+ ((((void*)node2222->PTR_NAME) > (void*)FADDR)?FOFFSET:BOFFSET));\
-+\
-+			node2222 = node2222->PTR_NAME;\
-+		}\
-+	}\
-+} while (0)
- 
- /************************************************************//**
- Gets the mutex index for a fold value in a hash table.
-diff -ruN a/storage/innodb_plugin/include/os0proc.h b/storage/innodb_plugin/include/os0proc.h
---- a/storage/innodb_plugin/include/os0proc.h	2010-06-04 00:49:59.000000000 +0900
-+++ b/storage/innodb_plugin/include/os0proc.h	2010-07-14 16:40:16.169321536 +0900
-@@ -32,6 +32,11 @@
- #ifdef UNIV_LINUX
- #include <sys/ipc.h>
- #include <sys/shm.h>
-+#else
-+# if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
-+#include <sys/ipc.h>
-+#include <sys/shm.h>
-+# endif
- #endif
- 
- typedef void*			os_process_t;
-@@ -70,6 +75,29 @@
- 	ulint	size);			/*!< in: size returned by
- 					os_mem_alloc_large() */
- 
-+
-+/****************************************************************//**
-+Allocates or attaches and reuses shared memory segment.
-+The content is not cleared automatically.
-+ at return	allocated memory */
-+UNIV_INTERN
-+void*
-+os_shm_alloc(
-+/*=========*/
-+	ulint*	n,			/*!< in/out: number of bytes */
-+	uint	key,
-+	ibool*	is_new);
-+
-+/****************************************************************//**
-+Detach shared memory segment. */
-+UNIV_INTERN
-+void
-+os_shm_free(
-+/*========*/
-+	void	*ptr,			/*!< in: pointer returned by
-+					os_shm_alloc() */
-+	ulint	size);			/*!< in: size returned by
-+					os_shm_alloc() */
- #ifndef UNIV_NONINL
- #include "os0proc.ic"
- #endif
-diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
---- a/storage/innodb_plugin/include/srv0srv.h	2010-07-14 16:32:49.695323045 +0900
-+++ b/storage/innodb_plugin/include/srv0srv.h	2010-07-14 16:40:16.171325784 +0900
-@@ -156,6 +156,10 @@
- extern ulint	srv_mem_pool_size;
- extern ulint	srv_lock_table_size;
- 
-+extern uint	srv_buffer_pool_shm_key;
-+extern ibool	srv_buffer_pool_shm_is_reused;
-+extern ibool	srv_buffer_pool_shm_checksum;
-+
- extern ibool	srv_thread_concurrency_timer_based;
- 
- extern ulint	srv_n_file_io_threads;
-diff -ruN a/storage/innodb_plugin/include/ut0lst.h b/storage/innodb_plugin/include/ut0lst.h
---- a/storage/innodb_plugin/include/ut0lst.h	2010-06-04 00:49:59.000000000 +0900
-+++ b/storage/innodb_plugin/include/ut0lst.h	2010-07-14 16:40:16.172321547 +0900
-@@ -257,5 +257,48 @@
- 	ut_a(ut_list_node_313 == NULL);					\
- } while (0)
- 
-+/********************************************************************//**
-+Align nodes with moving location.
-+ at param NAME		the name of the list
-+ at param TYPE		node type
-+ at param BASE		base node (not a pointer to it)
-+ at param OFFSET		offset moved */
-+#define UT_LIST_OFFSET(NAME, TYPE, BASE, FADDR, FOFFSET, BOFFSET)	\
-+do {									\
-+	ulint	ut_list_i_313;						\
-+	TYPE*	ut_list_node_313;					\
-+									\
-+	if ((BASE).start)						\
-+		(BASE).start = (void*)((byte*)((BASE).start)			\
-+			+ (((void*)((BASE).start) > (void*)FADDR)?FOFFSET:BOFFSET));\
-+	if ((BASE).end)							\
-+		(BASE).end   = (void*)((byte*)((BASE).end)			\
-+			+ (((void*)((BASE).end) > (void*)FADDR)?FOFFSET:BOFFSET));\
-+									\
-+	ut_list_node_313 = (BASE).start;				\
-+									\
-+	for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) {		\
-+		ut_a(ut_list_node_313);					\
-+		if ((ut_list_node_313->NAME).prev)			\
-+			(ut_list_node_313->NAME).prev = (void*)((byte*)((ut_list_node_313->NAME).prev)\
-+				+ (((void*)((ut_list_node_313->NAME).prev) > (void*)FADDR)?FOFFSET:BOFFSET));\
-+		if ((ut_list_node_313->NAME).next)			\
-+			(ut_list_node_313->NAME).next =	(void*)((byte*)((ut_list_node_313->NAME).next)\
-+				+ (((void*)((ut_list_node_313->NAME).next)> (void*)FADDR)?FOFFSET:BOFFSET));\
-+		ut_list_node_313 = (ut_list_node_313->NAME).next;	\
-+	}								\
-+									\
-+	ut_a(ut_list_node_313 == NULL);					\
-+									\
-+	ut_list_node_313 = (BASE).end;					\
-+									\
-+	for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) {		\
-+		ut_a(ut_list_node_313);					\
-+		ut_list_node_313 = (ut_list_node_313->NAME).prev;	\
-+	}								\
-+									\
-+	ut_a(ut_list_node_313 == NULL);					\
-+} while (0)
-+
- #endif
- 
-diff -ruN a/storage/innodb_plugin/log/log0recv.c b/storage/innodb_plugin/log/log0recv.c
---- a/storage/innodb_plugin/log/log0recv.c	2010-10-01 15:25:27.106299166 +0900
-+++ b/storage/innodb_plugin/log/log0recv.c	2010-10-01 15:26:33.689261436 +0900
-@@ -2899,6 +2899,7 @@
- /*==========================*/
- {
- 	ut_a(!recv_needed_recovery);
-+	ut_a(!srv_buffer_pool_shm_is_reused);
- 
- 	recv_needed_recovery = TRUE;
- 
-diff -ruN a/storage/innodb_plugin/os/os0proc.c b/storage/innodb_plugin/os/os0proc.c
---- a/storage/innodb_plugin/os/os0proc.c	2010-06-04 00:49:59.000000000 +0900
-+++ b/storage/innodb_plugin/os/os0proc.c	2010-07-14 16:40:16.174322953 +0900
-@@ -229,3 +229,173 @@
- 	}
- #endif
- }
-+
-+/****************************************************************//**
-+Allocates or attaches and reuses shared memory segment.
-+The content is not cleared automatically.
-+ at return	allocated memory */
-+UNIV_INTERN
-+void*
-+os_shm_alloc(
-+/*=========*/
-+	ulint*	n,			/*!< in/out: number of bytes */
-+	uint	key,
-+	ibool*	is_new)
-+{
-+	void*	ptr;
-+#if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
-+	ulint	size;
-+	int	shmid;
-+
-+	*is_new = FALSE;
-+	fprintf(stderr,
-+		"InnoDB: The shared memory segment containing the buffer pool is: key  %#x (%d).\n",
-+		key, key);
-+# if defined HAVE_LARGE_PAGES && defined UNIV_LINUX
-+	if (!os_use_large_pages || !os_large_page_size) {
-+		goto skip;
-+	}
-+
-+	/* Align block size to os_large_page_size */
-+	ut_ad(ut_is_2pow(os_large_page_size));
-+	size = ut_2pow_round(*n + (os_large_page_size - 1),
-+			     os_large_page_size);
-+
-+	shmid = shmget((key_t)key, (size_t)size,
-+			IPC_CREAT | IPC_EXCL | SHM_HUGETLB | SHM_R | SHM_W);
-+	if (shmid < 0) {
-+		if (errno == EEXIST) {
-+			fprintf(stderr,
-+				"InnoDB: HugeTLB: The shared memory segment exists.\n");
-+			shmid = shmget((key_t)key, (size_t)size,
-+					SHM_HUGETLB | SHM_R | SHM_W);
-+			if (shmid < 0) {
-+				fprintf(stderr,
-+					"InnoDB: HugeTLB: Warning: Failed to allocate %lu bytes. (reuse) errno %d\n",
-+					size, errno);
-+				goto skip;
-+			} else {
-+				fprintf(stderr,
-+					"InnoDB: HugeTLB: The existent shared memory segment is used.\n");
-+			}
-+		} else {
-+			fprintf(stderr,
-+				"InnoDB: HugeTLB: Warning: Failed to allocate %lu bytes. (new) errno %d\n",
-+				size, errno);
-+			goto skip;
-+		}
-+	} else {
-+		*is_new = TRUE;
-+		fprintf(stderr,
-+			"InnoDB: HugeTLB: A new shared memory segment has been created .\n");
-+	}
-+
-+	ptr = shmat(shmid, NULL, 0);
-+	if (ptr == (void *)-1) {
-+		fprintf(stderr,
-+			"InnoDB: HugeTLB: Warning: Failed to attach shared memory segment, errno %d\n",
-+			errno);
-+		ptr = NULL;
-+	}
-+
-+	if (ptr) {
-+		*n = size;
-+		os_fast_mutex_lock(&ut_list_mutex);
-+		ut_total_allocated_memory += size;
-+		os_fast_mutex_unlock(&ut_list_mutex);
-+		UNIV_MEM_ALLOC(ptr, size);
-+		return(ptr);
-+	}
-+skip:
-+	*is_new = FALSE;
-+# endif /* HAVE_LARGE_PAGES && defined UNIV_LINUX */
-+# ifdef HAVE_GETPAGESIZE
-+	size = getpagesize();
-+# else
-+	size = UNIV_PAGE_SIZE;
-+# endif
-+	/* Align block size to system page size */
-+	ut_ad(ut_is_2pow(size));
-+	size = *n = ut_2pow_round(*n + (size - 1), size);
-+
-+	shmid = shmget((key_t)key, (size_t)size,
-+			IPC_CREAT | IPC_EXCL | SHM_R | SHM_W);
-+	if (shmid < 0) {
-+		if (errno == EEXIST) {
-+			fprintf(stderr,
-+				"InnoDB: A shared memory segment containing the buffer pool seems to already exist.\n");
-+			shmid = shmget((key_t)key, (size_t)size,
-+					SHM_R | SHM_W);
-+			if (shmid < 0) {
-+				fprintf(stderr,
-+					"InnoDB: Warning: Failed to allocate %lu bytes. (reuse) errno %d\n",
-+					size, errno);
-+				ptr = NULL;
-+				goto end;
-+			} else {
-+				fprintf(stderr,
-+					"InnoDB: The existent shared memory segment is used.\n");
-+			}
-+		} else {
-+			fprintf(stderr,
-+				"InnoDB: Warning: Failed to allocate %lu bytes. (new) errno %d\n",
-+				size, errno);
-+			ptr = NULL;
-+			goto end;
-+		}
-+	} else {
-+		*is_new = TRUE;
-+		fprintf(stderr,
-+			"InnoDB: A new shared memory segment has been created.\n");
-+	}
-+
-+	ptr = shmat(shmid, NULL, 0);
-+	if (ptr == (void *)-1) {
-+		fprintf(stderr,
-+			"InnoDB: Warning: Failed to attach shared memory segment, errno %d\n",
-+			errno);
-+		ptr = NULL;
-+	}
-+
-+	if (ptr) {
-+		*n = size;
-+		os_fast_mutex_lock(&ut_list_mutex);
-+		ut_total_allocated_memory += size;
-+		os_fast_mutex_unlock(&ut_list_mutex);
-+		UNIV_MEM_ALLOC(ptr, size);
-+	}
-+end:
-+#else /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
-+	fprintf(stderr, "InnoDB: shared memory segment is not supported.\n");
-+	ptr = NULL;
-+#endif /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
-+	return(ptr);
-+}
-+
-+/****************************************************************//**
-+Detach shared memory segment. */
-+UNIV_INTERN
-+void
-+os_shm_free(
-+/*========*/
-+	void	*ptr,			/*!< in: pointer returned by
-+					os_shm_alloc() */
-+	ulint	size)			/*!< in: size returned by
-+					os_shm_alloc() */
-+{
-+	os_fast_mutex_lock(&ut_list_mutex);
-+	ut_a(ut_total_allocated_memory >= size);
-+	os_fast_mutex_unlock(&ut_list_mutex);
-+
-+#if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
-+	if (!shmdt(ptr)) {
-+		os_fast_mutex_lock(&ut_list_mutex);
-+		ut_a(ut_total_allocated_memory >= size);
-+		ut_total_allocated_memory -= size;
-+		os_fast_mutex_unlock(&ut_list_mutex);
-+		UNIV_MEM_FREE(ptr, size);
-+	}
-+#else /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
-+	fprintf(stderr, "InnoDB: shared memory segment is not supported.\n");
-+#endif /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
-+}
-diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
---- a/storage/innodb_plugin/srv/srv0srv.c	2010-07-14 16:33:23.848391648 +0900
-+++ b/storage/innodb_plugin/srv/srv0srv.c	2010-07-14 16:40:16.177323553 +0900
-@@ -211,6 +211,11 @@
- UNIV_INTERN ulint	srv_mem_pool_size	= ULINT_MAX;
- UNIV_INTERN ulint	srv_lock_table_size	= ULINT_MAX;
- 
-+/* key value for shm */
-+UNIV_INTERN uint	srv_buffer_pool_shm_key	= 0;
-+UNIV_INTERN ibool	srv_buffer_pool_shm_is_reused = FALSE;
-+UNIV_INTERN ibool	srv_buffer_pool_shm_checksum = TRUE;
-+
- /* This parameter is deprecated. Use srv_n_io_[read|write]_threads
- instead. */
- UNIV_INTERN ulint	srv_n_file_io_threads	= ULINT_MAX;
-diff -ruN a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
---- a/storage/innodb_plugin/srv/srv0start.c	2010-07-14 16:33:23.851391514 +0900
-+++ b/storage/innodb_plugin/srv/srv0start.c	2010-07-14 16:40:16.180321173 +0900
-@@ -1750,6 +1750,8 @@
- 		Note that this is not as heavy weight as it seems. At
- 		this point there will be only ONE page in the buf_LRU
- 		and there must be no page in the buf_flush list. */
-+		/* buffer_pool_shm should not be reused when recovery was needed. */
-+		if (!srv_buffer_pool_shm_is_reused)
- 		buf_pool_invalidate();
- 
- 		/* We always try to do a recovery, even if the database had
diff --git a/mysql-innodb_bug60788.patch b/mysql-innodb_bug60788.patch
index 2ce33e7..f5a7610 100644
--- a/mysql-innodb_bug60788.patch
+++ b/mysql-innodb_bug60788.patch
@@ -7,10 +7,9 @@
 # Changes InnoDB IO code so that fsync(), pread() and pwrite() are restarted
 # when interrupted by a signal.
 #
-diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0file.c
---- a/storage/innodb_plugin/os/os0file.c	2011-04-18 13:21:07.000000000 +0400
-+++ b/storage/innodb_plugin/os/os0file.c	2011-04-18 17:38:21.000000000 +0400
-@@ -1978,6 +1978,9 @@
+--- a/storage/innodb_plugin/os/os0file.c
++++ b/storage/innodb_plugin/os/os0file.c
+@@ -1988,6 +1988,9 @@
  			failures++;
  
  			retry = TRUE;
@@ -20,7 +19,7 @@ diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0fil
  		} else {
  
  			retry = FALSE;
-@@ -2109,6 +2112,7 @@
+@@ -2120,6 +2123,7 @@
  	off_t	offs;
  #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD)
  	ssize_t	n_bytes;
@@ -28,7 +27,7 @@ diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0fil
  #endif /* HAVE_PREAD && !HAVE_BROKEN_PREAD */
  	ulint		sec;
  	ulint		ms;
-@@ -2149,7 +2153,18 @@
+@@ -2160,7 +2164,18 @@
  	os_n_pending_reads++;
  	os_mutex_exit(os_file_count_mutex);
  
@@ -48,7 +47,7 @@ diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0fil
  
  	os_mutex_enter(os_file_count_mutex);
  	os_file_n_pending_preads--;
-@@ -2168,6 +2183,7 @@
+@@ -2179,6 +2194,7 @@
  	{
  		off_t	ret_offset;
  		ssize_t	ret;
@@ -56,7 +55,7 @@ diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0fil
  #ifndef UNIV_HOTBACKUP
  		ulint	i;
  #endif /* !UNIV_HOTBACKUP */
-@@ -2188,7 +2204,17 @@
+@@ -2199,7 +2215,17 @@
  		if (ret_offset < 0) {
  			ret = -1;
  		} else {
@@ -75,7 +74,7 @@ diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0fil
  		}
  
  #ifndef UNIV_HOTBACKUP
-@@ -2227,6 +2253,7 @@
+@@ -2238,6 +2264,7 @@
  				offset */
  {
  	ssize_t	ret;
@@ -83,7 +82,7 @@ diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0fil
  	off_t	offs;
  
  	ut_a((offset & 0xFFFFFFFFUL) == offset);
-@@ -2254,7 +2281,18 @@
+@@ -2265,7 +2292,18 @@
  	os_n_pending_writes++;
  	os_mutex_exit(os_file_count_mutex);
  
@@ -103,7 +102,7 @@ diff -ruN a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0fil
  
  	os_mutex_enter(os_file_count_mutex);
  	os_file_n_pending_pwrites--;
-@@ -2301,7 +2339,17 @@
+@@ -2312,7 +2350,17 @@
  			goto func_exit;
  		}
  
diff --git a/mysql-innodb_deadlock_count.patch b/mysql-innodb_deadlock_count.patch
index ae4d902..86723f3 100644
--- a/mysql-innodb_deadlock_count.patch
+++ b/mysql-innodb_deadlock_count.patch
@@ -5,9 +5,8 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
---- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-10 15:32:14.468241191 +0400
-+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-10 15:32:14.926992081 +0400
+--- a/storage/innodb_plugin/handler/ha_innodb.cc
++++ b/storage/innodb_plugin/handler/ha_innodb.cc
 @@ -566,6 +566,8 @@
    (char*) &export_vars.innodb_data_written,		  SHOW_LONG},
    {"dblwr_pages_written",
@@ -17,9 +16,8 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
    {"dblwr_writes",
    (char*) &export_vars.innodb_dblwr_writes,		  SHOW_LONG},
    {"dict_tables",
-diff -ruN a/storage/innodb_plugin/include/lock0lock.h b/storage/innodb_plugin/include/lock0lock.h
---- a/storage/innodb_plugin/include/lock0lock.h	2010-08-10 15:32:14.478241628 +0400
-+++ b/storage/innodb_plugin/include/lock0lock.h	2010-08-10 15:32:14.926992081 +0400
+--- a/storage/innodb_plugin/include/lock0lock.h
++++ b/storage/innodb_plugin/include/lock0lock.h
 @@ -43,6 +43,7 @@
  #endif /* UNIV_DEBUG */
  /* Buffer for storing information about the most recent deadlock error */
@@ -28,9 +26,8 @@ diff -ruN a/storage/innodb_plugin/include/lock0lock.h b/storage/innodb_plugin/in
  
  /*********************************************************************//**
  Gets the size of a lock struct.
-diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
---- a/storage/innodb_plugin/include/srv0srv.h	2010-08-10 15:32:14.478241628 +0400
-+++ b/storage/innodb_plugin/include/srv0srv.h	2010-08-10 15:32:14.936991959 +0400
+--- a/storage/innodb_plugin/include/srv0srv.h
++++ b/storage/innodb_plugin/include/srv0srv.h
 @@ -689,6 +689,7 @@
  	ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */
  	ulint innodb_buffer_pool_read_ahead;	/*!< srv_read_ahead */
@@ -39,9 +36,8 @@ diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/incl
  	ulint innodb_dblwr_pages_written;	/*!< srv_dblwr_pages_written */
  	ulint innodb_dblwr_writes;		/*!< srv_dblwr_writes */
  	ibool innodb_have_atomic_builtins;	/*!< HAVE_ATOMIC_BUILTINS */
-diff -ruN a/storage/innodb_plugin/lock/lock0lock.c b/storage/innodb_plugin/lock/lock0lock.c
---- a/storage/innodb_plugin/lock/lock0lock.c	2010-08-10 15:32:14.478241628 +0400
-+++ b/storage/innodb_plugin/lock/lock0lock.c	2010-08-10 15:32:14.936991959 +0400
+--- a/storage/innodb_plugin/lock/lock0lock.c
++++ b/storage/innodb_plugin/lock/lock0lock.c
 @@ -3330,6 +3330,7 @@
  		break;
  
@@ -50,9 +46,8 @@ diff -ruN a/storage/innodb_plugin/lock/lock0lock.c b/storage/innodb_plugin/lock/
  		fputs("*** WE ROLL BACK TRANSACTION (2)\n",
  		      lock_latest_err_file);
  		break;
-diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
---- a/storage/innodb_plugin/srv/srv0srv.c	2010-08-10 15:32:14.478241628 +0400
-+++ b/storage/innodb_plugin/srv/srv0srv.c	2010-08-10 15:32:14.936991959 +0400
+--- a/storage/innodb_plugin/srv/srv0srv.c
++++ b/storage/innodb_plugin/srv/srv0srv.c
 @@ -444,7 +444,7 @@
  static ulint	srv_n_rows_updated_old		= 0;
  static ulint	srv_n_rows_deleted_old		= 0;
@@ -71,3 +66,98 @@ diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0
  #ifdef UNIV_DEBUG
  	export_vars.innodb_buffer_pool_pages_latched
  		= buf_get_latched_pages_number();
+--- /dev/null
++++ b/mysql-test/r/percona_innodb_deadlock_count.result
+@@ -0,0 +1,28 @@
++# Establish connection con1 (user=root)
++# Establish connection con2 (user=root)
++# Establish connection con3 (user=root)
++# Drop test table
++drop table if exists t;
++# Create test table
++create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
++# Insert two rows to test table
++insert into t values(2,1);
++insert into t values(1,2);
++# Switch to connection con1
++BEGIN;
++SELECT b FROM t WHERE a=1 FOR UPDATE;
++# Switch to connection con2
++BEGIN;
++SELECT b FROM t WHERE a=2 FOR UPDATE;
++# Switch to connection con1
++SELECT b FROM t WHERE a=2 FOR UPDATE;
++# Switch to connection con2
++SELECT b FROM t WHERE a=1 FOR UPDATE;
++# Switch to connection con1
++ROLLBACK;
++# Switch to connection con2
++ROLLBACK;
++# Switch to connection con3
++Deadlocks: 1
++# Drop test table
++drop table t;
+--- /dev/null
++++ b/mysql-test/t/percona_innodb_deadlock_count.test
+@@ -0,0 +1,61 @@
++--source include/have_innodb.inc
++--echo # Establish connection con1 (user=root)
++connect (con1,localhost,root,,);
++--echo # Establish connection con2 (user=root)
++connect (con2,localhost,root,,);
++--echo # Establish connection con3 (user=root)
++connect (con3,localhost,root,,);
++--echo # Drop test table
++--disable_warnings
++drop table if exists t;
++--enable_warnings
++
++--echo # Create test table
++create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
++--echo # Insert two rows to test table
++insert into t values(2,1);
++insert into t values(1,2);
++
++#--echo # Save current deadlock count
++let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
++
++--disable_result_log
++
++--echo # Switch to connection con1
++connection con1;
++BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;
++
++--echo # Switch to connection con2
++connection con2;
++BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;
++
++--echo # Switch to connection con1
++connection con1;
++SEND SELECT b FROM t WHERE a=2 FOR UPDATE;
++
++--echo # Switch to connection con2
++connection con2;
++SEND SELECT b FROM t WHERE a=1 FOR UPDATE;
++
++--echo # Switch to connection con1
++connection con1;
++--error 0, ER_LOCK_DEADLOCK
++reap;
++ROLLBACK;
++
++--echo # Switch to connection con2
++connection con2;
++--error 0, ER_LOCK_DEADLOCK
++reap;
++ROLLBACK;
++
++--echo # Switch to connection con3
++connection con3;
++let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
++
++--enable_result_log
++
++let $diff = `SELECT $result - $current`;
++echo Deadlocks: $diff;
++--echo # Drop test table
++drop table t;
diff --git a/mysql-innodb_dict_size_limit.patch b/mysql-innodb_dict_size_limit.patch
index 565f7c1..13e3713 100644
--- a/mysql-innodb_dict_size_limit.patch
+++ b/mysql-innodb_dict_size_limit.patch
@@ -5,9 +5,8 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/storage/innodb_plugin/btr/btr0sea.c b/storage/innodb_plugin/btr/btr0sea.c
---- a/storage/innodb_plugin/btr/btr0sea.c	2010-08-04 02:24:19.000000000 +0900
-+++ b/storage/innodb_plugin/btr/btr0sea.c	2010-08-27 16:09:42.926020757 +0900
+--- a/storage/innodb_plugin/btr/btr0sea.c
++++ b/storage/innodb_plugin/btr/btr0sea.c
 @@ -1173,6 +1173,173 @@
  	mem_free(folds);
  }
@@ -182,9 +181,8 @@ diff -ruN a/storage/innodb_plugin/btr/btr0sea.c b/storage/innodb_plugin/btr/btr0
  /********************************************************************//**
  Drops a page hash index when a page is freed from a fseg to the file system.
  Drops possible hash index if the page happens to be in the buffer pool. */
-diff -ruN a/storage/innodb_plugin/dict/dict0boot.c b/storage/innodb_plugin/dict/dict0boot.c
---- a/storage/innodb_plugin/dict/dict0boot.c	2010-08-04 02:24:19.000000000 +0900
-+++ b/storage/innodb_plugin/dict/dict0boot.c	2010-08-27 16:09:42.927104460 +0900
+--- a/storage/innodb_plugin/dict/dict0boot.c
++++ b/storage/innodb_plugin/dict/dict0boot.c
 @@ -283,6 +283,7 @@
  	system tables */
  	/*-------------------------*/
@@ -217,9 +215,8 @@ diff -ruN a/storage/innodb_plugin/dict/dict0boot.c b/storage/innodb_plugin/dict/
  
  	dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0);
  	dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4);
-diff -ruN a/storage/innodb_plugin/dict/dict0crea.c b/storage/innodb_plugin/dict/dict0crea.c
---- a/storage/innodb_plugin/dict/dict0crea.c	2010-08-04 02:24:19.000000000 +0900
-+++ b/storage/innodb_plugin/dict/dict0crea.c	2010-08-27 16:09:42.928062387 +0900
+--- a/storage/innodb_plugin/dict/dict0crea.c
++++ b/storage/innodb_plugin/dict/dict0crea.c
 @@ -1211,6 +1211,9 @@
  		/* Foreign constraint system tables have already been
  		created, and they are ok */
@@ -242,9 +239,8 @@ diff -ruN a/storage/innodb_plugin/dict/dict0crea.c b/storage/innodb_plugin/dict/
  	row_mysql_unlock_data_dictionary(trx);
  
  	trx_free_for_mysql(trx);
-diff -ruN a/storage/innodb_plugin/dict/dict0dict.c b/storage/innodb_plugin/dict/dict0dict.c
---- a/storage/innodb_plugin/dict/dict0dict.c	2010-08-04 02:24:19.000000000 +0900
-+++ b/storage/innodb_plugin/dict/dict0dict.c	2010-08-27 16:09:42.930057360 +0900
+--- a/storage/innodb_plugin/dict/dict0dict.c
++++ b/storage/innodb_plugin/dict/dict0dict.c
 @@ -613,6 +613,8 @@
  
  	table = dict_table_get_on_id_low(table_id);
@@ -340,9 +336,8 @@ diff -ruN a/storage/innodb_plugin/dict/dict0dict.c b/storage/innodb_plugin/dict/
  	/* We always create search info whether or not adaptive
  	hash index is enabled or not. */
  	info = index->search_info;
-diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
---- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-27 16:09:22.832057795 +0900
-+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-27 16:09:42.939059876 +0900
+--- a/storage/innodb_plugin/handler/ha_innodb.cc
++++ b/storage/innodb_plugin/handler/ha_innodb.cc
 @@ -560,6 +560,8 @@
    (char*) &export_vars.innodb_dblwr_pages_written,	  SHOW_LONG},
    {"dblwr_writes",
@@ -352,7 +347,7 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
    {"have_atomic_builtins",
    (char*) &export_vars.innodb_have_atomic_builtins,	  SHOW_BOOL},
    {"log_waits",
-@@ -11390,6 +11392,11 @@
+@@ -11386,6 +11388,11 @@
    "Number of extra user rollback segments when create new database.",
    NULL, NULL, 0, 0, 126, 0);
  
@@ -364,7 +359,7 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
  static struct st_mysql_sys_var* innobase_system_variables[]= {
    MYSQL_SYSVAR(additional_mem_pool_size),
    MYSQL_SYSVAR(autoextend_increment),
-@@ -11458,6 +11465,7 @@
+@@ -11454,6 +11461,7 @@
    MYSQL_SYSVAR(flush_log_at_trx_commit_session),
    MYSQL_SYSVAR(enable_unsafe_group_commit),
    MYSQL_SYSVAR(extra_rsegments),
@@ -372,9 +367,8 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
    MYSQL_SYSVAR(use_sys_malloc),
    MYSQL_SYSVAR(change_buffering),
  #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
-diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
---- a/storage/innodb_plugin/handler/innodb_patch_info.h	2010-08-27 16:09:22.832057795 +0900
-+++ b/storage/innodb_plugin/handler/innodb_patch_info.h	2010-08-27 16:09:42.944058939 +0900
+--- a/storage/innodb_plugin/handler/innodb_patch_info.h
++++ b/storage/innodb_plugin/handler/innodb_patch_info.h
 @@ -32,5 +32,6 @@
  {"innodb_extra_rseg","allow to create extra rollback segments","When create new db, the new parameter allows to create more rollback segments","http://www.percona.com/docs/wiki/percona-xtradb"},
  {"innodb_overwrite_relay_log_info","overwrite relay-log.info when slave recovery","Building as plugin, it is not used.","http://www.percona.com/docs/wiki/percona-xtradb:innodb_overwrite_relay_log_info"},
@@ -382,9 +376,8 @@ diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_p
 +{"innodb_dict_size_limit","Limit dictionary cache size","Variable innodb_dict_size_limit in bytes","http://www.percona.com/docs/wiki/percona-xtradb"},
  {NULL, NULL, NULL, NULL}
  };
-diff -ruN a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
---- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c	2010-08-27 15:54:18.077987587 +0900
-+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c	2010-08-27 16:09:42.949020590 +0900
+--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c
++++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
 @@ -514,6 +514,7 @@
  
  	/* Use old-style record format for the insert buffer. */
@@ -393,9 +386,8 @@ diff -ruN a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/
  
  	dict_mem_table_add_col(table, heap, "DUMMY_COLUMN", DATA_BINARY, 0, 0);
  
-diff -ruN a/storage/innodb_plugin/include/btr0sea.h b/storage/innodb_plugin/include/btr0sea.h
---- a/storage/innodb_plugin/include/btr0sea.h	2010-08-04 02:24:19.000000000 +0900
-+++ b/storage/innodb_plugin/include/btr0sea.h	2010-08-27 16:09:42.951112397 +0900
+--- a/storage/innodb_plugin/include/btr0sea.h
++++ b/storage/innodb_plugin/include/btr0sea.h
 @@ -140,6 +140,13 @@
  				s- or x-latched, or an index page
  				for which we know that
@@ -410,9 +402,8 @@ diff -ruN a/storage/innodb_plugin/include/btr0sea.h b/storage/innodb_plugin/incl
  /********************************************************************//**
  Drops a page hash index when a page is freed from a fseg to the file system.
  Drops possible hash index if the page happens to be in the buffer pool. */
-diff -ruN a/storage/innodb_plugin/include/dict0dict.h b/storage/innodb_plugin/include/dict0dict.h
---- a/storage/innodb_plugin/include/dict0dict.h	2010-08-04 02:24:19.000000000 +0900
-+++ b/storage/innodb_plugin/include/dict0dict.h	2010-08-27 16:09:42.953188223 +0900
+--- a/storage/innodb_plugin/include/dict0dict.h
++++ b/storage/innodb_plugin/include/dict0dict.h
 @@ -1131,6 +1131,12 @@
  /*====================================*/
  	dict_table_t*	table,	/*!< in: table */
@@ -426,9 +417,8 @@ diff -ruN a/storage/innodb_plugin/include/dict0dict.h b/storage/innodb_plugin/in
  /* Buffers for storing detailed information about the latest foreign key
  and unique key errors */
  extern FILE*	dict_foreign_err_file;
-diff -ruN a/storage/innodb_plugin/include/dict0dict.ic b/storage/innodb_plugin/include/dict0dict.ic
---- a/storage/innodb_plugin/include/dict0dict.ic	2010-08-04 02:24:19.000000000 +0900
-+++ b/storage/innodb_plugin/include/dict0dict.ic	2010-08-27 16:09:42.955104393 +0900
+--- a/storage/innodb_plugin/include/dict0dict.ic
++++ b/storage/innodb_plugin/include/dict0dict.ic
 @@ -786,6 +786,13 @@
  	HASH_SEARCH(name_hash, dict_sys->table_hash, table_fold,
  		    dict_table_t*, table, ut_ad(table->cached),
@@ -456,9 +446,8 @@ diff -ruN a/storage/innodb_plugin/include/dict0dict.ic b/storage/innodb_plugin/i
  	ut_ad(!table || table->cached);
  
  	/* TODO: should get the type information from MySQL */
-diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/include/srv0srv.h
---- a/storage/innodb_plugin/include/srv0srv.h	2010-08-27 16:09:22.833022367 +0900
-+++ b/storage/innodb_plugin/include/srv0srv.h	2010-08-27 16:09:42.957104575 +0900
+--- a/storage/innodb_plugin/include/srv0srv.h
++++ b/storage/innodb_plugin/include/srv0srv.h
 @@ -219,7 +219,7 @@
  extern ulint	srv_adaptive_checkpoint;
  
@@ -476,9 +465,8 @@ diff -ruN a/storage/innodb_plugin/include/srv0srv.h b/storage/innodb_plugin/incl
  	ulint innodb_buffer_pool_pages_total;	/*!< Buffer pool size */
  	ulint innodb_buffer_pool_pages_data;	/*!< Data pages */
  	ulint innodb_buffer_pool_pages_dirty;	/*!< Dirty data pages */
-diff -ruN a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
---- a/storage/innodb_plugin/srv/srv0srv.c	2010-08-27 16:09:22.834056830 +0900
-+++ b/storage/innodb_plugin/srv/srv0srv.c	2010-08-27 16:09:42.960059093 +0900
+--- a/storage/innodb_plugin/srv/srv0srv.c
++++ b/storage/innodb_plugin/srv/srv0srv.c
 @@ -391,6 +391,7 @@
  UNIV_INTERN ulint	srv_adaptive_checkpoint = 0; /* 0: none  1: reflex  2: estimate */
  
diff --git a/mysql-innodb_expand_fast_index_creation.patch b/mysql-innodb_expand_fast_index_creation.patch
index fc89b88..091d54b 100644
--- a/mysql-innodb_expand_fast_index_creation.patch
+++ b/mysql-innodb_expand_fast_index_creation.patch
@@ -4,9 +4,9 @@
 # Expands the applicability of InnoDB fast index creation to mysqldump,
 # ALTER TABLE and OPTIMIZE TABLE.
 #
-diff -ruN a/client/client_priv.h b/client/client_priv.h
---- a/client/client_priv.h	2011-04-11 23:22:54.000000000 +0400
-+++ b/client/client_priv.h	2011-04-11 23:22:55.000000000 +0400
+#
+--- a/client/client_priv.h
++++ b/client/client_priv.h
 @@ -97,5 +97,6 @@
    OPT_FIRST_SLAVE,
    OPT_ALL,
@@ -14,9 +14,8 @@ diff -ruN a/client/client_priv.h b/client/client_priv.h
 +  OPT_INNODB_OPTIMIZE_KEYS,
    OPT_MAX_CLIENT_OPTION
  };
-diff -ruN a/client/mysqldump.c b/client/mysqldump.c
---- a/client/mysqldump.c	2011-04-11 23:22:49.000000000 +0400
-+++ b/client/mysqldump.c	2011-04-11 23:22:55.000000000 +0400
+--- a/client/mysqldump.c
++++ b/client/mysqldump.c
 @@ -45,6 +45,7 @@
  #include <m_ctype.h>
  #include <hash.h>
@@ -55,10 +54,29 @@ diff -ruN a/client/mysqldump.c b/client/mysqldump.c
    {"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
     &opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
     0, 0},
-@@ -2246,6 +2256,77 @@
+@@ -2246,6 +2256,128 @@
  }
  
  /*
++  Parse the specified key definition string and check if the key indexes
++  any of the columns from ignored_columns.
++*/
++static my_bool contains_ignored_column(HASH *ignored_columns, char *keydef)
++{
++  char *leftp, *rightp;
++
++  if ((leftp = strchr(keydef, '(')) &&
++      (rightp = strchr(leftp, ')')) &&
++      rightp > leftp + 3 &&                      /* (`...`) */
++      leftp[1] == '`' &&
++      rightp[-1] == '`' &&
++      hash_search(ignored_columns, (uchar *) leftp + 2, rightp - leftp - 3))
++    return TRUE;
++
++  return FALSE;
++}
++
++/*
 +  Remove secondary/foreign key definitions from a given SHOW CREATE TABLE string
 +  and store them into a temporary list to be used later.
 +
@@ -79,13 +97,19 @@ diff -ruN a/client/mysqldump.c b/client/mysqldump.c
 +{
 +  char *ptr, *strend;
 +  char *last_comma = NULL;
++  HASH ignored_columns;
++
++  if (hash_init(&ignored_columns, charset_info, 16, 0, 0,
++                (hash_get_key) get_table_key,
++                (hash_free_key) free_table_ent, 0))
++    exit(EX_EOM);
 +
 +  strend= create_str + strlen(create_str);
 +
 +  ptr= create_str;
 +  while (*ptr)
 +  {
-+    char *tmp, *orig_ptr;
++    char *tmp, *orig_ptr, c;
 +
 +    orig_ptr= ptr;
 +    /* Skip leading whitespace */
@@ -95,11 +119,15 @@ diff -ruN a/client/mysqldump.c b/client/mysqldump.c
 +    /* Read the next line */
 +    for (tmp= ptr; *tmp != '\n' && *tmp != '\0'; tmp++);
 +
++    c= *tmp;
++    *tmp= '\0'; /* so strstr() only processes the current line */
++
 +    /* Is it a secondary index definition? */
-+    if (*tmp == '\n' &&
++    if (c == '\n' &&
 +        (!strncmp(ptr, "UNIQUE KEY ", sizeof("UNIQUE KEY ") - 1) ||
 +         !strncmp(ptr, "KEY ", sizeof("KEY ") - 1) ||
-+         !strncmp(ptr, "CONSTRAINT ", sizeof("CONSTRAINT ") - 1)))
++         !strncmp(ptr, "CONSTRAINT ", sizeof("CONSTRAINT ") - 1)) &&
++        !contains_ignored_column(&ignored_columns, ptr))
 +    {
 +      char *data, *end= tmp - 1;
 +
@@ -122,18 +150,40 @@ diff -ruN a/client/mysqldump.c b/client/mysqldump.c
 +    }
 +    else
 +    {
++      char *end;
++
++      if (strstr(ptr, "AUTO_INCREMENT") && *ptr == '`')
++      {
++        /*
++          If a secondary key is defined on this column later,
++          it cannot be skipped, as CREATE TABLE would fail on import.
++        */
++        for (end= ptr + 1; *end != '`' && *end != '\0'; end++);
++        if (*end == '`' && end > ptr + 1 &&
++            my_hash_insert(&ignored_columns,
++                           (uchar *) my_strndup(ptr + 1,
++                                                end - ptr - 1, MYF(0))))
++        {
++          exit(EX_EOM);
++        }
++      }
++
++      *tmp= c;
++
 +      if (tmp[-1] == ',')
 +        last_comma= tmp - 1;
 +      ptr= (*tmp == '\0') ? tmp : tmp + 1;
 +    }
 +  }
++
++  hash_free(&ignored_columns);
 +}
 +
 +/*
    get_table_structure -- retrievs database structure, prints out corresponding
    CREATE statement and fills out insert_pat if the table is the type we will
    be dumping.
-@@ -2486,6 +2567,9 @@
+@@ -2486,6 +2618,9 @@
  
        row= mysql_fetch_row(result);
  
@@ -143,7 +193,7 @@ diff -ruN a/client/mysqldump.c b/client/mysqldump.c
        fprintf(sql_file, (opt_compatible_mode & 3) ? "%s;\n" :
                "/*!40101 SET @saved_cs_client     = @@character_set_client */;\n"
                "/*!40101 SET character_set_client = utf8 */;\n"
-@@ -3578,6 +3662,27 @@
+@@ -3578,6 +3713,27 @@
        goto err;
      }
  
@@ -171,10 +221,9 @@ diff -ruN a/client/mysqldump.c b/client/mysqldump.c
      /* Moved enable keys to before unlock per bug 15977 */
      if (opt_disable_keys)
      {
-diff -ruN /dev/null b/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ b/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result	2011-04-11 23:22:55.000000000 +0400
-@@ -0,0 +1,109 @@
+--- /dev/null
++++ b/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result
+@@ -0,0 +1,171 @@
 +#
 +# Test the --innodb-optimize-keys option.
 +#
@@ -284,9 +333,70 @@ diff -ruN /dev/null b/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result
 +
 +######################################
 +DROP TABLE t1, t2;
-diff -ruN a/mysql-test/suite/innodb_plugin/r/innodb.result b/mysql-test/suite/innodb_plugin/r/innodb.result
---- a/mysql-test/suite/innodb_plugin/r/innodb.result	2011-02-11 22:49:37.000000000 +0300
-+++ b/mysql-test/suite/innodb_plugin/r/innodb.result	2011-04-11 23:22:55.000000000 +0400
++CREATE TABLE t1 (
++id INT NOT NULL AUTO_INCREMENT,
++KEY (id)
++) ENGINE=InnoDB;
++CREATE TABLE t2 (
++id INT NOT NULL AUTO_INCREMENT,
++UNIQUE KEY (id)
++) ENGINE=InnoDB;
++INSERT INTO t1 VALUES (), (), ();
++INSERT INTO t2 VALUES (), (), ();
++######################################
++
++/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
++/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
++/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
++/*!40101 SET NAMES utf8 */;
++/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
++/*!40103 SET TIME_ZONE='+00:00' */;
++/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
++/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
++/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
++/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
++DROP TABLE IF EXISTS `t1`;
++/*!40101 SET @saved_cs_client     = @@character_set_client */;
++/*!40101 SET character_set_client = utf8 */;
++CREATE TABLE `t1` (
++  `id` int(11) NOT NULL AUTO_INCREMENT,
++  KEY `id` (`id`)
++) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
++/*!40101 SET character_set_client = @saved_cs_client */;
++
++LOCK TABLES `t1` WRITE;
++/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
++INSERT INTO `t1` VALUES (1),(2),(3);
++/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
++UNLOCK TABLES;
++DROP TABLE IF EXISTS `t2`;
++/*!40101 SET @saved_cs_client     = @@character_set_client */;
++/*!40101 SET character_set_client = utf8 */;
++CREATE TABLE `t2` (
++  `id` int(11) NOT NULL AUTO_INCREMENT,
++  UNIQUE KEY `id` (`id`)
++) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
++/*!40101 SET character_set_client = @saved_cs_client */;
++
++LOCK TABLES `t2` WRITE;
++/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
++INSERT INTO `t2` VALUES (1),(2),(3);
++/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
++UNLOCK TABLES;
++/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
++
++/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
++/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
++/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
++/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
++/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
++/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
++/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
++
++######################################
++DROP TABLE t1, t2;
+--- a/mysql-test/suite/innodb_plugin/r/innodb.result
++++ b/mysql-test/suite/innodb_plugin/r/innodb.result
 @@ -1679,7 +1679,7 @@
  71
  SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
@@ -296,10 +406,9 @@ diff -ruN a/mysql-test/suite/innodb_plugin/r/innodb.result b/mysql-test/suite/in
  SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
  variable_value - @innodb_rows_updated_orig
  866
-diff -ruN a/mysql-test/suite/innodb_plugin/t/innodb-index.test b/mysql-test/suite/innodb_plugin/t/innodb-index.test
---- a/mysql-test/suite/innodb_plugin/t/innodb-index.test	2011-02-11 22:49:34.000000000 +0300
-+++ b/mysql-test/suite/innodb_plugin/t/innodb-index.test	2011-04-11 23:22:55.000000000 +0400
-@@ -38,6 +38,11 @@
+--- a/mysql-test/suite/innodb_plugin/t/innodb-index.test
++++ b/mysql-test/suite/innodb_plugin/t/innodb-index.test
+@@ -97,6 +97,11 @@
  show create table t1;
  --error ER_MULTIPLE_PRI_KEY
  alter table t1 add primary key (c);
@@ -311,9 +420,8 @@ diff -ruN a/mysql-test/suite/innodb_plugin/t/innodb-index.test b/mysql-test/suit
  --error ER_DUP_ENTRY
  alter table t1 drop primary key, add primary key (b);
  create unique index c on t1 (c);
-diff -ruN a/mysql-test/suite/innodb_plugin/t/innodb.test b/mysql-test/suite/innodb_plugin/t/innodb.test
---- a/mysql-test/suite/innodb_plugin/t/innodb.test	2011-02-11 22:49:35.000000000 +0300
-+++ b/mysql-test/suite/innodb_plugin/t/innodb.test	2011-04-11 23:22:55.000000000 +0400
+--- a/mysql-test/suite/innodb_plugin/t/innodb.test
++++ b/mysql-test/suite/innodb_plugin/t/innodb.test
 @@ -15,6 +15,12 @@
  
  -- source include/have_innodb_plugin.inc
@@ -327,10 +435,9 @@ diff -ruN a/mysql-test/suite/innodb_plugin/t/innodb.test b/mysql-test/suite/inno
  let $MYSQLD_DATADIR= `select @@datadir`;
  
  # Save the original values of some variables in order to be able to
-diff -ruN /dev/null b/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ b/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test	2011-04-11 23:22:55.000000000 +0400
-@@ -0,0 +1,62 @@
+--- /dev/null
++++ b/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test
+@@ -0,0 +1,94 @@
 +# Embedded server doesn't support external clients
 +--source include/not_embedded.inc
 +
@@ -391,11 +498,42 @@ diff -ruN /dev/null b/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test
 +
 +DROP TABLE t1, t2;
 +
++########################################################################
++# Bug #812179: AUTO_INCREMENT columns must be skipped by the
++#              --innodb-optimize-keys optimization in mysqldump
++########################################################################
++
++CREATE TABLE t1 (
++  id INT NOT NULL AUTO_INCREMENT,
++  KEY (id)
++) ENGINE=InnoDB;
++
++CREATE TABLE t2 (
++  id INT NOT NULL AUTO_INCREMENT,
++  UNIQUE KEY (id)
++) ENGINE=InnoDB;
++
++INSERT INTO t1 VALUES (), (), ();
++INSERT INTO t2 VALUES (), (), ();
++
++--exec $MYSQL_DUMP --skip-comments --innodb-optimize-keys test t1 t2 >$file
++
++--echo ######################################
++--cat_file $file
++--echo ######################################
++
++# Check that the resulting dump can be imported back
++
++--exec $MYSQL test < $file
++
++--remove_file $file
++
++DROP TABLE t1, t2;
++
 +# Wait till we reached the initial number of concurrent sessions
 +--source include/wait_until_count_sessions.inc
-diff -ruN a/sql/sql_lex.cc b/sql/sql_lex.cc
---- a/sql/sql_lex.cc	2011-04-11 23:22:49.000000000 +0400
-+++ b/sql/sql_lex.cc	2011-04-11 23:22:55.000000000 +0400
+--- a/sql/sql_lex.cc
++++ b/sql/sql_lex.cc
 @@ -1494,6 +1494,9 @@
    alter_list(rhs.alter_list, mem_root),
    key_list(rhs.key_list, mem_root),
@@ -414,10 +552,9 @@ diff -ruN a/sql/sql_lex.cc b/sql/sql_lex.cc
    /* partition_names are not deeply copied currently */
  }
  
-diff -ruN a/sql/sql_lex.h b/sql/sql_lex.h
---- a/sql/sql_lex.h	2011-04-11 23:22:50.000000000 +0400
-+++ b/sql/sql_lex.h	2011-04-11 23:22:55.000000000 +0400
-@@ -896,6 +896,9 @@
+--- a/sql/sql_lex.h
++++ b/sql/sql_lex.h
+@@ -902,6 +902,9 @@
    List<Alter_column>            alter_list;
    List<Key>                     key_list;
    List<Create_field>            create_list;
@@ -427,7 +564,7 @@ diff -ruN a/sql/sql_lex.h b/sql/sql_lex.h
    uint                          flags;
    enum enum_enable_or_disable   keys_onoff;
    enum tablespace_op_type       tablespace_op;
-@@ -907,6 +910,8 @@
+@@ -913,6 +916,8 @@
  
  
    Alter_info() :
@@ -436,7 +573,7 @@ diff -ruN a/sql/sql_lex.h b/sql/sql_lex.h
      flags(0),
      keys_onoff(LEAVE_AS_IS),
      tablespace_op(NO_TABLESPACE_OP),
-@@ -922,6 +927,9 @@
+@@ -928,6 +933,9 @@
      alter_list.empty();
      key_list.empty();
      create_list.empty();
@@ -446,10 +583,9 @@ diff -ruN a/sql/sql_lex.h b/sql/sql_lex.h
      flags= 0;
      keys_onoff= LEAVE_AS_IS;
      tablespace_op= NO_TABLESPACE_OP;
-diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
---- a/sql/sql_table.cc	2011-04-11 23:22:40.000000000 +0400
-+++ b/sql/sql_table.cc	2011-04-11 23:44:23.000000000 +0400
-@@ -2559,7 +2559,7 @@
+--- a/sql/sql_table.cc
++++ b/sql/sql_table.cc
+@@ -2560,7 +2560,7 @@
        file                      The handler for the new table.
        key_info_buffer     OUT   An array of KEY structs for the indexes.
        key_count           OUT   The number of elements in the array.
@@ -458,7 +594,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
  
    DESCRIPTION
      Prepares the table and key structures for table creation.
-@@ -2914,7 +2914,6 @@
+@@ -2915,7 +2915,6 @@
    }
  
    /* Create keys */
@@ -466,7 +602,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
    List_iterator<Key> key_iterator(alter_info->key_list);
    List_iterator<Key> key_iterator2(alter_info->key_list);
    uint key_parts=0, fk_key_count=0;
-@@ -3014,6 +3013,14 @@
+@@ -3015,6 +3014,14 @@
    if (!*key_info_buffer || ! key_part_info)
      DBUG_RETURN(TRUE);				// Out of memory
  
@@ -481,7 +617,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
    key_iterator.rewind();
    key_number=0;
    for (; (key=key_iterator++) ; key_number++)
-@@ -3392,8 +3399,26 @@
+@@ -3393,8 +3400,26 @@
        my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length);
        DBUG_RETURN(TRUE);
      }
@@ -508,7 +644,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
    if (!unique_key && !primary_key &&
        (file->ha_table_flags() & HA_REQUIRE_PRIMARY_KEY))
    {
-@@ -6091,6 +6116,10 @@
+@@ -6093,6 +6118,10 @@
    List<Create_field> new_create_list;
    /* New key definitions are added here */
    List<Key> new_key_list;
@@ -519,7 +655,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
    List_iterator<Alter_drop> drop_it(alter_info->drop_list);
    List_iterator<Create_field> def_it(alter_info->create_list);
    List_iterator<Alter_column> alter_it(alter_info->alter_list);
-@@ -6103,6 +6132,7 @@
+@@ -6105,6 +6134,7 @@
    uint used_fields= create_info->used_fields;
    KEY *key_info=table->key_info;
    bool rc= TRUE;
@@ -527,7 +663,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
  
    DBUG_ENTER("mysql_prepare_alter_table");
  
-@@ -6130,6 +6160,7 @@
+@@ -6132,6 +6162,7 @@
      char *tablespace= static_cast<char *>(thd->alloc(FN_LEN + 1));
      /*
         Regular alter table of disk stored table (no tablespace/storage change)
@@ -535,7 +671,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
         Copy tablespace name
      */
      if (tablespace &&
-@@ -6280,7 +6311,23 @@
+@@ -6282,7 +6313,23 @@
    /*
      Collect all keys which isn't in drop list. Add only those
      for which some fields exists.
@@ -560,7 +696,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
  
    for (uint i=0 ; i < table->s->keys ; i++,key_info++)
    {
-@@ -6383,6 +6430,8 @@
+@@ -6385,6 +6432,8 @@
                     test(key_info->flags & HA_GENERATED_KEY),
                     key_parts);
        new_key_list.push_back(key);
@@ -569,7 +705,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
      }
    }
    {
-@@ -6390,7 +6439,21 @@
+@@ -6392,7 +6441,21 @@
      while ((key=key_it++))			// Add new keys
      {
        if (key->type != Key::FOREIGN_KEY)
@@ -592,7 +728,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
        if (key->name &&
  	  !my_strcasecmp(system_charset_info,key->name,primary_key_name))
        {
-@@ -6439,12 +6502,100 @@
+@@ -6441,12 +6504,100 @@
    rc= FALSE;
    alter_info->create_list.swap(new_create_list);
    alter_info->key_list.swap(new_key_list);
@@ -693,7 +829,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
    Alter table
  
    SYNOPSIS
-@@ -7228,6 +7379,12 @@
+@@ -7230,6 +7381,12 @@
    else
      create_info->data_file_name=create_info->index_file_name=0;
  
@@ -706,7 +842,7 @@ diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
    DEBUG_SYNC(thd, "alter_table_before_create_table_no_lock");
    /*
      Create a table with a temporary name.
-@@ -7284,15 +7441,33 @@
+@@ -7286,15 +7443,33 @@
    */
    if (new_table && !(new_table->file->ha_table_flags() & HA_NO_COPY_ON_ALTER))
    {
diff --git a/mysql-innodb_expand_import.patch b/mysql-innodb_expand_import.patch
index 8238cf8..a802ede 100644
--- a/mysql-innodb_expand_import.patch
+++ b/mysql-innodb_expand_import.patch
@@ -5,10 +5,38 @@
 #!!! notice !!!
 # Any small change to this file in the main branch
 # should be done or reviewed by the maintainer!
-diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
---- a/storage/innodb_plugin/fil/fil0fil.c	2010-04-29 15:44:28.000000000 +0900
-+++ b/storage/innodb_plugin/fil/fil0fil.c	2010-04-30 10:43:13.000000000 +0900
-@@ -40,6 +40,12 @@
+--- a/storage/innodb_plugin/btr/btr0btr.c
++++ b/storage/innodb_plugin/btr/btr0btr.c
+@@ -837,7 +837,7 @@
+ /**************************************************************//**
+ Creates a new index page (not the root, and also not
+ used in page reorganization).  @see btr_page_empty(). */
+-static
++UNIV_INTERN
+ void
+ btr_page_create(
+ /*============*/
+@@ -1704,7 +1704,7 @@
+ #ifndef UNIV_HOTBACKUP
+ /*************************************************************//**
+ Empties an index page.  @see btr_page_create(). */
+-static
++UNIV_INTERN
+ void
+ btr_page_empty(
+ /*===========*/
+@@ -2266,7 +2266,7 @@
+ /**************************************************************//**
+ Attaches the halves of an index page on the appropriate level in an
+ index tree. */
+-static
++UNIV_INTERN
+ void
+ btr_attach_half_pages(
+ /*==================*/
+--- a/storage/innodb_plugin/fil/fil0fil.c
++++ b/storage/innodb_plugin/fil/fil0fil.c
+@@ -40,6 +40,14 @@
  #include "dict0dict.h"
  #include "page0page.h"
  #include "page0zip.h"
@@ -18,10 +46,97 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +#include "row0mysql.h"
 +#include "row0row.h"
 +#include "que0que.h"
++#include "btr0btr.h"
++#include "btr0sea.h"
  #ifndef UNIV_HOTBACKUP
  # include "buf0lru.h"
  # include "ibuf0ibuf.h"
-@@ -3029,7 +3035,7 @@
+@@ -2984,6 +2992,84 @@
+ }
+ 
+ /********************************************************************//**
++Checks if a page is corrupt. (for offline page)
++*/
++static
++ibool
++fil_page_buf_page_is_corrupted_offline(
++/*===================================*/
++	const byte*	page,		/*!< in: a database page */
++	ulint		zip_size)	/*!< in: size of compressed page;
++					0 for uncompressed pages */
++{
++	ulint		checksum_field;
++	ulint		old_checksum_field;
++
++	if (!zip_size
++	    && memcmp(page + FIL_PAGE_LSN + 4,
++		      page + UNIV_PAGE_SIZE
++		      - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) {
++		return(TRUE);
++	}
++
++	checksum_field = mach_read_from_4(page
++					  + FIL_PAGE_SPACE_OR_CHKSUM);
++
++	if (zip_size) {
++		return(checksum_field != BUF_NO_CHECKSUM_MAGIC
++		       && checksum_field
++		       != page_zip_calc_checksum(page, zip_size));
++	}
++
++	old_checksum_field = mach_read_from_4(
++		page + UNIV_PAGE_SIZE
++		- FIL_PAGE_END_LSN_OLD_CHKSUM);
++
++	if (old_checksum_field != mach_read_from_4(page
++						   + FIL_PAGE_LSN)
++	    && old_checksum_field != BUF_NO_CHECKSUM_MAGIC
++	    && old_checksum_field
++	    != buf_calc_page_old_checksum(page)) {
++		return(TRUE);
++	}
++
++	if (checksum_field != 0
++	    && checksum_field != BUF_NO_CHECKSUM_MAGIC
++	    && checksum_field
++	    != buf_calc_page_new_checksum(page)) {
++		return(TRUE);
++	}
++
++	return(FALSE);
++}
++
++/********************************************************************//**
++*/
++static
++void
++fil_page_buf_page_store_checksum(
++/*=============================*/
++	byte*	page,
++	ulint	zip_size)
++{
++	if (!zip_size) {
++		mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
++				srv_use_checksums
++				? buf_calc_page_new_checksum(page)
++						: BUF_NO_CHECKSUM_MAGIC);
++		mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
++				srv_use_checksums
++				? buf_calc_page_old_checksum(page)
++						: BUF_NO_CHECKSUM_MAGIC);
++	} else {
++		mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
++				srv_use_checksums
++				? page_zip_calc_checksum(page, zip_size)
++				: BUF_NO_CHECKSUM_MAGIC);
++	}
++}
++
++/********************************************************************//**
+ Tries to open a single-table tablespace and optionally checks the space id is
+ right in it. If does not succeed, prints an error message to the .err log. This
+ function is used to open a tablespace when we start up mysqld, and also in
+@@ -3029,7 +3115,7 @@
  	ut_a(!(flags & (~0UL << DICT_TF_BITS)));
  
  	file = os_file_create_simple_no_error_handling(
@@ -30,7 +145,7 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
  	if (!success) {
  		/* The following call prints an error message */
  		os_file_get_last_error(TRUE);
-@@ -3076,6 +3082,466 @@
+@@ -3076,6 +3162,445 @@
  	space_id = fsp_header_get_space_id(page);
  	space_flags = fsp_header_get_flags(page);
  
@@ -56,6 +171,7 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +		fil_system_t*	system;
 +		fil_node_t*	node = NULL;
 +		fil_space_t*	space;
++		ulint		zip_size;
 +
 +		buf3 = ut_malloc(2 * UNIV_PAGE_SIZE);
 +		descr_page = ut_align(buf3, UNIV_PAGE_SIZE);
@@ -73,12 +189,15 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +		/* store as first descr page */
 +		memcpy(descr_page, page, UNIV_PAGE_SIZE);
 +
++		zip_size = dict_table_flags_to_zip_size(flags);
++		ut_a(zip_size == dict_table_flags_to_zip_size(space_flags));
++
 +		/* get free limit (page number) of the table space */
 +/* these should be same to the definition in fsp0fsp.c */
 +#define FSP_HEADER_OFFSET	FIL_PAGE_DATA
 +#define	FSP_FREE_LIMIT		12
 +		free_limit = mach_read_from_4(FSP_HEADER_OFFSET + FSP_FREE_LIMIT + page);
-+		free_limit_bytes = (ib_int64_t)free_limit * (ib_int64_t)UNIV_PAGE_SIZE;
++		free_limit_bytes = (ib_int64_t)free_limit * (ib_int64_t)(zip_size ? zip_size : UNIV_PAGE_SIZE);
 +
 +		/* overwrite fsp header */
 +		fsp_header_init_fields(page, id, flags);
@@ -87,14 +206,9 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +		space_flags = flags;
 +		if (mach_read_ull(page + FIL_PAGE_FILE_FLUSH_LSN) > current_lsn)
 +			mach_write_ull(page + FIL_PAGE_FILE_FLUSH_LSN, current_lsn);
-+		mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
-+				srv_use_checksums
-+				? buf_calc_page_new_checksum(page)
-+						: BUF_NO_CHECKSUM_MAGIC);
-+		mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
-+				srv_use_checksums
-+				? buf_calc_page_old_checksum(page)
-+						: BUF_NO_CHECKSUM_MAGIC);
++
++		fil_page_buf_page_store_checksum(page, zip_size);
++
 +		success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE);
 +
 +		/* get file size */
@@ -104,7 +218,7 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +
 +		if (size_bytes < free_limit_bytes) {
 +			free_limit_bytes = size_bytes;
-+			if (size_bytes >= (ib_int64_t) (FSP_EXTENT_SIZE * UNIV_PAGE_SIZE)) {
++			if (size_bytes >= (ib_int64_t) (FSP_EXTENT_SIZE * (zip_size ? zip_size : UNIV_PAGE_SIZE))) {
 +				fprintf(stderr, "InnoDB: free limit of %s is larger than its real size.\n", filepath);
 +				file_is_corrupt = TRUE;
 +			}
@@ -168,63 +282,41 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +			size_bytes = ut_2pow_round(size_bytes, 1024 * 1024);
 +		}
 +		*/
-+		if (!(flags & DICT_TF_ZSSIZE_MASK)) {
++
++		if (zip_size) {
++			fprintf(stderr, "InnoDB: Warning: importing compressed table is still EXPERIMENTAL, currently.\n");
++		}
++
++		{
 +			mem_heap_t*	heap = NULL;
 +			ulint		offsets_[REC_OFFS_NORMAL_SIZE];
 +			ulint*		offsets = offsets_;
 +			ib_int64_t	offset;
 +
-+			size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
++			size = (ulint) (size_bytes / (zip_size ? zip_size : UNIV_PAGE_SIZE));
 +			/* over write space id of all pages */
 +			rec_offs_init(offsets_);
 +
 +			fprintf(stderr, "InnoDB: Progress in %%:");
 +
-+			for (offset = 0; offset < free_limit_bytes; offset += UNIV_PAGE_SIZE) {
-+				ulint		checksum_field;
-+				ulint		old_checksum_field;
++			for (offset = 0; offset < free_limit_bytes;
++			     offset += zip_size ? zip_size : UNIV_PAGE_SIZE) {
 +				ibool		page_is_corrupt;
 +
 +				success = os_file_read(file, page,
 +							(ulint)(offset & 0xFFFFFFFFUL),
-+							(ulint)(offset >> 32), UNIV_PAGE_SIZE);
++							(ulint)(offset >> 32),
++							zip_size ? zip_size : UNIV_PAGE_SIZE);
 +
 +				page_is_corrupt = FALSE;
 +
 +				/* check consistency */
-+				if (memcmp(page + FIL_PAGE_LSN + 4,
-+					   page + UNIV_PAGE_SIZE
-+					   - FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) {
-+
++				if (fil_page_buf_page_is_corrupted_offline(page, zip_size)) {
 +					page_is_corrupt = TRUE;
 +				}
 +
 +				if (mach_read_from_4(page + FIL_PAGE_OFFSET)
-+				    != offset / UNIV_PAGE_SIZE) {
-+
-+					page_is_corrupt = TRUE;
-+				}
-+
-+				checksum_field = mach_read_from_4(page
-+								  + FIL_PAGE_SPACE_OR_CHKSUM);
-+
-+				old_checksum_field = mach_read_from_4(
-+					page + UNIV_PAGE_SIZE
-+					- FIL_PAGE_END_LSN_OLD_CHKSUM);
-+
-+				if (old_checksum_field != mach_read_from_4(page
-+									   + FIL_PAGE_LSN)
-+				    && old_checksum_field != BUF_NO_CHECKSUM_MAGIC
-+				    && old_checksum_field
-+				    != buf_calc_page_old_checksum(page)) {
-+
-+					page_is_corrupt = TRUE;
-+				}
-+
-+				if (checksum_field != 0
-+				    && checksum_field != BUF_NO_CHECKSUM_MAGIC
-+				    && checksum_field
-+				    != buf_calc_page_new_checksum(page)) {
++				    != offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)) {
 +
 +					page_is_corrupt = TRUE;
 +				}
@@ -235,7 +327,8 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +					/* it should be overwritten already */
 +					ut_a(!page_is_corrupt);
 +
-+				} else if (!((offset / UNIV_PAGE_SIZE) % UNIV_PAGE_SIZE)) {
++				} else if (!((offset / (zip_size ? zip_size : UNIV_PAGE_SIZE))
++					     % (zip_size ? zip_size : UNIV_PAGE_SIZE))) {
 +					/* descr page (not header) */
 +					if (page_is_corrupt) {
 +						file_is_corrupt = TRUE;
@@ -246,7 +339,7 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +					}
 +
 +					/* store as descr page */
-+					memcpy(descr_page, page, UNIV_PAGE_SIZE);
++					memcpy(descr_page, page, (zip_size ? zip_size : UNIV_PAGE_SIZE));
 +
 +				} else if (descr_is_corrupt) {
 +					/* unknown state of the page */
@@ -274,9 +367,12 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +					ulint	bit_index;
 +
 +					descr = descr_page + XDES_ARR_OFFSET
-+						+ XDES_SIZE * (ut_2pow_remainder((offset / UNIV_PAGE_SIZE), UNIV_PAGE_SIZE) / FSP_EXTENT_SIZE);
++						+ XDES_SIZE * (ut_2pow_remainder(
++							(offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)),
++							(zip_size ? zip_size : UNIV_PAGE_SIZE)) / FSP_EXTENT_SIZE);
 +
-+					index = XDES_FREE_BIT + XDES_BITS_PER_PAGE * ((offset / UNIV_PAGE_SIZE) % FSP_EXTENT_SIZE);
++					index = XDES_FREE_BIT
++						+ XDES_BITS_PER_PAGE * ((offset / (zip_size ? zip_size : UNIV_PAGE_SIZE)) % FSP_EXTENT_SIZE);
 +					byte_index = index / 8;
 +					bit_index = index % 8;
 +
@@ -294,7 +390,7 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +				}
 +
 +				if (page_is_corrupt) {
-+					fprintf(stderr, " [errp:%lld]", offset / UNIV_PAGE_SIZE);
++					fprintf(stderr, " [errp:%lld]", offset / (zip_size ? zip_size : UNIV_PAGE_SIZE));
 +
 +					/* cannot treat corrupt page */
 +					goto skip_write;
@@ -304,7 +400,13 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +					mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, id);
 +
 +					for (i = 0; i < n_index; i++) {
-+						if (offset / UNIV_PAGE_SIZE == root_page[i]) {
++						if (offset / (zip_size ? zip_size : UNIV_PAGE_SIZE) == root_page[i]) {
++							if (fil_page_get_type(page) != FIL_PAGE_INDEX) {
++								file_is_corrupt = TRUE;
++								fprintf(stderr, " [etyp:%lld]",
++									offset / (zip_size ? zip_size : UNIV_PAGE_SIZE));
++								goto skip_write;
++							}
 +							/* this is index root page */
 +							mach_write_to_4(page + FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
 +											+ FSEG_HDR_SPACE, id);
@@ -317,7 +419,14 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +					if (fil_page_get_type(page) == FIL_PAGE_INDEX) {
 +						dulint tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
 +
-+						if (mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
++						for (i = 0; i < n_index; i++) {
++							if (ut_dulint_cmp(old_id[i], tmp) == 0) {
++								mach_write_to_8(page + (PAGE_HEADER + PAGE_INDEX_ID), new_id[i]);
++								break;
++							}
++						}
++
++						if (!zip_size && mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
 +						    && ut_dulint_cmp(old_id[0], tmp) == 0) {
 +							/* leaf page of cluster index, reset trx_id of records */
 +							rec_t*	rec;
@@ -356,42 +465,34 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +								rec = page_rec_get_next(rec);
 +								n_recs--;
 +							}
-+						}
-+
-+						for (i = 0; i < n_index; i++) {
-+							if (ut_dulint_cmp(old_id[i], tmp) == 0) {
-+								mach_write_to_8(page + (PAGE_HEADER + PAGE_INDEX_ID), new_id[i]);
-+								break;
-+							}
++						} else if (mach_read_from_2(page + PAGE_HEADER + PAGE_LEVEL) == 0
++							   && ut_dulint_cmp(old_id[0], tmp) != 0) {
++							mach_write_to_8(page + (PAGE_HEADER + PAGE_MAX_TRX_ID), ut_dulint_create(0, 1));
 +						}
 +					}
 +
 +					if (mach_read_ull(page + FIL_PAGE_LSN) > current_lsn) {
 +						mach_write_ull(page + FIL_PAGE_LSN, current_lsn);
-+						mach_write_ull(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
-+										current_lsn);
++						if (!zip_size) {
++							mach_write_ull(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
++									current_lsn);
++						}
 +					}
 +
-+					mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
-+							srv_use_checksums
-+							? buf_calc_page_new_checksum(page)
-+									: BUF_NO_CHECKSUM_MAGIC);
-+					mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
-+							srv_use_checksums
-+							? buf_calc_page_old_checksum(page)
-+									: BUF_NO_CHECKSUM_MAGIC);
++					fil_page_buf_page_store_checksum(page, zip_size);
 +
 +					success = os_file_write(filepath, file, page,
 +								(ulint)(offset & 0xFFFFFFFFUL),
-+								(ulint)(offset >> 32), UNIV_PAGE_SIZE);
++								(ulint)(offset >> 32),
++								zip_size ? zip_size : UNIV_PAGE_SIZE);
 +				}
 +
 +skip_write:
 +				if (free_limit_bytes
-+				    && ((ib_int64_t)((offset + UNIV_PAGE_SIZE) * 100) / free_limit_bytes)
++				    && ((ib_int64_t)((offset + (zip_size ? zip_size : UNIV_PAGE_SIZE)) * 100) / free_limit_bytes)
 +					!= ((offset * 100) / free_limit_bytes)) {
 +					fprintf(stderr, " %lu",
-+						(ulong)((ib_int64_t)((offset + UNIV_PAGE_SIZE) * 100) / free_limit_bytes));
++						(ulong)((ib_int64_t)((offset + (zip_size ? zip_size : UNIV_PAGE_SIZE)) * 100) / free_limit_bytes));
 +				}
 +			}
 +
@@ -447,13 +548,6 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
 +			if (UNIV_LIKELY_NULL(heap)) {
 +				mem_heap_free(heap);
 +			}
-+		} else {
-+			/* zip page? */
-+			size = (ulint)
-+			(size_bytes
-+					/ dict_table_flags_to_zip_size(flags));
-+			fprintf(stderr, "InnoDB: import: table %s seems to be in newer format."
-+					" It may not be able to treated for now.\n", name);
 +		}
 +		/* .exp file should be removed */
 +		success = os_file_delete(info_file_path);
@@ -497,10 +591,281 @@ diff -ruN a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0
  	ut_free(buf2);
  
  	if (UNIV_UNLIKELY(space_id != id
-diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
---- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-04-29 16:54:08.000000000 +0900
-+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-04-30 10:28:05.000000000 +0900
-@@ -7125,6 +7125,14 @@
+@@ -3117,6 +3642,271 @@
+ 	os_file_close(file);
+ 	mem_free(filepath);
+ 
++	if (srv_expand_import && dict_table_flags_to_zip_size(flags)) {
++		ulint		page_no;
++		ulint		zip_size;
++		ulint		height;
++		ulint		root_height = 0;
++		rec_t*		node_ptr;
++		dict_table_t*	table;
++		dict_index_t*	index;
++		buf_block_t*	block;
++		page_t*		page;
++		page_zip_des_t*	page_zip;
++		mtr_t		mtr;
++
++		mem_heap_t*	heap		= NULL;
++		ulint		offsets_[REC_OFFS_NORMAL_SIZE];
++		ulint*		offsets		= offsets_;
++
++		rec_offs_init(offsets_);
++
++		zip_size = dict_table_flags_to_zip_size(flags);
++
++		table = dict_table_get_low(name);
++		index = dict_table_get_first_index(table);
++		page_no = dict_index_get_page(index);
++		ut_a(page_no == 3);
++
++		fprintf(stderr, "InnoDB: It is compressed .ibd file. need to convert additionaly on buffer pool.\n");
++
++		/* down to leaf */
++		mtr_start(&mtr);
++		mtr_set_log_mode(&mtr, MTR_LOG_NONE);
++
++		height = ULINT_UNDEFINED;
++
++		for (;;) {
++			block = buf_page_get(space_id, zip_size, page_no,
++					     RW_NO_LATCH, &mtr);
++			page = buf_block_get_frame(block);
++
++			block->check_index_page_at_flush = TRUE;
++
++			if (height == ULINT_UNDEFINED) {
++				height = btr_page_get_level(page, &mtr);
++				root_height = height;
++			}
++
++			if (height == 0) {
++				break;
++			}
++
++			node_ptr = page_rec_get_next(page_get_infimum_rec(page));
++
++			height--;
++
++			offsets = rec_get_offsets(node_ptr, index, offsets, ULINT_UNDEFINED, &heap);
++			page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
++		}
++
++		mtr_commit(&mtr);
++
++		fprintf(stderr, "InnoDB: pages needs split are ...");
++
++		/* scan reaf pages */
++		while (page_no != FIL_NULL) {
++			rec_t*	rec;
++			rec_t*	supremum;
++			ulint	n_recs;
++
++			mtr_start(&mtr);
++
++			block = buf_page_get(space_id, zip_size, page_no,
++					     RW_X_LATCH, &mtr);
++			page = buf_block_get_frame(block);
++			page_zip = buf_block_get_page_zip(block);
++
++			if (!page_zip) {
++				/*something wrong*/
++				fprintf(stderr, "InnoDB: Something wrong with reading page %lu.\n", page_no);
++convert_err_exit:
++				mtr_commit(&mtr);
++				mutex_enter(&fil_system->mutex);
++				fil_space_free(space_id, FALSE);
++				mutex_exit(&fil_system->mutex);
++				success = FALSE;
++				goto convert_exit;
++			}
++
++			supremum = page_get_supremum_rec(page);
++			rec = page_rec_get_next(page_get_infimum_rec(page));
++			n_recs = page_get_n_recs(page);
++
++			/* illegal operation as InnoDB online system. so not logged */
++			while (rec && rec != supremum && n_recs > 0) {
++				ulint	n_fields;
++				ulint	i;
++				ulint	offset = index->trx_id_offset;
++
++				offsets = rec_get_offsets(rec, index, offsets,
++						ULINT_UNDEFINED, &heap);
++				n_fields = rec_offs_n_fields(offsets);
++				if (!offset) {
++					offset = row_get_trx_id_offset(rec, index, offsets);
++				}
++				trx_write_trx_id(rec + offset, ut_dulint_create(0, 1));
++
++				for (i = 0; i < n_fields; i++) {
++					if (rec_offs_nth_extern(offsets, i)) {
++						ulint	local_len;
++						byte*	data;
++
++						data = rec_get_nth_field(rec, offsets, i, &local_len);
++
++						local_len -= BTR_EXTERN_FIELD_REF_SIZE;
++
++						mach_write_to_4(data + local_len + BTR_EXTERN_SPACE_ID, id);
++					}
++				}
++
++				rec = page_rec_get_next(rec);
++				n_recs--;
++			}
++
++			/* dummy logged update for along with modified page path */
++			if (ut_dulint_cmp(index->id, btr_page_get_index_id(page)) != 0) {
++				/* this should be adjusted already */
++				fprintf(stderr, "InnoDB: The page %lu seems to be converted wrong.\n", page_no);
++				goto convert_err_exit;
++			}
++			btr_page_set_index_id(page, page_zip, index->id, &mtr);
++
++			/* confirm whether fits to the page size or not */
++			if (!page_zip_compress(page_zip, page, index, &mtr)
++			    && !btr_page_reorganize(block, index, &mtr)) {
++				buf_block_t*	new_block;
++				page_t*		new_page;
++				page_zip_des_t*	new_page_zip;
++				rec_t*		split_rec;
++				ulint		n_uniq;
++
++				/* split page is needed */
++				fprintf(stderr, " %lu", page_no);
++
++				mtr_x_lock(dict_index_get_lock(index), &mtr);
++
++				n_uniq = dict_index_get_n_unique_in_tree(index);
++
++				if(page_get_n_recs(page) < 2) {
++					/* no way to make smaller */
++					fprintf(stderr, "InnoDB: The page %lu cannot be store to the page size.\n", page_no);
++					goto convert_err_exit;
++				}
++
++				if (UNIV_UNLIKELY(page_no == dict_index_get_page(index))) {
++					ulint		new_page_no;
++					dtuple_t*	node_ptr;
++					ulint		level;
++					rec_t*		node_ptr_rec;
++					page_cur_t	page_cursor;
++
++					/* it is root page, need to raise before split */
++
++					level = btr_page_get_level(page, &mtr);
++
++					new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, &mtr);
++					new_page = buf_block_get_frame(new_block);
++					new_page_zip = buf_block_get_page_zip(new_block);
++					btr_page_create(new_block, new_page_zip, index, level, &mtr);
++
++					btr_page_set_next(new_page, new_page_zip, FIL_NULL, &mtr);
++					btr_page_set_prev(new_page, new_page_zip, FIL_NULL, &mtr);
++
++					page_zip_copy_recs(new_page_zip, new_page,
++							   page_zip, page, index, &mtr);
++					btr_search_move_or_delete_hash_entries(new_block, block, index);
++
++					rec = page_rec_get_next(page_get_infimum_rec(new_page));
++					new_page_no = buf_block_get_page_no(new_block);
++
++					node_ptr = dict_index_build_node_ptr(index, rec, new_page_no, heap,
++									     level);
++					dtuple_set_info_bits(node_ptr,
++							     dtuple_get_info_bits(node_ptr)
++							     | REC_INFO_MIN_REC_FLAG);
++					btr_page_empty(block, page_zip, index, level + 1, &mtr);
++
++					btr_page_set_next(page, page_zip, FIL_NULL, &mtr);
++					btr_page_set_prev(page, page_zip, FIL_NULL, &mtr);
++
++					page_cur_set_before_first(block, &page_cursor);
++
++					node_ptr_rec = page_cur_tuple_insert(&page_cursor, node_ptr,
++									     index, 0, &mtr);
++					ut_a(node_ptr_rec);
++
++					if (!btr_page_reorganize(block, index, &mtr)) {
++						fprintf(stderr, "InnoDB: failed to store the page %lu.\n", page_no);
++						goto convert_err_exit;
++					}
++
++					/* move to the raised page */
++					page_no = new_page_no;
++					block = new_block;
++					page = new_page;
++					page_zip = new_page_zip;
++
++					fprintf(stderr, "(raise_to:%lu)", page_no);
++				}
++
++				split_rec = page_get_middle_rec(page);
++
++				new_block = btr_page_alloc(index, page_no + 1, FSP_UP,
++							   btr_page_get_level(page, &mtr), &mtr);
++				new_page = buf_block_get_frame(new_block);
++				new_page_zip = buf_block_get_page_zip(new_block);
++				btr_page_create(new_block, new_page_zip, index,
++						btr_page_get_level(page, &mtr), &mtr);
++
++				offsets = rec_get_offsets(split_rec, index, offsets, n_uniq, &heap);
++
++				btr_attach_half_pages(index, block,
++						      split_rec, new_block, FSP_UP, &mtr);
++
++				page_zip_copy_recs(new_page_zip, new_page,
++						   page_zip, page, index, &mtr);
++				page_delete_rec_list_start(split_rec - page + new_page,
++							   new_block, index, &mtr);
++				btr_search_move_or_delete_hash_entries(new_block, block, index);
++				page_delete_rec_list_end(split_rec, block, index,
++							 ULINT_UNDEFINED, ULINT_UNDEFINED, &mtr);
++
++				fprintf(stderr, "(new:%lu)", buf_block_get_page_no(new_block));
++
++				/* Are they needed? */
++				if (!btr_page_reorganize(block, index, &mtr)) {
++					fprintf(stderr, "InnoDB: failed to store the page %lu.\n", page_no);
++					goto convert_err_exit;
++				}
++				if (!btr_page_reorganize(new_block, index, &mtr)) {
++					fprintf(stderr, "InnoDB: failed to store the page %lu.\n", buf_block_get_page_no(new_block));
++					goto convert_err_exit;
++				}
++			}
++
++			page_no = btr_page_get_next(page, &mtr);
++
++			mtr_commit(&mtr);
++
++			if (heap) {
++				mem_heap_empty(heap);
++			}
++		}
++
++		fprintf(stderr, "...done.\nInnoDB: waiting the flush batch of the additional conversion.\n");
++
++		/* should wait for the not-logged changes are all flushed */
++		buf_flush_batch(BUF_FLUSH_LIST, ULINT_MAX, mtr.end_lsn + 1);
++		buf_flush_wait_batch_end(BUF_FLUSH_LIST);
++
++		fprintf(stderr, "InnoDB: done.\n");
++convert_exit:
++		if (UNIV_LIKELY_NULL(heap)) {
++			mem_heap_free(heap);
++		}
++	}
++
+ 	return(success);
+ }
+ #endif /* !UNIV_HOTBACKUP */
+--- a/storage/innodb_plugin/handler/ha_innodb.cc
++++ b/storage/innodb_plugin/handler/ha_innodb.cc
+@@ -7119,6 +7119,14 @@
  		err = row_discard_tablespace_for_mysql(dict_table->name, trx);
  	} else {
  		err = row_import_tablespace_for_mysql(dict_table->name, trx);
@@ -515,7 +880,7 @@ diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/h
  	}
  
  	err = convert_error_code_to_mysql(err, dict_table->flags, NULL);
-@@ -11387,6 +11395,11 @@
+@@ -11383,6 +11391,11 @@
<Skipped 18837 lines>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/percona-server.git/commitdiff/bf636d07b36bfd2921b9ecf2033c78270355c98c



More information about the pld-cvs-commit mailing list