Merge lp:~vlad-lesin/percona-server/i_s-innodb-changed-pages into lp:percona-server/5.5

Proposed by Vlad Lesin on 2012-07-17
Status: Merged
Merged at revision: 298
Proposed branch: lp:~vlad-lesin/percona-server/i_s-innodb-changed-pages
Merge into: lp:percona-server/5.5
Diff against target: 12721 lines (+11770/-9) (has conflicts)
67 files modified
Makefile.OTHER (+77/-0)
Percona-Server/mysql-test/r/information_schema.result (+189/-0)
Percona-Server/mysql-test/r/information_schema_db.result (+23/-0)
Percona-Server/mysql-test/r/mysqlshow.result (+28/-0)
Percona-Server/mysql-test/r/percona_server_variables_debug.result.OTHER (+357/-0)
Percona-Server/mysql-test/r/percona_server_variables_release.result.OTHER (+352/-0)
Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp.result (+21/-0)
Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_no_restart.result (+6/-0)
Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages.result (+41/-0)
Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages_empty.result (+2/-0)
Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result (+94/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test (+32/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp-master.opt (+1/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp.test (+100/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart-master.opt (+1/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart.test (+21/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages-master.opt (+1/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages.test (+103/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty-master.opt (+1/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty.test (+8/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s-master.opt (+1/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s.test (+21/-0)
Percona-Server/sql/handler.cc (+4/-0)
Percona-Server/storage/innobase/fil/fil0fil.c (+6/-0)
Percona-Server/storage/innobase/handler/ha_innodb.cc (+18/-0)
Percona-Server/storage/innobase/handler/i_s.cc (+1247/-0)
Percona-Server/storage/innobase/handler/i_s.h (+10/-0)
Percona-Server/storage/innobase/include/log0log.h (+5/-0)
Percona-Server/storage/innobase/include/log0online.h (+111/-0)
Percona-Server/storage/innobase/include/log0recv.h (+37/-0)
Percona-Server/storage/innobase/include/os0file.h (+11/-0)
Percona-Server/storage/innobase/include/os0sync.h (+24/-4)
Percona-Server/storage/innobase/include/srv0srv.h (+27/-0)
Percona-Server/storage/innobase/include/ut0rbt.h.OTHER (+332/-0)
Percona-Server/storage/innobase/log/log0log.c (+123/-2)
Percona-Server/storage/innobase/log/log0online.c (+1083/-0)
Percona-Server/storage/innobase/log/log0recv.c (+5/-3)
Percona-Server/storage/innobase/os/os0file.c (+19/-0)
Percona-Server/storage/innobase/srv/srv0srv.c (+64/-0)
Percona-Server/storage/innobase/srv/srv0start.c (+22/-0)
Percona-Server/storage/innobase/ut/ut0rbt.c.OTHER (+1273/-0)
Percona-Server/storage/innodb_plugin/CMakeLists.txt.OTHER (+88/-0)
Percona-Server/storage/innodb_plugin/Makefile.am.OTHER (+346/-0)
Percona-Server/storage/innodb_plugin/plug.in.OTHER (+289/-0)
doc/Makefile.OTHER (+143/-0)
doc/source/conf.py.OTHER (+270/-0)
doc/source/diagnostics/innodb_stats.rst.OTHER (+159/-0)
doc/source/diagnostics/misc_info_schema_tables.rst.OTHER (+133/-0)
doc/source/diagnostics/mysql_syslog.rst.OTHER (+43/-0)
doc/source/diagnostics/slow_extended.rst.OTHER (+401/-0)
doc/source/flexibility/buff_read_ahead_area.rst.OTHER (+36/-0)
doc/source/installation/apt_repo.rst.OTHER (+64/-0)
doc/source/management/innodb_expand_import.rst.OTHER (+155/-0)
doc/source/management/innodb_fast_index_creation.rst.OTHER (+50/-0)
doc/source/management/innodb_lru_dump_restore.rst.OTHER (+138/-0)
doc/source/percona-theme/layout.html (+407/-0)
doc/source/percona-theme/searchbox.html (+22/-0)
doc/source/percona-theme/static/default.css_t (+433/-0)
doc/source/percona-theme/static/jquery.min.js (+154/-0)
doc/source/percona-theme/static/percona.com.css (+1850/-0)
doc/source/percona-theme/static/percona.com.js (+269/-0)
doc/source/percona-theme/static/sidebar.js (+151/-0)
doc/source/percona-theme/theme.conf (+32/-0)
doc/source/reliability/innodb_corrupt_table_action.rst.OTHER (+27/-0)
doc/source/reliability/innodb_recovery_update_relay_log.rst.OTHER (+80/-0)
doc/source/scalability/innodb_expand_undo_slots.rst.OTHER (+44/-0)
doc/source/scalability/innodb_extra_rseg.rst.OTHER (+85/-0)
Contents conflict in Makefile
Conflict adding files to Makefile.  Moved to root.
Conflict adding files to Makefile.BASE.  Moved to root.
Conflict adding files to Makefile.OTHER.  Moved to root.
Text conflict in Percona-Server/mysql-test/r/information_schema.result
Text conflict in Percona-Server/mysql-test/r/information_schema_db.result
Text conflict in Percona-Server/mysql-test/r/mysqlshow.result
Contents conflict in Percona-Server/mysql-test/r/percona_server_variables_debug.result
Contents conflict in Percona-Server/mysql-test/r/percona_server_variables_release.result
Path conflict: Percona-Server/mysql-test/suite/innodb/r/percona_bug_951588.result / Percona-Server/mysql-test/suite/innodb_plugin/r/percona_bug_951588.result
Path conflict: Percona-Server/mysql-test/suite/innodb/t/percona_bug_951588.test / Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test
Conflict adding files to Percona-Server/mysql-test/suite/innodb_plugin.  Created directory.
Conflict because Percona-Server/mysql-test/suite/innodb_plugin is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to Percona-Server/mysql-test/suite/innodb_plugin/r.  Created directory.
Conflict because Percona-Server/mysql-test/suite/innodb_plugin/r is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to Percona-Server/mysql-test/suite/innodb_plugin/t.  Created directory.
Conflict because Percona-Server/mysql-test/suite/innodb_plugin/t is not versioned, but has versioned children.  Versioned directory.
Text conflict in Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test
Text conflict in Percona-Server/sql/handler.cc
Text conflict in Percona-Server/storage/innobase/fil/fil0fil.c
Text conflict in Percona-Server/storage/innobase/handler/ha_innodb.cc
Text conflict in Percona-Server/storage/innobase/handler/i_s.cc
Text conflict in Percona-Server/storage/innobase/handler/i_s.h
Text conflict in Percona-Server/storage/innobase/include/os0file.h
Text conflict in Percona-Server/storage/innobase/include/srv0srv.h
Contents conflict in Percona-Server/storage/innobase/include/ut0rbt.h
Text conflict in Percona-Server/storage/innobase/log/log0log.c
Text conflict in Percona-Server/storage/innobase/srv/srv0srv.c
Text conflict in Percona-Server/storage/innobase/srv/srv0start.c
Contents conflict in Percona-Server/storage/innobase/ut/ut0rbt.c
Conflict adding files to Percona-Server/storage/innodb_plugin.  Created directory.
Conflict because Percona-Server/storage/innodb_plugin is not versioned, but has versioned children.  Versioned directory.
Contents conflict in Percona-Server/storage/innodb_plugin/CMakeLists.txt
Contents conflict in Percona-Server/storage/innodb_plugin/Makefile.am
Contents conflict in Percona-Server/storage/innodb_plugin/plug.in
Conflict adding files to doc.  Created directory.
Conflict adding files to doc.  Moved to root.
Conflict because doc is not versioned, but has versioned children.  Versioned directory.
Conflict adding file doc.  Moved existing file to doc.moved.
Contents conflict in doc/Makefile
Conflict adding files to doc/source.  Created directory.
Conflict because doc/source is not versioned, but has versioned children.  Versioned directory.
Contents conflict in doc/source/conf.py
Conflict adding files to doc/source/diagnostics.  Created directory.
Conflict because doc/source/diagnostics is not versioned, but has versioned children.  Versioned directory.
Contents conflict in doc/source/diagnostics/innodb_stats.rst
Contents conflict in doc/source/diagnostics/misc_info_schema_tables.rst
Contents conflict in doc/source/diagnostics/mysql_syslog.rst
Contents conflict in doc/source/diagnostics/slow_extended.rst
Conflict adding files to doc/source/flexibility.  Created directory.
Conflict because doc/source/flexibility is not versioned, but has versioned children.  Versioned directory.
Contents conflict in doc/source/flexibility/buff_read_ahead_area.rst
Conflict adding files to doc/source/installation.  Created directory.
Conflict because doc/source/installation is not versioned, but has versioned children.  Versioned directory.
Contents conflict in doc/source/installation/apt_repo.rst
Conflict adding files to doc/source/management.  Created directory.
Conflict because doc/source/management is not versioned, but has versioned children.  Versioned directory.
Contents conflict in doc/source/management/innodb_expand_import.rst
Contents conflict in doc/source/management/innodb_fast_index_creation.rst
Contents conflict in doc/source/management/innodb_lru_dump_restore.rst
Conflict adding files to doc/source/reliability.  Created directory.
Conflict because doc/source/reliability is not versioned, but has versioned children.  Versioned directory.
Contents conflict in doc/source/reliability/innodb_corrupt_table_action.rst
Contents conflict in doc/source/reliability/innodb_recovery_update_relay_log.rst
Conflict adding files to doc/source/scalability.  Created directory.
Conflict because doc/source/scalability is not versioned, but has versioned children.  Versioned directory.
Contents conflict in doc/source/scalability/innodb_expand_undo_slots.rst
Contents conflict in doc/source/scalability/innodb_extra_rseg.rst
To merge this branch: bzr merge lp:~vlad-lesin/percona-server/i_s-innodb-changed-pages
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) 2012-07-17 Needs Fixing on 2012-07-18
Review via email: mp+115373@code.launchpad.net

Description of the change

Could you review my code and test especialy? I doubt this test is enough for this feature and still thinking about the better variant. The jenkins build can be found here http://jenkins.percona.com/view/PS%205.1/job/percona-server-5.1-param/344 .

To post a comment you must log in.

It seems that the target branch is wrong.

review: Needs Fixing
458. By Vlad Lesin on 2012-08-15

This is implementation if INFORMATION_SCHEMA.INNODB_CHANGED_PAGES table.
Blueprint for this feature can be found here:

https://blueprints.launchpad.net/percona-server/+spec/innodb-changed-pages-table

The table is generated from bitmap file which is written by log tracking thread
which parses and writes bitmap blocks after checkpoint happens. Thus the table
contain only information that was written by log tracking thread, it doesn't
contain realtime data.

Information schema tables are in-memory tables, so it can require a lot of
memory to store the whole INFORMATION_SCHEMA.INNODB_CHANGED_PAGES table. There
are two mechanisms to limit the size of the table. The first is condition
pushdown. It means the table will contain only data which corresponds to
condition in "WHERE" SQL clause. And the second is innodb_changed_pages_limit
system variable which limits the number of rows in the table(0 - unlimited).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Makefile.OTHER'
2--- Makefile.OTHER 1970-01-01 00:00:00 +0000
3+++ Makefile.OTHER 2012-08-15 14:13:50 +0000
4@@ -0,0 +1,77 @@
5+MYSQL_VERSION=5.1.63
6+PERCONA_SERVER_VERSION=rel13.4
7+PERCONA_SERVER ?=Percona-Server-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)
8+PERCONA_SERVER_SHORT_1 ?=Percona-Server-$(MYSQL_VERSION)
9+PERCONA_SERVER_SHORT_2 ?=Percona-Server
10+KEWPIE ?=kewpie
11+BASEDIR = $(CURDIR)
12+
13+all: main install-lic handlersocket maatkit-udf autorun
14+ @echo ""
15+ @echo "Percona Server source code is ready"
16+ @echo "Now change directory to $(PERCONA_SERVER) define variables as show below"
17+ @echo ""
18+ export CFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2"
19+ export CXXFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2"
20+ export LIBS=-lrt
21+ @echo ""
22+ @echo "and run ./configure --with-plugins=partition,archive,blackhole,csv,example,federated,innodb_plugin --without-embedded-server --with-pic --with-extra-charsets=complex --with-ssl --enable-assembler --enable-local-infile --enable-thread-safe-client --enable-profiling --with-readline && make all install"
23+ @echo ""
24+
25+autorun:
26+ cd $(PERCONA_SERVER) && ./BUILD/autorun.sh
27+
28+handlersocket:
29+ cp -R HandlerSocket-Plugin-for-MySQL $(PERCONA_SERVER)/storage
30+ patch -p1 -d $(PERCONA_SERVER)/storage < handlersocket.patch
31+
32+maatkit-udf:
33+ cp -R UDF "$(PERCONA_SERVER)"
34+ cd "$(PERCONA_SERVER)"/UDF && autoreconf --install
35+
36+install-lic:
37+ @echo "Installing license files"
38+ install -m 644 COPYING.* $(PERCONA_SERVER)
39+
40+prepare:
41+ @echo "Prepare Percona Server sources"
42+ rm -rf $(PERCONA_SERVER) $(PERCONA_SERVER_SHORT_1)
43+ ln -s $(PERCONA_SERVER_SHORT_2) $(PERCONA_SERVER)
44+ ln -s $(PERCONA_SERVER_SHORT_2) $(PERCONA_SERVER_SHORT_1)
45+
46+main: prepare
47+
48+clean:
49+ rm -rf $(PERCONA_SERVER) $(PERCONA_SERVER_SHORT_1)
50+
51+test-crashme:
52+ cd $(KEWPIE) && ./kewpie.py --suite=crashme --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
53+
54+test-sqlbench:
55+ cd $(KEWPIE) && ./kewpie.py --suite=sqlbench --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
56+
57+test-randgen:
58+ cd $(KEWPIE) && ./kewpie.py --suite=randgen_basic --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
59+
60+test-randgen-bugs:
61+ cd $(KEWPIE) && ./kewpie.py --suite=randgen_bugs --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
62+
63+test-cluster:
64+ cd $(KEWPIE) && ./kewpie.py --suite=cluster_basic,cluster_randgen --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
65+
66+test-cluster-basic:
67+ cd $(KEWPIE) && ./kewpie.py --suite=cluster_basic --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
68+
69+test-cluster-randgen:
70+ cd $(KEWPIE) && ./kewpie.py --suite=cluster_randgen --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
71+
72+test-cluster-bugs:
73+ cd $(KEWPIE) && ./kewpie.py --suite=cluster_bugs --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
74+
75+test-innodb-crash:
76+ cd $(KEWPIE) && ./kewpie.py --suite=innodbCrash --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
77+
78+
79+
80+
81+
82
83=== modified file 'Percona-Server/mysql-test/r/information_schema.result'
84--- Percona-Server/mysql-test/r/information_schema.result 2012-07-31 05:33:11 +0000
85+++ Percona-Server/mysql-test/r/information_schema.result 2012-08-15 14:13:50 +0000
86@@ -83,7 +83,30 @@
87 USER_PRIVILEGES
88 USER_STATISTICS
89 VIEWS
90+<<<<<<< TREE
91+=======
92+INNODB_BUFFER_POOL_PAGES_INDEX
93+INNODB_RSEG
94+INNODB_CHANGED_PAGES
95+INNODB_BUFFER_POOL_PAGES
96+INNODB_TABLE_STATS
97+INNODB_TRX
98+>>>>>>> MERGE-SOURCE
99 XTRADB_ADMIN_COMMAND
100+<<<<<<< TREE
101+=======
102+INNODB_LOCK_WAITS
103+INNODB_SYS_TABLES
104+INNODB_CMP
105+INNODB_SYS_STATS
106+INNODB_CMP_RESET
107+INNODB_CMPMEM
108+INNODB_INDEX_STATS
109+INNODB_SYS_INDEXES
110+INNODB_BUFFER_POOL_PAGES_BLOB
111+INNODB_CMPMEM_RESET
112+INNODB_LOCKS
113+>>>>>>> MERGE-SOURCE
114 columns_priv
115 db
116 event
117@@ -900,6 +923,11 @@
118 TABLE_STATISTICS TABLE_NAME select
119 TEMPORARY_TABLES TABLE_NAME select
120 VIEWS TABLE_NAME select
121+<<<<<<< TREE
122+=======
123+INNODB_TABLE_STATS table_name select
124+INNODB_INDEX_STATS table_name select
125+>>>>>>> MERGE-SOURCE
126 delete from mysql.user where user='mysqltest_4';
127 delete from mysql.db where user='mysqltest_4';
128 flush privileges;
129@@ -1280,6 +1308,147 @@
130 DROP FUNCTION f1;
131 DROP PROCEDURE p1;
132 DROP USER mysql_bug20230@localhost;
133+<<<<<<< TREE
134+=======
135+SELECT t.table_name, c1.column_name
136+FROM information_schema.tables t
137+INNER JOIN
138+information_schema.columns c1
139+ON t.table_schema = c1.table_schema AND
140+t.table_name = c1.table_name
141+WHERE t.table_schema = 'information_schema' AND
142+c1.ordinal_position =
143+( SELECT COALESCE(MIN(c2.ordinal_position),1)
144+FROM information_schema.columns c2
145+WHERE c2.table_schema = t.table_schema AND
146+c2.table_name = t.table_name AND
147+c2.column_name LIKE '%SCHEMA%'
148+ );
149+table_name column_name
150+CHARACTER_SETS CHARACTER_SET_NAME
151+CLIENT_STATISTICS CLIENT
152+COLLATIONS COLLATION_NAME
153+COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
154+COLUMNS TABLE_SCHEMA
155+COLUMN_PRIVILEGES TABLE_SCHEMA
156+INDEX_STATISTICS TABLE_SCHEMA
157+ENGINES ENGINE
158+EVENTS EVENT_SCHEMA
159+FILES TABLE_SCHEMA
160+GLOBAL_STATUS VARIABLE_NAME
161+GLOBAL_TEMPORARY_TABLES TABLE_SCHEMA
162+GLOBAL_VARIABLES VARIABLE_NAME
163+KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
164+PARTITIONS TABLE_SCHEMA
165+PLUGINS PLUGIN_NAME
166+PROCESSLIST ID
167+PROFILING QUERY_ID
168+REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
169+ROUTINES ROUTINE_SCHEMA
170+QUERY_RESPONSE_TIME time
171+SCHEMATA SCHEMA_NAME
172+SCHEMA_PRIVILEGES TABLE_SCHEMA
173+SESSION_STATUS VARIABLE_NAME
174+SESSION_VARIABLES VARIABLE_NAME
175+STATISTICS TABLE_SCHEMA
176+TABLES TABLE_SCHEMA
177+TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
178+TABLE_PRIVILEGES TABLE_SCHEMA
179+TEMPORARY_TABLES TABLE_SCHEMA
180+TABLE_STATISTICS TABLE_SCHEMA
181+THREAD_STATISTICS THREAD_ID
182+TRIGGERS TRIGGER_SCHEMA
183+USER_PRIVILEGES GRANTEE
184+USER_STATISTICS USER
185+VIEWS TABLE_SCHEMA
186+INNODB_BUFFER_POOL_PAGES_INDEX index_id
187+INNODB_RSEG rseg_id
188+INNODB_CHANGED_PAGES space_id
189+INNODB_BUFFER_POOL_PAGES page_type
190+INNODB_TABLE_STATS table_schema
191+INNODB_TRX trx_id
192+XTRADB_ADMIN_COMMAND result_message
193+INNODB_LOCK_WAITS requesting_trx_id
194+INNODB_SYS_TABLES SCHEMA
195+INNODB_CMP page_size
196+INNODB_SYS_STATS INDEX_ID
197+INNODB_CMP_RESET page_size
198+INNODB_CMPMEM page_size
199+INNODB_INDEX_STATS table_schema
200+INNODB_SYS_INDEXES TABLE_ID
201+INNODB_BUFFER_POOL_PAGES_BLOB space_id
202+INNODB_CMPMEM_RESET page_size
203+INNODB_LOCKS lock_id
204+SELECT t.table_name, c1.column_name
205+FROM information_schema.tables t
206+INNER JOIN
207+information_schema.columns c1
208+ON t.table_schema = c1.table_schema AND
209+t.table_name = c1.table_name
210+WHERE t.table_schema = 'information_schema' AND
211+c1.ordinal_position =
212+( SELECT COALESCE(MIN(c2.ordinal_position),1)
213+FROM information_schema.columns c2
214+WHERE c2.table_schema = 'information_schema' AND
215+c2.table_name = t.table_name AND
216+c2.column_name LIKE '%SCHEMA%'
217+ );
218+table_name column_name
219+CHARACTER_SETS CHARACTER_SET_NAME
220+CLIENT_STATISTICS CLIENT
221+COLLATIONS COLLATION_NAME
222+COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
223+COLUMNS TABLE_SCHEMA
224+COLUMN_PRIVILEGES TABLE_SCHEMA
225+INDEX_STATISTICS TABLE_SCHEMA
226+ENGINES ENGINE
227+EVENTS EVENT_SCHEMA
228+FILES TABLE_SCHEMA
229+GLOBAL_STATUS VARIABLE_NAME
230+GLOBAL_TEMPORARY_TABLES TABLE_SCHEMA
231+GLOBAL_VARIABLES VARIABLE_NAME
232+KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
233+PARTITIONS TABLE_SCHEMA
234+PLUGINS PLUGIN_NAME
235+PROCESSLIST ID
236+PROFILING QUERY_ID
237+REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
238+ROUTINES ROUTINE_SCHEMA
239+QUERY_RESPONSE_TIME time
240+SCHEMATA SCHEMA_NAME
241+SCHEMA_PRIVILEGES TABLE_SCHEMA
242+SESSION_STATUS VARIABLE_NAME
243+SESSION_VARIABLES VARIABLE_NAME
244+STATISTICS TABLE_SCHEMA
245+TABLES TABLE_SCHEMA
246+TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
247+TABLE_PRIVILEGES TABLE_SCHEMA
248+TEMPORARY_TABLES TABLE_SCHEMA
249+TABLE_STATISTICS TABLE_SCHEMA
250+THREAD_STATISTICS THREAD_ID
251+TRIGGERS TRIGGER_SCHEMA
252+USER_PRIVILEGES GRANTEE
253+USER_STATISTICS USER
254+VIEWS TABLE_SCHEMA
255+INNODB_BUFFER_POOL_PAGES_INDEX index_id
256+INNODB_RSEG rseg_id
257+INNODB_CHANGED_PAGES space_id
258+INNODB_BUFFER_POOL_PAGES page_type
259+INNODB_TABLE_STATS table_schema
260+INNODB_TRX trx_id
261+XTRADB_ADMIN_COMMAND result_message
262+INNODB_LOCK_WAITS requesting_trx_id
263+INNODB_SYS_TABLES SCHEMA
264+INNODB_CMP page_size
265+INNODB_SYS_STATS INDEX_ID
266+INNODB_CMP_RESET page_size
267+INNODB_CMPMEM page_size
268+INNODB_INDEX_STATS table_schema
269+INNODB_SYS_INDEXES TABLE_ID
270+INNODB_BUFFER_POOL_PAGES_BLOB space_id
271+INNODB_CMPMEM_RESET page_size
272+INNODB_LOCKS lock_id
273+>>>>>>> MERGE-SOURCE
274 SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
275 MAX(table_name)
276 XTRADB_ADMIN_COMMAND
277@@ -1360,6 +1529,26 @@
278 GLOBAL_TEMPORARY_TABLES information_schema.GLOBAL_TEMPORARY_TABLES 1
279 GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
280 INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
281+<<<<<<< TREE
282+=======
283+INNODB_BUFFER_POOL_PAGES information_schema.INNODB_BUFFER_POOL_PAGES 1
284+INNODB_BUFFER_POOL_PAGES_BLOB information_schema.INNODB_BUFFER_POOL_PAGES_BLOB 1
285+INNODB_BUFFER_POOL_PAGES_INDEX information_schema.INNODB_BUFFER_POOL_PAGES_INDEX 1
286+INNODB_CHANGED_PAGES information_schema.INNODB_CHANGED_PAGES 1
287+INNODB_CMP information_schema.INNODB_CMP 1
288+INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
289+INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
290+INNODB_CMP_RESET information_schema.INNODB_CMP_RESET 1
291+INNODB_INDEX_STATS information_schema.INNODB_INDEX_STATS 1
292+INNODB_LOCKS information_schema.INNODB_LOCKS 1
293+INNODB_LOCK_WAITS information_schema.INNODB_LOCK_WAITS 1
294+INNODB_RSEG information_schema.INNODB_RSEG 1
295+INNODB_SYS_INDEXES information_schema.INNODB_SYS_INDEXES 1
296+INNODB_SYS_STATS information_schema.INNODB_SYS_STATS 1
297+INNODB_SYS_TABLES information_schema.INNODB_SYS_TABLES 1
298+INNODB_TABLE_STATS information_schema.INNODB_TABLE_STATS 1
299+INNODB_TRX information_schema.INNODB_TRX 1
300+>>>>>>> MERGE-SOURCE
301 KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
302 PARAMETERS information_schema.PARAMETERS 1
303 PARTITIONS information_schema.PARTITIONS 1
304
305=== modified file 'Percona-Server/mysql-test/r/information_schema_db.result'
306--- Percona-Server/mysql-test/r/information_schema_db.result 2012-05-10 07:49:14 +0000
307+++ Percona-Server/mysql-test/r/information_schema_db.result 2012-08-15 14:13:50 +0000
308@@ -43,7 +43,30 @@
309 USER_PRIVILEGES
310 USER_STATISTICS
311 VIEWS
312+<<<<<<< TREE
313+=======
314+INNODB_BUFFER_POOL_PAGES_INDEX
315+INNODB_RSEG
316+INNODB_CHANGED_PAGES
317+INNODB_BUFFER_POOL_PAGES
318+INNODB_TABLE_STATS
319+INNODB_TRX
320+>>>>>>> MERGE-SOURCE
321 XTRADB_ADMIN_COMMAND
322+<<<<<<< TREE
323+=======
324+INNODB_LOCK_WAITS
325+INNODB_SYS_TABLES
326+INNODB_CMP
327+INNODB_SYS_STATS
328+INNODB_CMP_RESET
329+INNODB_CMPMEM
330+INNODB_INDEX_STATS
331+INNODB_SYS_INDEXES
332+INNODB_BUFFER_POOL_PAGES_BLOB
333+INNODB_CMPMEM_RESET
334+INNODB_LOCKS
335+>>>>>>> MERGE-SOURCE
336 show tables from INFORMATION_SCHEMA like 'T%';
337 Tables_in_information_schema (T%)
338 TABLES
339
340=== modified file 'Percona-Server/mysql-test/r/mysqlshow.result'
341--- Percona-Server/mysql-test/r/mysqlshow.result 2012-07-31 05:33:11 +0000
342+++ Percona-Server/mysql-test/r/mysqlshow.result 2012-08-15 14:13:50 +0000
343@@ -119,6 +119,7 @@
344 | VIEWS |
345 | INNODB_CMPMEM_RESET |
346 | INNODB_RSEG |
347+<<<<<<< TREE
348 | INNODB_UNDO_LOGS |
349 | INNODB_CMPMEM |
350 | INNODB_SYS_TABLESTATS |
351@@ -127,7 +128,14 @@
352 | INNODB_CMP |
353 | INNODB_SYS_FOREIGN_COLS |
354 | INNODB_CMP_RESET |
355+=======
356+| INNODB_CHANGED_PAGES |
357+>>>>>>> MERGE-SOURCE
358 | INNODB_BUFFER_POOL_PAGES |
359+<<<<<<< TREE
360+=======
361+| INNODB_TABLE_STATS |
362+>>>>>>> MERGE-SOURCE
363 | INNODB_TRX |
364 | INNODB_BUFFER_POOL_PAGES_INDEX |
365 | INNODB_LOCKS |
366@@ -139,7 +147,13 @@
367 | INNODB_SYS_STATS |
368 | INNODB_SYS_FOREIGN |
369 | INNODB_SYS_INDEXES |
370+<<<<<<< TREE
371 | XTRADB_ADMIN_COMMAND |
372+=======
373+| INNODB_BUFFER_POOL_PAGES_BLOB |
374+| INNODB_CMPMEM_RESET |
375+| INNODB_LOCKS |
376+>>>>>>> MERGE-SOURCE
377 +---------------------------------------+
378 Database: INFORMATION_SCHEMA
379 +---------------------------------------+
380@@ -185,6 +199,7 @@
381 | VIEWS |
382 | INNODB_CMPMEM_RESET |
383 | INNODB_RSEG |
384+<<<<<<< TREE
385 | INNODB_UNDO_LOGS |
386 | INNODB_CMPMEM |
387 | INNODB_SYS_TABLESTATS |
388@@ -193,7 +208,14 @@
389 | INNODB_CMP |
390 | INNODB_SYS_FOREIGN_COLS |
391 | INNODB_CMP_RESET |
392+=======
393+| INNODB_CHANGED_PAGES |
394+>>>>>>> MERGE-SOURCE
395 | INNODB_BUFFER_POOL_PAGES |
396+<<<<<<< TREE
397+=======
398+| INNODB_TABLE_STATS |
399+>>>>>>> MERGE-SOURCE
400 | INNODB_TRX |
401 | INNODB_BUFFER_POOL_PAGES_INDEX |
402 | INNODB_LOCKS |
403@@ -205,7 +227,13 @@
404 | INNODB_SYS_STATS |
405 | INNODB_SYS_FOREIGN |
406 | INNODB_SYS_INDEXES |
407+<<<<<<< TREE
408 | XTRADB_ADMIN_COMMAND |
409+=======
410+| INNODB_BUFFER_POOL_PAGES_BLOB |
411+| INNODB_CMPMEM_RESET |
412+| INNODB_LOCKS |
413+>>>>>>> MERGE-SOURCE
414 +---------------------------------------+
415 Wildcard: inf_rmation_schema
416 +--------------------+
417
418=== added file 'Percona-Server/mysql-test/r/percona_server_variables_debug.result.OTHER'
419--- Percona-Server/mysql-test/r/percona_server_variables_debug.result.OTHER 1970-01-01 00:00:00 +0000
420+++ Percona-Server/mysql-test/r/percona_server_variables_debug.result.OTHER 2012-08-15 14:13:50 +0000
421@@ -0,0 +1,357 @@
422+SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
423+Variable_name
424+AUTOCOMMIT
425+AUTOMATIC_SP_PRIVILEGES
426+AUTO_INCREMENT_INCREMENT
427+AUTO_INCREMENT_OFFSET
428+BACK_LOG
429+BASEDIR
430+BIG_TABLES
431+BINLOG_CACHE_SIZE
432+BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
433+BINLOG_FORMAT
434+BULK_INSERT_BUFFER_SIZE
435+CHARACTER_SETS_DIR
436+CHARACTER_SET_CLIENT
437+CHARACTER_SET_CONNECTION
438+CHARACTER_SET_DATABASE
439+CHARACTER_SET_FILESYSTEM
440+CHARACTER_SET_RESULTS
441+CHARACTER_SET_SERVER
442+CHARACTER_SET_SYSTEM
443+COLLATION_CONNECTION
444+COLLATION_DATABASE
445+COLLATION_SERVER
446+COMPLETION_TYPE
447+CONCURRENT_INSERT
448+CONNECT_TIMEOUT
449+DATADIR
450+DATETIME_FORMAT
451+DATE_FORMAT
452+DEBUG
453+DEBUG_SYNC
454+DEFAULT_WEEK_FORMAT
455+DELAYED_INSERT_LIMIT
456+DELAYED_INSERT_TIMEOUT
457+DELAYED_QUEUE_SIZE
458+DELAY_KEY_WRITE
459+DIV_PRECISION_INCREMENT
460+ENABLE_QUERY_RESPONSE_TIME_STATS
461+ENGINE_CONDITION_PUSHDOWN
462+ERROR_COUNT
463+EVENT_SCHEDULER
464+EXPAND_FAST_INDEX_CREATION
465+EXPIRE_LOGS_DAYS
466+FAST_INDEX_CREATION
467+FLUSH
468+FLUSH_TIME
469+FOREIGN_KEY_CHECKS
470+FT_BOOLEAN_SYNTAX
471+FT_MAX_WORD_LEN
472+FT_MIN_WORD_LEN
473+FT_QUERY_EXPANSION_LIMIT
474+FT_STOPWORD_FILE
475+GENERAL_LOG
476+GENERAL_LOG_FILE
477+GROUP_CONCAT_MAX_LEN
478+HAVE_COMMUNITY_FEATURES
479+HAVE_COMPRESS
480+HAVE_CRYPT
481+HAVE_CSV
482+HAVE_DYNAMIC_LOADING
483+HAVE_GEOMETRY
484+HAVE_INNODB
485+HAVE_NDBCLUSTER
486+HAVE_OPENSSL
487+HAVE_PARTITIONING
488+HAVE_QUERY_CACHE
489+HAVE_RESPONSE_TIME_DISTRIBUTION
490+HAVE_RTREE_KEYS
491+HAVE_SSL
492+HAVE_SYMLINK
493+HOSTNAME
494+IDENTITY
495+IGNORE_BUILTIN_INNODB
496+INIT_CONNECT
497+INIT_FILE
498+INIT_SLAVE
499+INNODB_ADAPTIVE_CHECKPOINT
500+INNODB_ADAPTIVE_FLUSHING
501+INNODB_ADAPTIVE_HASH_INDEX
502+INNODB_ADDITIONAL_MEM_POOL_SIZE
503+INNODB_AUTOEXTEND_INCREMENT
504+INNODB_AUTOINC_LOCK_MODE
505+INNODB_AUTO_LRU_DUMP
506+INNODB_BLOCKING_LRU_RESTORE
507+INNODB_BUFFER_POOL_SHM_CHECKSUM
508+INNODB_BUFFER_POOL_SHM_KEY
509+INNODB_BUFFER_POOL_SIZE
510+INNODB_CHANGED_PAGES_LIMIT
511+INNODB_CHANGE_BUFFERING
512+INNODB_CHECKPOINT_AGE_TARGET
513+INNODB_CHECKSUMS
514+INNODB_COMMIT_CONCURRENCY
515+INNODB_CONCURRENCY_TICKETS
516+INNODB_DATA_FILE_PATH
517+INNODB_DATA_HOME_DIR
518+INNODB_DICT_SIZE_LIMIT
519+INNODB_DOUBLEWRITE
520+INNODB_DOUBLEWRITE_FILE
521+INNODB_ENABLE_UNSAFE_GROUP_COMMIT
522+INNODB_EXPAND_IMPORT
523+INNODB_EXTRA_RSEGMENTS
524+INNODB_EXTRA_UNDOSLOTS
525+INNODB_FAKE_CHANGES
526+INNODB_FAST_CHECKSUM
527+INNODB_FAST_RECOVERY
528+INNODB_FAST_SHUTDOWN
529+INNODB_FILE_FORMAT
530+INNODB_FILE_FORMAT_CHECK
531+INNODB_FILE_PER_TABLE
532+INNODB_FLUSH_LOG_AT_TRX_COMMIT
533+INNODB_FLUSH_LOG_AT_TRX_COMMIT_SESSION
534+INNODB_FLUSH_METHOD
535+INNODB_FLUSH_NEIGHBOR_PAGES
536+INNODB_FORCE_RECOVERY
537+INNODB_IBUF_ACCEL_RATE
538+INNODB_IBUF_ACTIVE_CONTRACT
539+INNODB_IBUF_MAX_SIZE
540+INNODB_IO_CAPACITY
541+INNODB_KILL_IDLE_TRANSACTION
542+INNODB_LAZY_DROP_TABLE
543+INNODB_LOCKS_UNSAFE_FOR_BINLOG
544+INNODB_LOCK_WAIT_TIMEOUT
545+INNODB_LOG_BLOCK_SIZE
546+INNODB_LOG_BUFFER_SIZE
547+INNODB_LOG_FILES_IN_GROUP
548+INNODB_LOG_FILE_SIZE
549+INNODB_LOG_GROUP_HOME_DIR
550+INNODB_MAX_DIRTY_PAGES_PCT
551+INNODB_MAX_PURGE_LAG
552+INNODB_MIRRORED_LOG_GROUPS
553+INNODB_OLD_BLOCKS_PCT
554+INNODB_OLD_BLOCKS_TIME
555+INNODB_OPEN_FILES
556+INNODB_OVERWRITE_RELAY_LOG_INFO
557+INNODB_PAGE_SIZE
558+INNODB_PASS_CORRUPT_TABLE
559+INNODB_RANDOM_READ_AHEAD
560+INNODB_READ_AHEAD
561+INNODB_READ_AHEAD_THRESHOLD
562+INNODB_READ_IO_THREADS
563+INNODB_RECOVERY_STATS
564+INNODB_REPLICATION_DELAY
565+INNODB_ROLLBACK_ON_TIMEOUT
566+INNODB_SHOW_LOCKS_HELD
567+INNODB_SHOW_VERBOSE_LOCKS
568+INNODB_SPIN_WAIT_DELAY
569+INNODB_STATS_AUTO_UPDATE
570+INNODB_STATS_METHOD
571+INNODB_STATS_ON_METADATA
572+INNODB_STATS_SAMPLE_PAGES
573+INNODB_STATS_UPDATE_NEED_LOCK
574+INNODB_STRICT_MODE
575+INNODB_SUPPORT_XA
576+INNODB_SYNC_SPIN_LOOPS
577+INNODB_TABLE_LOCKS
578+INNODB_THREAD_CONCURRENCY
579+INNODB_THREAD_CONCURRENCY_TIMER_BASED
580+INNODB_THREAD_SLEEP_DELAY
581+INNODB_TRACK_CHANGED_PAGES
582+INNODB_USE_PURGE_THREAD
583+INNODB_USE_SYS_MALLOC
584+INNODB_USE_SYS_STATS_TABLE
585+INNODB_VERSION
586+INNODB_WRITE_IO_THREADS
587+INSERT_ID
588+INTERACTIVE_TIMEOUT
589+JOIN_BUFFER_SIZE
590+KEEP_FILES_ON_CREATE
591+KEY_BUFFER_SIZE
592+KEY_CACHE_AGE_THRESHOLD
593+KEY_CACHE_BLOCK_SIZE
594+KEY_CACHE_DIVISION_LIMIT
595+LANGUAGE
596+LARGE_FILES_SUPPORT
597+LARGE_PAGES
598+LARGE_PAGE_SIZE
599+LAST_INSERT_ID
600+LC_TIME_NAMES
601+LICENSE
602+LOCAL_INFILE
603+LOCKED_IN_MEMORY
604+LOG
605+LOG_BIN
606+LOG_BIN_TRUST_FUNCTION_CREATORS
607+LOG_BIN_TRUST_ROUTINE_CREATORS
608+LOG_ERROR
609+LOG_OUTPUT
610+LOG_QUERIES_NOT_USING_INDEXES
611+LOG_SLAVE_UPDATES
612+LOG_SLOW_ADMIN_STATEMENTS
613+LOG_SLOW_FILTER
614+LOG_SLOW_QUERIES
615+LOG_SLOW_RATE_LIMIT
616+LOG_SLOW_SLAVE_STATEMENTS
617+LOG_SLOW_SP_STATEMENTS
618+LOG_SLOW_TIMESTAMP_EVERY
619+LOG_SLOW_VERBOSITY
620+LOG_WARNINGS
621+LONG_QUERY_TIME
622+LOWER_CASE_FILE_SYSTEM
623+LOWER_CASE_TABLE_NAMES
624+LOW_PRIORITY_UPDATES
625+MAX_ALLOWED_PACKET
626+MAX_BINLOG_CACHE_SIZE
627+MAX_BINLOG_SIZE
628+MAX_CONNECTIONS
629+MAX_CONNECT_ERRORS
630+MAX_DELAYED_THREADS
631+MAX_ERROR_COUNT
632+MAX_HEAP_TABLE_SIZE
633+MAX_INSERT_DELAYED_THREADS
634+MAX_JOIN_SIZE
635+MAX_LENGTH_FOR_SORT_DATA
636+MAX_LONG_DATA_SIZE
637+MAX_PREPARED_STMT_COUNT
638+MAX_RELAY_LOG_SIZE
639+MAX_SEEKS_FOR_KEY
640+MAX_SORT_LENGTH
641+MAX_SP_RECURSION_DEPTH
642+MAX_TMP_TABLES
643+MAX_USER_CONNECTIONS
644+MAX_WRITE_LOCK_COUNT
645+MIN_EXAMINED_ROW_LIMIT
646+MULTI_RANGE_COUNT
647+MYISAM_DATA_POINTER_SIZE
648+MYISAM_MAX_SORT_FILE_SIZE
649+MYISAM_MMAP_SIZE
650+MYISAM_RECOVER_OPTIONS
651+MYISAM_REPAIR_THREADS
652+MYISAM_SORT_BUFFER_SIZE
653+MYISAM_STATS_METHOD
654+MYISAM_USE_MMAP
655+NET_BUFFER_LENGTH
656+NET_READ_TIMEOUT
657+NET_RETRY_COUNT
658+NET_WRITE_TIMEOUT
659+NEW
660+OLD
661+OLD_ALTER_TABLE
662+OLD_PASSWORDS
663+OPEN_FILES_LIMIT
664+OPTIMIZER_FIX
665+OPTIMIZER_PRUNE_LEVEL
666+OPTIMIZER_SEARCH_DEPTH
667+OPTIMIZER_SWITCH
668+PID_FILE
669+PLUGIN_DIR
670+PORT
671+PRELOAD_BUFFER_SIZE
672+PROFILING
673+PROFILING_HISTORY_SIZE
674+PROFILING_SERVER
675+PROFILING_USE_GETRUSAGE
676+PROTOCOL_VERSION
677+PSEUDO_THREAD_ID
678+QUERY_ALLOC_BLOCK_SIZE
679+QUERY_CACHE_LIMIT
680+QUERY_CACHE_MIN_RES_UNIT
681+QUERY_CACHE_SIZE
682+QUERY_CACHE_STRIP_COMMENTS
683+QUERY_CACHE_TYPE
684+QUERY_CACHE_WLOCK_INVALIDATE
685+QUERY_EXEC_TIME
686+QUERY_PREALLOC_SIZE
687+QUERY_RESPONSE_TIME_RANGE_BASE
688+RAND_SEED1
689+RAND_SEED2
690+RANGE_ALLOC_BLOCK_SIZE
691+READ_BUFFER_SIZE
692+READ_ONLY
693+READ_RND_BUFFER_SIZE
694+RELAY_LOG
695+RELAY_LOG_INDEX
696+RELAY_LOG_INFO_FILE
697+RELAY_LOG_PURGE
698+RELAY_LOG_SPACE_LIMIT
699+REPORT_HOST
700+REPORT_PASSWORD
701+REPORT_PORT
702+REPORT_USER
703+RPL_RECOVERY_RANK
704+SECURE_AUTH
705+SECURE_FILE_PRIV
706+SERVER_ID
707+SKIP_EXTERNAL_LOCKING
708+SKIP_NAME_RESOLVE
709+SKIP_NETWORKING
710+SKIP_SHOW_DATABASE
711+SLAVE_COMPRESSED_PROTOCOL
712+SLAVE_EXEC_MODE
713+SLAVE_LOAD_TMPDIR
714+SLAVE_NET_TIMEOUT
715+SLAVE_SKIP_ERRORS
716+SLAVE_TRANSACTION_RETRIES
717+SLOW_LAUNCH_TIME
718+SLOW_QUERY_LOG
719+SLOW_QUERY_LOG_FILE
720+SLOW_QUERY_LOG_LOCK_TIME
721+SLOW_QUERY_LOG_MICROSECONDS_TIMESTAMP
722+SLOW_QUERY_LOG_QUERY_TIME
723+SOCKET
724+SORT_BUFFER_SIZE
725+SQL_AUTO_IS_NULL
726+SQL_BIG_SELECTS
727+SQL_BIG_TABLES
728+SQL_BUFFER_RESULT
729+SQL_LOG_BIN
730+SQL_LOG_OFF
731+SQL_LOG_UPDATE
732+SQL_LOW_PRIORITY_UPDATES
733+SQL_MAX_JOIN_SIZE
734+SQL_MODE
735+SQL_NOTES
736+SQL_QUOTE_SHOW_CREATE
737+SQL_SAFE_UPDATES
738+SQL_SELECT_LIMIT
739+SQL_SLAVE_SKIP_COUNTER
740+SQL_WARNINGS
741+SSL_CA
742+SSL_CAPATH
743+SSL_CERT
744+SSL_CIPHER
745+SSL_KEY
746+STORAGE_ENGINE
747+SUPPRESS_LOG_WARNING_1592
748+SYNC_BINLOG
749+SYNC_FRM
750+SYSTEM_TIME_ZONE
751+TABLE_DEFINITION_CACHE
752+TABLE_LOCK_WAIT_TIMEOUT
753+TABLE_OPEN_CACHE
754+TABLE_TYPE
755+THREAD_CACHE_SIZE
756+THREAD_HANDLING
757+THREAD_STACK
758+THREAD_STATISTICS
759+TIMED_MUTEXES
760+TIMESTAMP
761+TIME_FORMAT
762+TIME_ZONE
763+TMPDIR
764+TMP_TABLE_SIZE
765+TRANSACTION_ALLOC_BLOCK_SIZE
766+TRANSACTION_PREALLOC_SIZE
767+TX_ISOLATION
768+UNIQUE_CHECKS
769+UPDATABLE_VIEWS_WITH_LIMIT
770+USERSTAT_RUNNING
771+USE_GLOBAL_LOG_SLOW_CONTROL
772+USE_GLOBAL_LONG_QUERY_TIME
773+VERSION
774+VERSION_COMMENT
775+VERSION_COMPILE_MACHINE
776+VERSION_COMPILE_OS
777+WAIT_TIMEOUT
778+WARNING_COUNT
779
780=== added file 'Percona-Server/mysql-test/r/percona_server_variables_release.result.OTHER'
781--- Percona-Server/mysql-test/r/percona_server_variables_release.result.OTHER 1970-01-01 00:00:00 +0000
782+++ Percona-Server/mysql-test/r/percona_server_variables_release.result.OTHER 2012-08-15 14:13:50 +0000
783@@ -0,0 +1,352 @@
784+SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
785+Variable_name
786+AUTOCOMMIT
787+AUTOMATIC_SP_PRIVILEGES
788+AUTO_INCREMENT_INCREMENT
789+AUTO_INCREMENT_OFFSET
790+BACK_LOG
791+BASEDIR
792+BIG_TABLES
793+BINLOG_CACHE_SIZE
794+BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
795+BINLOG_FORMAT
796+BULK_INSERT_BUFFER_SIZE
797+CHARACTER_SETS_DIR
798+CHARACTER_SET_CLIENT
799+CHARACTER_SET_CONNECTION
800+CHARACTER_SET_DATABASE
801+CHARACTER_SET_FILESYSTEM
802+CHARACTER_SET_RESULTS
803+CHARACTER_SET_SERVER
804+CHARACTER_SET_SYSTEM
805+COLLATION_CONNECTION
806+COLLATION_DATABASE
807+COLLATION_SERVER
808+COMPLETION_TYPE
809+CONCURRENT_INSERT
810+CONNECT_TIMEOUT
811+DATADIR
812+DATETIME_FORMAT
813+DATE_FORMAT
814+DEFAULT_WEEK_FORMAT
815+DELAYED_INSERT_LIMIT
816+DELAYED_INSERT_TIMEOUT
817+DELAYED_QUEUE_SIZE
818+DELAY_KEY_WRITE
819+DIV_PRECISION_INCREMENT
820+ENABLE_QUERY_RESPONSE_TIME_STATS
821+ENGINE_CONDITION_PUSHDOWN
822+ERROR_COUNT
823+EVENT_SCHEDULER
824+EXPAND_FAST_INDEX_CREATION
825+EXPIRE_LOGS_DAYS
826+FAST_INDEX_CREATION
827+FLUSH
828+FLUSH_TIME
829+FOREIGN_KEY_CHECKS
830+FT_BOOLEAN_SYNTAX
831+FT_MAX_WORD_LEN
832+FT_MIN_WORD_LEN
833+FT_QUERY_EXPANSION_LIMIT
834+FT_STOPWORD_FILE
835+GENERAL_LOG
836+GENERAL_LOG_FILE
837+GROUP_CONCAT_MAX_LEN
838+HAVE_COMMUNITY_FEATURES
839+HAVE_COMPRESS
840+HAVE_CRYPT
841+HAVE_CSV
842+HAVE_DYNAMIC_LOADING
843+HAVE_GEOMETRY
844+HAVE_INNODB
845+HAVE_NDBCLUSTER
846+HAVE_OPENSSL
847+HAVE_PARTITIONING
848+HAVE_QUERY_CACHE
849+HAVE_RESPONSE_TIME_DISTRIBUTION
850+HAVE_RTREE_KEYS
851+HAVE_SSL
852+HAVE_SYMLINK
853+HOSTNAME
854+IDENTITY
855+IGNORE_BUILTIN_INNODB
856+INIT_CONNECT
857+INIT_FILE
858+INIT_SLAVE
859+INNODB_ADAPTIVE_CHECKPOINT
860+INNODB_ADAPTIVE_FLUSHING
861+INNODB_ADAPTIVE_HASH_INDEX
862+INNODB_ADDITIONAL_MEM_POOL_SIZE
863+INNODB_AUTOEXTEND_INCREMENT
864+INNODB_AUTOINC_LOCK_MODE
865+INNODB_AUTO_LRU_DUMP
866+INNODB_BLOCKING_LRU_RESTORE
867+INNODB_BUFFER_POOL_SHM_CHECKSUM
868+INNODB_BUFFER_POOL_SHM_KEY
869+INNODB_BUFFER_POOL_SIZE
870+INNODB_CHANGED_PAGES_LIMIT
871+INNODB_CHANGE_BUFFERING
872+INNODB_CHECKPOINT_AGE_TARGET
873+INNODB_CHECKSUMS
874+INNODB_COMMIT_CONCURRENCY
875+INNODB_CONCURRENCY_TICKETS
876+INNODB_DATA_FILE_PATH
877+INNODB_DATA_HOME_DIR
878+INNODB_DICT_SIZE_LIMIT
879+INNODB_DOUBLEWRITE
880+INNODB_DOUBLEWRITE_FILE
881+INNODB_ENABLE_UNSAFE_GROUP_COMMIT
882+INNODB_EXPAND_IMPORT
883+INNODB_EXTRA_RSEGMENTS
884+INNODB_EXTRA_UNDOSLOTS
885+INNODB_FAKE_CHANGES
886+INNODB_FAST_CHECKSUM
887+INNODB_FAST_RECOVERY
888+INNODB_FAST_SHUTDOWN
889+INNODB_FILE_FORMAT
890+INNODB_FILE_FORMAT_CHECK
891+INNODB_FILE_PER_TABLE
892+INNODB_FLUSH_LOG_AT_TRX_COMMIT
893+INNODB_FLUSH_LOG_AT_TRX_COMMIT_SESSION
894+INNODB_FLUSH_METHOD
895+INNODB_FLUSH_NEIGHBOR_PAGES
896+INNODB_FORCE_RECOVERY
897+INNODB_IBUF_ACCEL_RATE
898+INNODB_IBUF_ACTIVE_CONTRACT
899+INNODB_IBUF_MAX_SIZE
900+INNODB_IO_CAPACITY
901+INNODB_KILL_IDLE_TRANSACTION
902+INNODB_LAZY_DROP_TABLE
903+INNODB_LOCKS_UNSAFE_FOR_BINLOG
904+INNODB_LOCK_WAIT_TIMEOUT
905+INNODB_LOG_BLOCK_SIZE
906+INNODB_LOG_BUFFER_SIZE
907+INNODB_LOG_FILES_IN_GROUP
908+INNODB_LOG_FILE_SIZE
909+INNODB_LOG_GROUP_HOME_DIR
910+INNODB_MAX_DIRTY_PAGES_PCT
911+INNODB_MAX_PURGE_LAG
912+INNODB_MIRRORED_LOG_GROUPS
913+INNODB_OLD_BLOCKS_PCT
914+INNODB_OLD_BLOCKS_TIME
915+INNODB_OPEN_FILES
916+INNODB_OVERWRITE_RELAY_LOG_INFO
917+INNODB_PAGE_SIZE
918+INNODB_PASS_CORRUPT_TABLE
919+INNODB_RANDOM_READ_AHEAD
920+INNODB_READ_AHEAD
921+INNODB_READ_AHEAD_THRESHOLD
922+INNODB_READ_IO_THREADS
923+INNODB_RECOVERY_STATS
924+INNODB_REPLICATION_DELAY
925+INNODB_ROLLBACK_ON_TIMEOUT
926+INNODB_SHOW_LOCKS_HELD
927+INNODB_SHOW_VERBOSE_LOCKS
928+INNODB_SPIN_WAIT_DELAY
929+INNODB_STATS_AUTO_UPDATE
930+INNODB_STATS_METHOD
931+INNODB_STATS_ON_METADATA
932+INNODB_STATS_SAMPLE_PAGES
933+INNODB_STATS_UPDATE_NEED_LOCK
934+INNODB_STRICT_MODE
935+INNODB_SUPPORT_XA
936+INNODB_SYNC_SPIN_LOOPS
937+INNODB_TABLE_LOCKS
938+INNODB_THREAD_CONCURRENCY
939+INNODB_THREAD_CONCURRENCY_TIMER_BASED
940+INNODB_THREAD_SLEEP_DELAY
941+INNODB_TRACK_CHANGED_PAGES
942+INNODB_USE_PURGE_THREAD
943+INNODB_USE_SYS_MALLOC
944+INNODB_USE_SYS_STATS_TABLE
945+INNODB_VERSION
946+INNODB_WRITE_IO_THREADS
947+INSERT_ID
948+INTERACTIVE_TIMEOUT
949+JOIN_BUFFER_SIZE
950+KEEP_FILES_ON_CREATE
951+KEY_BUFFER_SIZE
952+KEY_CACHE_AGE_THRESHOLD
953+KEY_CACHE_BLOCK_SIZE
954+KEY_CACHE_DIVISION_LIMIT
955+LANGUAGE
956+LARGE_FILES_SUPPORT
957+LARGE_PAGES
958+LARGE_PAGE_SIZE
959+LAST_INSERT_ID
960+LC_TIME_NAMES
961+LICENSE
962+LOCAL_INFILE
963+LOCKED_IN_MEMORY
964+LOG
965+LOG_BIN
966+LOG_BIN_TRUST_FUNCTION_CREATORS
967+LOG_BIN_TRUST_ROUTINE_CREATORS
968+LOG_ERROR
969+LOG_OUTPUT
970+LOG_QUERIES_NOT_USING_INDEXES
971+LOG_SLAVE_UPDATES
972+LOG_SLOW_ADMIN_STATEMENTS
973+LOG_SLOW_FILTER
974+LOG_SLOW_QUERIES
975+LOG_SLOW_RATE_LIMIT
976+LOG_SLOW_SLAVE_STATEMENTS
977+LOG_SLOW_SP_STATEMENTS
978+LOG_SLOW_TIMESTAMP_EVERY
979+LOG_SLOW_VERBOSITY
980+LOG_WARNINGS
981+LONG_QUERY_TIME
982+LOWER_CASE_FILE_SYSTEM
983+LOWER_CASE_TABLE_NAMES
984+LOW_PRIORITY_UPDATES
985+MAX_ALLOWED_PACKET
986+MAX_BINLOG_CACHE_SIZE
987+MAX_BINLOG_SIZE
988+MAX_CONNECTIONS
989+MAX_CONNECT_ERRORS
990+MAX_DELAYED_THREADS
991+MAX_ERROR_COUNT
992+MAX_HEAP_TABLE_SIZE
993+MAX_INSERT_DELAYED_THREADS
994+MAX_JOIN_SIZE
995+MAX_LENGTH_FOR_SORT_DATA
996+MAX_LONG_DATA_SIZE
997+MAX_PREPARED_STMT_COUNT
998+MAX_RELAY_LOG_SIZE
999+MAX_SEEKS_FOR_KEY
1000+MAX_SORT_LENGTH
1001+MAX_SP_RECURSION_DEPTH
1002+MAX_TMP_TABLES
1003+MAX_USER_CONNECTIONS
1004+MAX_WRITE_LOCK_COUNT
1005+MIN_EXAMINED_ROW_LIMIT
1006+MULTI_RANGE_COUNT
1007+MYISAM_DATA_POINTER_SIZE
1008+MYISAM_MAX_SORT_FILE_SIZE
1009+MYISAM_MMAP_SIZE
1010+MYISAM_RECOVER_OPTIONS
1011+MYISAM_REPAIR_THREADS
1012+MYISAM_SORT_BUFFER_SIZE
1013+MYISAM_STATS_METHOD
1014+MYISAM_USE_MMAP
1015+NET_BUFFER_LENGTH
1016+NET_READ_TIMEOUT
1017+NET_RETRY_COUNT
1018+NET_WRITE_TIMEOUT
1019+NEW
1020+OLD
1021+OLD_ALTER_TABLE
1022+OLD_PASSWORDS
1023+OPEN_FILES_LIMIT
1024+OPTIMIZER_FIX
1025+OPTIMIZER_PRUNE_LEVEL
1026+OPTIMIZER_SEARCH_DEPTH
1027+OPTIMIZER_SWITCH
1028+PID_FILE
1029+PLUGIN_DIR
1030+PORT
1031+PRELOAD_BUFFER_SIZE
1032+PROFILING
1033+PROFILING_HISTORY_SIZE
1034+PROFILING_SERVER
1035+PROFILING_USE_GETRUSAGE
1036+PROTOCOL_VERSION
1037+PSEUDO_THREAD_ID
1038+QUERY_ALLOC_BLOCK_SIZE
1039+QUERY_CACHE_LIMIT
1040+QUERY_CACHE_MIN_RES_UNIT
1041+QUERY_CACHE_SIZE
1042+QUERY_CACHE_STRIP_COMMENTS
1043+QUERY_CACHE_TYPE
1044+QUERY_CACHE_WLOCK_INVALIDATE
1045+QUERY_PREALLOC_SIZE
1046+QUERY_RESPONSE_TIME_RANGE_BASE
1047+RAND_SEED1
1048+RAND_SEED2
1049+RANGE_ALLOC_BLOCK_SIZE
1050+READ_BUFFER_SIZE
1051+READ_ONLY
1052+READ_RND_BUFFER_SIZE
1053+RELAY_LOG
1054+RELAY_LOG_INDEX
1055+RELAY_LOG_INFO_FILE
1056+RELAY_LOG_PURGE
1057+RELAY_LOG_SPACE_LIMIT
1058+REPORT_HOST
1059+REPORT_PASSWORD
1060+REPORT_PORT
1061+REPORT_USER
1062+RPL_RECOVERY_RANK
1063+SECURE_AUTH
1064+SECURE_FILE_PRIV
1065+SERVER_ID
1066+SKIP_EXTERNAL_LOCKING
1067+SKIP_NAME_RESOLVE
1068+SKIP_NETWORKING
1069+SKIP_SHOW_DATABASE
1070+SLAVE_COMPRESSED_PROTOCOL
1071+SLAVE_EXEC_MODE
1072+SLAVE_LOAD_TMPDIR
1073+SLAVE_NET_TIMEOUT
1074+SLAVE_SKIP_ERRORS
1075+SLAVE_TRANSACTION_RETRIES
1076+SLOW_LAUNCH_TIME
1077+SLOW_QUERY_LOG
1078+SLOW_QUERY_LOG_FILE
1079+SLOW_QUERY_LOG_MICROSECONDS_TIMESTAMP
1080+SOCKET
1081+SORT_BUFFER_SIZE
1082+SQL_AUTO_IS_NULL
1083+SQL_BIG_SELECTS
1084+SQL_BIG_TABLES
1085+SQL_BUFFER_RESULT
1086+SQL_LOG_BIN
1087+SQL_LOG_OFF
1088+SQL_LOG_UPDATE
1089+SQL_LOW_PRIORITY_UPDATES
1090+SQL_MAX_JOIN_SIZE
1091+SQL_MODE
1092+SQL_NOTES
1093+SQL_QUOTE_SHOW_CREATE
1094+SQL_SAFE_UPDATES
1095+SQL_SELECT_LIMIT
1096+SQL_SLAVE_SKIP_COUNTER
1097+SQL_WARNINGS
1098+SSL_CA
1099+SSL_CAPATH
1100+SSL_CERT
1101+SSL_CIPHER
1102+SSL_KEY
1103+STORAGE_ENGINE
1104+SUPPRESS_LOG_WARNING_1592
1105+SYNC_BINLOG
1106+SYNC_FRM
1107+SYSTEM_TIME_ZONE
1108+TABLE_DEFINITION_CACHE
1109+TABLE_LOCK_WAIT_TIMEOUT
1110+TABLE_OPEN_CACHE
1111+TABLE_TYPE
1112+THREAD_CACHE_SIZE
1113+THREAD_HANDLING
1114+THREAD_STACK
1115+THREAD_STATISTICS
1116+TIMED_MUTEXES
1117+TIMESTAMP
1118+TIME_FORMAT
1119+TIME_ZONE
1120+TMPDIR
1121+TMP_TABLE_SIZE
1122+TRANSACTION_ALLOC_BLOCK_SIZE
1123+TRANSACTION_PREALLOC_SIZE
1124+TX_ISOLATION
1125+UNIQUE_CHECKS
1126+UPDATABLE_VIEWS_WITH_LIMIT
1127+USERSTAT_RUNNING
1128+USE_GLOBAL_LOG_SLOW_CONTROL
1129+USE_GLOBAL_LONG_QUERY_TIME
1130+VERSION
1131+VERSION_COMMENT
1132+VERSION_COMPILE_MACHINE
1133+VERSION_COMPILE_OS
1134+WAIT_TIMEOUT
1135+WARNING_COUNT
1136
1137=== added directory 'Percona-Server/mysql-test/suite/innodb_plugin'
1138=== added directory 'Percona-Server/mysql-test/suite/innodb_plugin/r'
1139=== renamed file 'Percona-Server/mysql-test/suite/innodb/r/percona_bug_951588.result' => 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_bug_951588.result'
1140=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp.result'
1141--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp.result 1970-01-01 00:00:00 +0000
1142+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp.result 2012-08-15 14:13:50 +0000
1143@@ -0,0 +1,21 @@
1144+DROP TABLE IF EXISTS t1, t2;
1145+CREATE TABLE t1 (x INT) ENGINE=InnoDB;
1146+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
1147+INSERT INTO t1 SELECT x FROM t1;
1148+INSERT INTO t1 SELECT x FROM t1;
1149+INSERT INTO t1 SELECT x FROM t1;
1150+INSERT INTO t1 SELECT x FROM t1;
1151+INSERT INTO t1 SELECT x FROM t1;
1152+INSERT INTO t1 SELECT x FROM t1;
1153+INSERT INTO t1 SELECT x FROM t1;
1154+INSERT INTO t1 SELECT x FROM t1;
1155+INSERT INTO t1 SELECT x FROM t1;
1156+INSERT INTO t1 SELECT x FROM t1;
1157+INSERT INTO t1 SELECT x FROM t1;
1158+INSERT INTO t1 SELECT x FROM t1;
1159+CREATE TABLE t2 (x INT) ENGINE=InnoDB;
1160+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
1161+INSERT INTO t1 SELECT x FROM t1;
1162+SET GLOBAL INNODB_FAST_SHUTDOWN=2;
1163+call mtr.add_suppression("InnoDB: Warning: truncated block detected.*");
1164+DROP TABLE t1, t2;
1165
1166=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_no_restart.result'
1167--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_no_restart.result 1970-01-01 00:00:00 +0000
1168+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_no_restart.result 2012-08-15 14:13:50 +0000
1169@@ -0,0 +1,6 @@
1170+DROP TABLE IF EXISTS t1, t2;
1171+CREATE TABLE t1 (x INT) ENGINE=InnoDB;
1172+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
1173+CREATE TABLE t2 (x INT) ENGINE=InnoDB;
1174+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
1175+DROP TABLE t1, t2;
1176
1177=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages.result'
1178--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages.result 1970-01-01 00:00:00 +0000
1179+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages.result 2012-08-15 14:13:50 +0000
1180@@ -0,0 +1,41 @@
1181+SELECT @@innodb_track_changed_pages;
1182+@@innodb_track_changed_pages
1183+1
1184+SET @OLD_INNODB_CHANGED_PAGES_LIMIT = @@GLOBAL.INNODB_CHANGED_PAGES_LIMIT;
1185+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
1186+CREATE TABLE T1 (F1 CHAR(255)) ENGINE=INNODB;
1187+SET @t1_space_id =
1188+(SELECT SPACE
1189+FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
1190+WHERE
1191+INFORMATION_SCHEMA.INNODB_SYS_TABLES.SCHEMA='test' AND
1192+INFORMATION_SCHEMA.INNODB_SYS_TABLES.NAME='T1');
1193+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
1194+SELECT COUNT(DISTINCT PAGE_ID) >= (1024000/16384)
1195+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1196+WHERE SPACE_ID = @t1_space_id;
1197+COUNT(DISTINCT PAGE_ID) >= (1024000/16384)
1198+1
1199+SELECT MAX(PAGE_ID) < (3*1024000/16384)
1200+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1201+WHERE SPACE_ID = @t1_space_id;
1202+MAX(PAGE_ID) < (3*1024000/16384)
1203+1
1204+SELECT COUNT(*)
1205+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1206+WHERE START_LSN >= END_LSN;
1207+COUNT(*)
1208+0
1209+SELECT COUNT(*) = @cond_test_pages_count
1210+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1211+WHERE
1212+END_LSN > (@cond_test_lsn - 1) AND
1213+END_LSN < (@cond_test_lsn + 1);
1214+COUNT(*) = @cond_test_pages_count
1215+1
1216+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 1;
1217+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
1218+COUNT(*)
1219+1
1220+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = @OLD_INNODB_CHANGED_PAGES_LIMIT;
1221+DROP TABLE T1;
1222
1223=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages_empty.result'
1224--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages_empty.result 1970-01-01 00:00:00 +0000
1225+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages_empty.result 2012-08-15 14:13:50 +0000
1226@@ -0,0 +1,2 @@
1227+SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
1228+space_id page_id start_lsn end_lsn
1229
1230=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result'
1231--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result 1970-01-01 00:00:00 +0000
1232+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result 2012-08-15 14:13:50 +0000
1233@@ -0,0 +1,94 @@
1234+SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'INNODB%' ORDER BY TABLE_NAME;
1235+TABLE_NAME
1236+INNODB_BUFFER_POOL_PAGES
1237+INNODB_BUFFER_POOL_PAGES_BLOB
1238+INNODB_BUFFER_POOL_PAGES_INDEX
1239+INNODB_CHANGED_PAGES
1240+INNODB_CMP
1241+INNODB_CMPMEM
1242+INNODB_CMPMEM_RESET
1243+INNODB_CMP_RESET
1244+INNODB_INDEX_STATS
1245+INNODB_LOCKS
1246+INNODB_LOCK_WAITS
1247+INNODB_RSEG
1248+INNODB_SYS_INDEXES
1249+INNODB_SYS_STATS
1250+INNODB_SYS_TABLES
1251+INNODB_TABLE_STATS
1252+INNODB_TRX
1253+SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'XTRADB%' ORDER BY TABLE_NAME;
1254+TABLE_NAME
1255+XTRADB_ADMIN_COMMAND
1256+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
1257+index_id space_id page_no n_recs data_size hashed access_time modified dirty old lru_position fix_count flush_type
1258+Warnings:
1259+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX but the InnoDB storage engine is not installed
1260+SELECT * FROM INFORMATION_SCHEMA.INNODB_RSEG;
1261+rseg_id space_id zip_size page_no max_size curr_size
1262+Warnings:
1263+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_RSEG but the InnoDB storage engine is not installed
1264+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP;
1265+page_size compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
1266+Warnings:
1267+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMP but the InnoDB storage engine is not installed
1268+SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
1269+trx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query
1270+Warnings:
1271+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_TRX but the InnoDB storage engine is not installed
1272+SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
1273+requesting_trx_id requested_lock_id blocking_trx_id blocking_lock_id
1274+Warnings:
1275+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_LOCK_WAITS but the InnoDB storage engine is not installed
1276+SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
1277+lock_id lock_trx_id lock_mode lock_type lock_table lock_index lock_space lock_page lock_rec lock_data
1278+Warnings:
1279+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_LOCKS but the InnoDB storage engine is not installed
1280+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_RESET;
1281+page_size compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
1282+Warnings:
1283+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMP_RESET but the InnoDB storage engine is not installed
1284+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES;
1285+page_type space_id page_no lru_position fix_count flush_type
1286+Warnings:
1287+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES but the InnoDB storage engine is not installed
1288+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
1289+SCHEMA NAME ID N_COLS TYPE MIX_ID MIX_LEN CLUSTER_NAME SPACE
1290+Warnings:
1291+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_SYS_TABLES but the InnoDB storage engine is not installed
1292+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
1293+index_id space_id page_no n_recs data_size hashed access_time modified dirty old lru_position fix_count flush_type
1294+Warnings:
1295+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX but the InnoDB storage engine is not installed
1296+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM;
1297+page_size pages_used pages_free relocation_ops relocation_time
1298+Warnings:
1299+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMPMEM but the InnoDB storage engine is not installed
1300+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB;
1301+space_id page_no compressed part_len next_page_no lru_position fix_count flush_type
1302+Warnings:
1303+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB but the InnoDB storage engine is not installed
1304+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM_RESET;
1305+page_size pages_used pages_free relocation_ops relocation_time
1306+Warnings:
1307+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMPMEM_RESET but the InnoDB storage engine is not installed
1308+SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLE_STATS;
1309+table_schema table_name rows clust_size other_size modified
1310+Warnings:
1311+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_TABLE_STATS but the InnoDB storage engine is not installed
1312+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_STATS;
1313+INDEX_ID KEY_COLS DIFF_VALS NON_NULL_VALS
1314+Warnings:
1315+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_SYS_STATS but the InnoDB storage engine is not installed
1316+SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEX_STATS;
1317+table_schema table_name index_name fields row_per_keys index_size leaf_pages
1318+Warnings:
1319+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_INDEX_STATS but the InnoDB storage engine is not installed
1320+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
1321+TABLE_ID ID NAME N_FIELDS TYPE SPACE PAGE_NO
1322+Warnings:
1323+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_SYS_INDEXES but the InnoDB storage engine is not installed
1324+SELECT * FROM INFORMATION_SCHEMA.XTRADB_ADMIN_COMMAND;
1325+result_message
1326+Warnings:
1327+Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.XTRADB_ADMIN_COMMAND but the InnoDB storage engine is not installed
1328
1329=== added directory 'Percona-Server/mysql-test/suite/innodb_plugin/t'
1330=== renamed file 'Percona-Server/mysql-test/suite/innodb/t/percona_bug_951588.test' => 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test'
1331--- Percona-Server/mysql-test/suite/innodb/t/percona_bug_951588.test 2012-06-07 11:22:38 +0000
1332+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test 2012-08-15 14:13:50 +0000
1333@@ -1,3 +1,4 @@
1334+<<<<<<< TREE
1335 # Test for bug 951588 (Querying I_S.TEMPORARY_TABLES crashes parallel threads working on temp tables)
1336
1337 --source include/have_innodb.inc
1338@@ -27,3 +28,34 @@
1339 DROP TABLE t1;
1340
1341 SET DEBUG_SYNC='reset';
1342+=======
1343+# Test for bug 951588 (Querying I_S.TEMPORARY_TABLES crashes parallel threads working on temp tables)
1344+
1345+--source include/have_innodb_plugin.inc
1346+--source include/have_debug_sync.inc
1347+
1348+--disable_warnings
1349+DROP TABLE IF EXISTS t1;
1350+--enable_warnings
1351+
1352+CREATE TEMPORARY TABLE t1 (a INT) ENGINE=InnoDB;
1353+INSERT INTO t1 VALUES (1), (2), (3);
1354+
1355+SET DEBUG_SYNC= 'start_ha_write_row SIGNAL write_in_progress WAIT_FOR i_s_completed';
1356+send ALTER TABLE t1 ADD COLUMN b VARCHAR(10);
1357+
1358+connect (conn2,localhost,root,,);
1359+connection conn2;
1360+
1361+SET DEBUG_SYNC= 'now WAIT_FOR write_in_progress';
1362+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_TEMPORARY_TABLES;
1363+SET DEBUG_SYNC= 'now SIGNAL i_s_completed';
1364+
1365+disconnect conn2;
1366+connection default;
1367+reap;
1368+
1369+DROP TABLE t1;
1370+
1371+SET DEBUG_SYNC='reset';
1372+>>>>>>> MERGE-SOURCE
1373
1374=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp-master.opt'
1375--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp-master.opt 1970-01-01 00:00:00 +0000
1376+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp-master.opt 2012-08-15 14:13:50 +0000
1377@@ -0,0 +1,1 @@
1378+--innodb_track_changed_pages=TRUE --innodb_log_file_size=1M --innodb_file_per_table --skip-stack-trace --skip-core-file
1379
1380=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp.test'
1381--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp.test 1970-01-01 00:00:00 +0000
1382+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp.test 2012-08-15 14:13:50 +0000
1383@@ -0,0 +1,100 @@
1384+# Tests for the changed page tracking bitmap.
1385+--source include/not_embedded.inc
1386+--source include/not_crashrep.inc
1387+--source include/have_debug.inc
1388+--source include/have_innodb_plugin.inc
1389+# Valgrind reports useless errors on very fast server shutdowns
1390+--source include/not_valgrind.inc
1391+
1392+let $MYSQLD_DATADIR= `select @@datadir`;
1393+let $BITMAP_FILE= $MYSQLD_DATADIR/ib_modified_log.1;
1394+
1395+--disable_warnings
1396+DROP TABLE IF EXISTS t1, t2;
1397+--enable_warnings
1398+
1399+# Create some log data, less than log capacity
1400+CREATE TABLE t1 (x INT) ENGINE=InnoDB;
1401+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
1402+
1403+# Check that the bitmap file has been created
1404+file_exists $BITMAP_FILE;
1405+
1406+# Test that an empty existing bitmap file is handled properly when it's
1407+# possible to re-read the entire missing range.
1408+
1409+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
1410+--shutdown_server 10
1411+--source include/wait_until_disconnected.inc
1412+remove_file $BITMAP_FILE;
1413+write_file $BITMAP_FILE;
1414+EOF
1415+--enable_reconnect
1416+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
1417+--source include/wait_until_connected_again.inc
1418+
1419+# Create more log data, larger amount than the log group capacity. At the same time test second space id.
1420+INSERT INTO t1 SELECT x FROM t1;
1421+INSERT INTO t1 SELECT x FROM t1;
1422+INSERT INTO t1 SELECT x FROM t1;
1423+INSERT INTO t1 SELECT x FROM t1;
1424+INSERT INTO t1 SELECT x FROM t1;
1425+INSERT INTO t1 SELECT x FROM t1;
1426+INSERT INTO t1 SELECT x FROM t1;
1427+INSERT INTO t1 SELECT x FROM t1;
1428+INSERT INTO t1 SELECT x FROM t1;
1429+INSERT INTO t1 SELECT x FROM t1;
1430+INSERT INTO t1 SELECT x FROM t1;
1431+INSERT INTO t1 SELECT x FROM t1;
1432+CREATE TABLE t2 (x INT) ENGINE=InnoDB;
1433+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
1434+
1435+file_exists $BITMAP_FILE;
1436+
1437+# Restart the server to check that the bitmap file is properly read on the startup
1438+# to resume tracking.
1439+
1440+# TODO: check the tracked LSN range continuity once this info is exposed through
1441+# INFORMATION_SCHEMA.
1442+--source include/restart_mysqld.inc
1443+
1444+file_exists $BITMAP_FILE;
1445+
1446+INSERT INTO t1 SELECT x FROM t1;
1447+
1448+# Restart the server again with the very fast shutdown
1449+SET GLOBAL INNODB_FAST_SHUTDOWN=2;
1450+
1451+--source include/restart_mysqld.inc
1452+
1453+file_exists $BITMAP_FILE;
1454+
1455+# Test that an empty existing bitmap file is handled properly when it's impossible to re-read the full missing range.
1456+
1457+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
1458+--shutdown_server 10
1459+--source include/wait_until_disconnected.inc
1460+remove_file $BITMAP_FILE;
1461+write_file $BITMAP_FILE;
1462+EOF
1463+--enable_reconnect
1464+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
1465+--source include/wait_until_connected_again.inc
1466+
1467+file_exists $BITMAP_FILE;
1468+
1469+# Test that the bitmap file is read in block size multiples with junk at the end discarded
1470+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
1471+--shutdown_server 10
1472+--source include/wait_until_disconnected.inc
1473+append_file $BITMAP_FILE;
1474+junk junk junk junk
1475+EOF
1476+--enable_reconnect
1477+--exec echo "restart:-#d,crash_before_bitmap_write" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
1478+--source include/wait_until_connected_again.inc
1479+call mtr.add_suppression("InnoDB: Warning: truncated block detected.*");
1480+
1481+file_exists $BITMAP_FILE;
1482+
1483+DROP TABLE t1, t2;
1484
1485=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart-master.opt'
1486--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart-master.opt 1970-01-01 00:00:00 +0000
1487+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart-master.opt 2012-08-15 14:13:50 +0000
1488@@ -0,0 +1,1 @@
1489+--innodb_track_changed_pages=TRUE --innodb-file-per-table
1490
1491=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart.test'
1492--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart.test 1970-01-01 00:00:00 +0000
1493+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart.test 2012-08-15 14:13:50 +0000
1494@@ -0,0 +1,21 @@
1495+# Tests for the changed page tracking bitmap. A valgrindable subset of
1496+# percona_changed_page_bmp test, which contains the full functional tests.
1497+--source include/have_innodb_plugin.inc
1498+
1499+let $MYSQLD_DATADIR= `select @@datadir`;
1500+let $BITMAP_FILE= $MYSQLD_DATADIR/ib_modified_log.1;
1501+
1502+--disable_warnings
1503+DROP TABLE IF EXISTS t1, t2;
1504+--enable_warnings
1505+
1506+# Create some log data with several space ids to have more than bitmap poge.
1507+CREATE TABLE t1 (x INT) ENGINE=InnoDB;
1508+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
1509+CREATE TABLE t2 (x INT) ENGINE=InnoDB;
1510+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
1511+
1512+# Check that the bitmap file has been created
1513+file_exists $BITMAP_FILE;
1514+
1515+DROP TABLE t1, t2;
1516
1517=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages-master.opt'
1518--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages-master.opt 1970-01-01 00:00:00 +0000
1519+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages-master.opt 2012-08-15 14:13:50 +0000
1520@@ -0,0 +1,1 @@
1521+--innodb_track_changed_pages=TRUE --innodb_log_file_size=1M --innodb-file-per-table
1522
1523=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages.test'
1524--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages.test 1970-01-01 00:00:00 +0000
1525+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages.test 2012-08-15 14:13:50 +0000
1526@@ -0,0 +1,103 @@
1527+###########################################
1528+# Test for I_S.INNODB_CHANGED_PAGES table #
1529+###########################################
1530+
1531+--source include/have_innodb_plugin.inc
1532+
1533+SELECT @@innodb_track_changed_pages;
1534+
1535+SET @OLD_INNODB_CHANGED_PAGES_LIMIT = @@GLOBAL.INNODB_CHANGED_PAGES_LIMIT;
1536+
1537+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
1538+
1539+CREATE TABLE T1 (F1 CHAR(255)) ENGINE=INNODB;
1540+SET @t1_space_id =
1541+ (SELECT SPACE
1542+ FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
1543+ WHERE
1544+ INFORMATION_SCHEMA.INNODB_SYS_TABLES.SCHEMA='test' AND
1545+ INFORMATION_SCHEMA.INNODB_SYS_TABLES.NAME='T1');
1546+
1547+--disable_query_log
1548+--disable_result_log
1549+
1550+#########################################################################
1551+# The maximum log size is 1MB. Each row occupies at least 256 bytes. #
1552+# Each iteration inserts 100 rows. They occupies at least 25KB. To be #
1553+# sure that tracking log thread wrote at least 1M/16K pages we need to #
1554+# exceed maximum log size twice. That means we should do at least #
1555+# 2M/25K = 80 iterations. #
1556+#########################################################################
1557+--let $i=80
1558+
1559+while ($i)
1560+{
1561+--dec $i
1562+INSERT INTO T1 (F1) VALUES
1563+("1"), ("2"), ("3"), ("4"), ("5"), ("6"), ("7"), ("8"), ("9"), ("10"),
1564+("11"), ("12"), ("13"), ("14"), ("15"), ("16"), ("17"), ("18"), ("19"), ("20"),
1565+("21"), ("22"), ("23"), ("24"), ("25"), ("26"), ("27"), ("28"), ("29"), ("30"),
1566+("31"), ("32"), ("33"), ("34"), ("35"), ("36"), ("37"), ("38"), ("39"), ("40"),
1567+("41"), ("42"), ("43"), ("44"), ("45"), ("46"), ("47"), ("48"), ("49"), ("50"),
1568+("51"), ("52"), ("53"), ("54"), ("55"), ("56"), ("57"), ("58"), ("59"), ("60"),
1569+("61"), ("62"), ("63"), ("64"), ("65"), ("66"), ("67"), ("68"), ("69"), ("70"),
1570+("71"), ("72"), ("73"), ("74"), ("75"), ("76"), ("77"), ("78"), ("79"), ("80"),
1571+("81"), ("82"), ("83"), ("84"), ("85"), ("86"), ("87"), ("88"), ("89"), ("90"),
1572+("91"), ("92"), ("93"), ("94"), ("95"), ("96"), ("97"), ("98"), ("99"), ("100");
1573+}
1574+
1575+###################################################################
1576+# Gather data for condition pushdown testing not using conditions #
1577+###################################################################
1578+SET @cond_test_lsn=
1579+ (SELECT MIN(end_lsn)
1580+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES);
1581+
1582+SET @cond_test_pages_count=
1583+ (SELECT count(*)
1584+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1585+ GROUP BY end_lsn
1586+ ORDER BY end_lsn
1587+ LIMIT 1);
1588+
1589+--enable_query_log
1590+--enable_result_log
1591+
1592+###############################################################
1593+# Check if the number of changed pages is greater than 1M/16K #
1594+###############################################################
1595+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
1596+SELECT COUNT(DISTINCT PAGE_ID) >= (1024000/16384)
1597+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1598+ WHERE SPACE_ID = @t1_space_id;
1599+#############################################################
1600+# Check if the maximum page id is less than resonable limit #
1601+#############################################################
1602+SELECT MAX(PAGE_ID) < (3*1024000/16384)
1603+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1604+ WHERE SPACE_ID = @t1_space_id;
1605+########################################################
1606+# The records where START_LSN >= END_LSN should absent #
1607+########################################################
1608+SELECT COUNT(*)
1609+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1610+ WHERE START_LSN >= END_LSN;
1611+
1612+######################################################
1613+# Check condition if pushdown doesn't break anything #
1614+######################################################
1615+SELECT COUNT(*) = @cond_test_pages_count
1616+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1617+ WHERE
1618+ END_LSN > (@cond_test_lsn - 1) AND
1619+ END_LSN < (@cond_test_lsn + 1);
1620+
1621+################################################
1622+# Check how limit for maximum rows count works #
1623+################################################
1624+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 1;
1625+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
1626+
1627+SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = @OLD_INNODB_CHANGED_PAGES_LIMIT;
1628+
1629+DROP TABLE T1;
1630
1631=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty-master.opt'
1632--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty-master.opt 1970-01-01 00:00:00 +0000
1633+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty-master.opt 2012-08-15 14:13:50 +0000
1634@@ -0,0 +1,1 @@
1635+--innodb_track_changed_pages=false
1636
1637=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty.test'
1638--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty.test 1970-01-01 00:00:00 +0000
1639+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty.test 2012-08-15 14:13:50 +0000
1640@@ -0,0 +1,8 @@
1641+###############################################################################
1642+# Test for empty I_S.INNODB_CHANGED_PAGES table. The table should be empty if#
1643+# innodb_track_changed_pages is false. #
1644+###############################################################################
1645+
1646+--source include/have_innodb_plugin.inc
1647+
1648+SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
1649
1650=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s-master.opt'
1651--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s-master.opt 1970-01-01 00:00:00 +0000
1652+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s-master.opt 2012-08-15 14:13:50 +0000
1653@@ -0,0 +1,1 @@
1654+--skip-innodb
1655
1656=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s.test'
1657--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s.test 1970-01-01 00:00:00 +0000
1658+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s.test 2012-08-15 14:13:50 +0000
1659@@ -0,0 +1,21 @@
1660+# we just test that we don't crash. The SELECT below is to ensure we update the test if we add I_S tables for INNODB or XTRADB
1661+SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'INNODB%' ORDER BY TABLE_NAME;
1662+SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'XTRADB%' ORDER BY TABLE_NAME;
1663+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
1664+SELECT * FROM INFORMATION_SCHEMA.INNODB_RSEG;
1665+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP;
1666+SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
1667+SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
1668+SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
1669+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_RESET;
1670+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES;
1671+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
1672+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
1673+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM;
1674+SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB;
1675+SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM_RESET;
1676+SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLE_STATS;
1677+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_STATS;
1678+SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEX_STATS;
1679+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
1680+SELECT * FROM INFORMATION_SCHEMA.XTRADB_ADMIN_COMMAND;
1681
1682=== modified file 'Percona-Server/sql/handler.cc'
1683--- Percona-Server/sql/handler.cc 2012-08-13 13:42:13 +0000
1684+++ Percona-Server/sql/handler.cc 2012-08-15 14:13:50 +0000
1685@@ -38,8 +38,12 @@
1686 #include <myisampack.h>
1687 #include "transaction.h"
1688 #include <errno.h>
1689+<<<<<<< TREE
1690 #include "probes_mysql.h"
1691 #include "debug_sync.h" // DEBUG_SYNC
1692+=======
1693+#include "debug_sync.h" // DEBUG_SYNC
1694+>>>>>>> MERGE-SOURCE
1695
1696 #ifdef WITH_PARTITION_STORAGE_ENGINE
1697 #include "ha_partition.h"
1698
1699=== modified file 'Percona-Server/sql/signal_handler.cc'
1700=== modified file 'Percona-Server/sql/sql_show.cc'
1701=== modified file 'Percona-Server/storage/innobase/dict/dict0dict.c'
1702=== modified file 'Percona-Server/storage/innobase/fil/fil0fil.c'
1703--- Percona-Server/storage/innobase/fil/fil0fil.c 2012-08-07 06:10:00 +0000
1704+++ Percona-Server/storage/innobase/fil/fil0fil.c 2012-08-15 14:13:50 +0000
1705@@ -3558,9 +3558,15 @@
1706 }
1707 }
1708
1709+<<<<<<< TREE
1710 if (fil_page_get_type(page) ==
1711 FIL_PAGE_INDEX && !is_descr_page) {
1712 index_id_t tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
1713+=======
1714+ if (fil_page_get_type(page) ==
1715+ FIL_PAGE_INDEX && !is_descr_page) {
1716+ dulint tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
1717+>>>>>>> MERGE-SOURCE
1718
1719 for (i = 0; i < n_index; i++) {
1720 if (old_id[i] == tmp) {
1721
1722=== modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc'
1723--- Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-08-07 06:10:00 +0000
1724+++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-08-15 14:13:50 +0000
1725@@ -12658,6 +12658,18 @@
1726 "NULLS_UNEQUAL and NULLS_IGNORED",
1727 NULL, NULL, SRV_STATS_NULLS_EQUAL, &innodb_stats_method_typelib);
1728
1729+static MYSQL_SYSVAR_BOOL(track_changed_pages, srv_track_changed_pages,
1730+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
1731+ "Track the redo log for changed pages and output a changed page bitmap",
1732+ NULL, NULL, FALSE);
1733+
1734+static MYSQL_SYSVAR_ULONGLONG(changed_pages_limit, srv_changed_pages_limit,
1735+ PLUGIN_VAR_RQCMDARG,
1736+ "The maximum number of rows for "
1737+ "INFORMATION_SCHEMA.INNODB_CHANGED_PAGES table, "
1738+ "0 - unlimited",
1739+ NULL, NULL, 1000000, 0, ~0ULL, 0);
1740+
1741 #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
1742 static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
1743 PLUGIN_VAR_RQCMDARG,
1744@@ -12942,6 +12954,8 @@
1745 MYSQL_SYSVAR(use_sys_malloc),
1746 MYSQL_SYSVAR(use_native_aio),
1747 MYSQL_SYSVAR(change_buffering),
1748+ MYSQL_SYSVAR(track_changed_pages),
1749+ MYSQL_SYSVAR(changed_pages_limit),
1750 #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
1751 MYSQL_SYSVAR(change_buffering_debug),
1752 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
1753@@ -12996,12 +13010,16 @@
1754 i_s_innodb_sys_foreign,
1755 i_s_innodb_sys_foreign_cols,
1756 i_s_innodb_sys_stats,
1757+<<<<<<< TREE
1758 i_s_innodb_table_stats,
1759 i_s_innodb_index_stats,
1760 i_s_innodb_buffer_pool_pages,
1761 i_s_innodb_buffer_pool_pages_index,
1762 i_s_innodb_buffer_pool_pages_blob,
1763 i_s_innodb_admin_command
1764+=======
1765+i_s_innodb_changed_pages
1766+>>>>>>> MERGE-SOURCE
1767 mysql_declare_plugin_end;
1768
1769 /** @brief Initialize the default value of innodb_commit_concurrency.
1770
1771=== modified file 'Percona-Server/storage/innobase/handler/i_s.cc'
1772--- Percona-Server/storage/innobase/handler/i_s.cc 2012-06-19 16:19:46 +0000
1773+++ Percona-Server/storage/innobase/handler/i_s.cc 2012-08-15 14:13:50 +0000
1774@@ -22,6 +22,14 @@
1775
1776 Created July 18, 2007 Vasil Dimov
1777 *******************************************************/
1778+#ifndef MYSQL_SERVER
1779+#define MYSQL_SERVER /* For Item_* classes */
1780+#include <mysql_priv.h>
1781+/* Prevent influence of this definition to other headers */
1782+#undef MYSQL_SERVER
1783+#else
1784+#include <mysql_priv.h>
1785+#endif //MYSQL_SERVER
1786
1787 #include <mysqld_error.h>
1788 #include <sql_acl.h> // PROCESS_ACL
1789@@ -32,8 +40,12 @@
1790 #include <mysys_err.h>
1791 #include <my_sys.h>
1792 #include "i_s.h"
1793+<<<<<<< TREE
1794 #include <sql_plugin.h>
1795 #include <mysql/innodb_priv.h>
1796+=======
1797+#include <mysql/plugin.h>
1798+>>>>>>> MERGE-SOURCE
1799
1800 extern "C" {
1801 #include "btr0pcur.h" /* for file sys_tables related info. */
1802@@ -52,7 +64,11 @@
1803 #include "trx0sys.h" /* for trx_sys */
1804 #include "dict0dict.h" /* for dict_sys */
1805 #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
1806+<<<<<<< TREE
1807 #include "btr0btr.h" /* for btr_page_get_index_id */
1808+=======
1809+#include "log0online.h"
1810+>>>>>>> MERGE-SOURCE
1811 }
1812
1813 #define OK(expr) \
1814@@ -221,6 +237,713 @@
1815 return(ret);
1816 }
1817
1818+<<<<<<< TREE
1819+=======
1820+static struct st_mysql_information_schema i_s_info =
1821+{
1822+ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
1823+};
1824+
1825+static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_fields_info[] =
1826+{
1827+ {STRUCT_FLD(field_name, "page_type"),
1828+ STRUCT_FLD(field_length, 64),
1829+ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
1830+ STRUCT_FLD(value, 0),
1831+ STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
1832+ STRUCT_FLD(old_name, ""),
1833+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1834+
1835+ {STRUCT_FLD(field_name, "space_id"),
1836+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1837+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1838+ STRUCT_FLD(value, 0),
1839+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1840+ STRUCT_FLD(old_name, ""),
1841+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1842+
1843+ {STRUCT_FLD(field_name, "page_no"),
1844+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1845+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1846+ STRUCT_FLD(value, 0),
1847+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1848+ STRUCT_FLD(old_name, ""),
1849+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1850+
1851+ {STRUCT_FLD(field_name, "lru_position"),
1852+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1853+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1854+ STRUCT_FLD(value, 0),
1855+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1856+ STRUCT_FLD(old_name, ""),
1857+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1858+
1859+ {STRUCT_FLD(field_name, "fix_count"),
1860+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1861+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1862+ STRUCT_FLD(value, 0),
1863+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1864+ STRUCT_FLD(old_name, ""),
1865+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1866+
1867+ {STRUCT_FLD(field_name, "flush_type"),
1868+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1869+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1870+ STRUCT_FLD(value, 0),
1871+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1872+ STRUCT_FLD(old_name, ""),
1873+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1874+
1875+ END_OF_ST_FIELD_INFO
1876+};
1877+
1878+static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_index_fields_info[] =
1879+{
1880+ {STRUCT_FLD(field_name, "index_id"),
1881+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1882+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1883+ STRUCT_FLD(value, 0),
1884+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1885+ STRUCT_FLD(old_name, ""),
1886+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1887+
1888+ {STRUCT_FLD(field_name, "space_id"),
1889+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1890+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1891+ STRUCT_FLD(value, 0),
1892+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1893+ STRUCT_FLD(old_name, ""),
1894+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1895+
1896+ {STRUCT_FLD(field_name, "page_no"),
1897+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1898+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1899+ STRUCT_FLD(value, 0),
1900+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1901+ STRUCT_FLD(old_name, ""),
1902+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1903+
1904+ {STRUCT_FLD(field_name, "n_recs"),
1905+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1906+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1907+ STRUCT_FLD(value, 0),
1908+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1909+ STRUCT_FLD(old_name, ""),
1910+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1911+
1912+ {STRUCT_FLD(field_name, "data_size"),
1913+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1914+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1915+ STRUCT_FLD(value, 0),
1916+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1917+ STRUCT_FLD(old_name, ""),
1918+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1919+
1920+ {STRUCT_FLD(field_name, "hashed"),
1921+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1922+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1923+ STRUCT_FLD(value, 0),
1924+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1925+ STRUCT_FLD(old_name, ""),
1926+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1927+
1928+ {STRUCT_FLD(field_name, "access_time"),
1929+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1930+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1931+ STRUCT_FLD(value, 0),
1932+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1933+ STRUCT_FLD(old_name, ""),
1934+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1935+
1936+ {STRUCT_FLD(field_name, "modified"),
1937+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1938+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1939+ STRUCT_FLD(value, 0),
1940+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1941+ STRUCT_FLD(old_name, ""),
1942+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1943+
1944+ {STRUCT_FLD(field_name, "dirty"),
1945+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1946+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1947+ STRUCT_FLD(value, 0),
1948+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1949+ STRUCT_FLD(old_name, ""),
1950+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1951+
1952+ {STRUCT_FLD(field_name, "old"),
1953+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1954+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1955+ STRUCT_FLD(value, 0),
1956+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1957+ STRUCT_FLD(old_name, ""),
1958+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1959+
1960+ {STRUCT_FLD(field_name, "lru_position"),
1961+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1962+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1963+ STRUCT_FLD(value, 0),
1964+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1965+ STRUCT_FLD(old_name, ""),
1966+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1967+
1968+ {STRUCT_FLD(field_name, "fix_count"),
1969+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1970+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1971+ STRUCT_FLD(value, 0),
1972+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1973+ STRUCT_FLD(old_name, ""),
1974+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1975+
1976+ {STRUCT_FLD(field_name, "flush_type"),
1977+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1978+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1979+ STRUCT_FLD(value, 0),
1980+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1981+ STRUCT_FLD(old_name, ""),
1982+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1983+
1984+ END_OF_ST_FIELD_INFO
1985+};
1986+
1987+static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_blob_fields_info[] =
1988+{
1989+ {STRUCT_FLD(field_name, "space_id"),
1990+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1991+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1992+ STRUCT_FLD(value, 0),
1993+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
1994+ STRUCT_FLD(old_name, ""),
1995+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1996+
1997+ {STRUCT_FLD(field_name, "page_no"),
1998+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1999+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2000+ STRUCT_FLD(value, 0),
2001+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2002+ STRUCT_FLD(old_name, ""),
2003+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2004+
2005+ {STRUCT_FLD(field_name, "compressed"),
2006+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2007+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2008+ STRUCT_FLD(value, 0),
2009+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2010+ STRUCT_FLD(old_name, ""),
2011+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2012+
2013+ {STRUCT_FLD(field_name, "part_len"),
2014+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2015+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2016+ STRUCT_FLD(value, 0),
2017+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2018+ STRUCT_FLD(old_name, ""),
2019+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2020+
2021+ {STRUCT_FLD(field_name, "next_page_no"),
2022+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2023+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2024+ STRUCT_FLD(value, 0),
2025+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2026+ STRUCT_FLD(old_name, ""),
2027+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2028+
2029+ {STRUCT_FLD(field_name, "lru_position"),
2030+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2031+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2032+ STRUCT_FLD(value, 0),
2033+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2034+ STRUCT_FLD(old_name, ""),
2035+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2036+
2037+ {STRUCT_FLD(field_name, "fix_count"),
2038+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2039+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2040+ STRUCT_FLD(value, 0),
2041+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2042+ STRUCT_FLD(old_name, ""),
2043+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2044+
2045+ {STRUCT_FLD(field_name, "flush_type"),
2046+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2047+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2048+ STRUCT_FLD(value, 0),
2049+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2050+ STRUCT_FLD(old_name, ""),
2051+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2052+
2053+ END_OF_ST_FIELD_INFO
2054+};
2055+
2056+/***********************************************************************
2057+Fill the dynamic table information_schema.innodb_buffer_pool_pages. */
2058+static
2059+int
2060+i_s_innodb_buffer_pool_pages_fill(
2061+/*================*/
2062+ /* out: 0 on success, 1 on failure */
2063+ THD* thd, /* in: thread */
2064+ TABLE_LIST* tables, /* in/out: tables to fill */
2065+ COND* cond) /* in: condition (ignored) */
2066+{
2067+ TABLE* table = (TABLE *) tables->table;
2068+ int status = 0;
2069+
2070+ ulint n_chunks, n_blocks;
2071+
2072+ buf_chunk_t* chunk;
2073+
2074+ DBUG_ENTER("i_s_innodb_buffer_pool_pages_fill");
2075+
2076+ /* deny access to non-superusers */
2077+ if (check_global_access(thd, PROCESS_ACL)) {
2078+
2079+ DBUG_RETURN(0);
2080+ }
2081+
2082+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2083+
2084+ buf_pool_mutex_enter();
2085+
2086+ chunk = buf_pool->chunks;
2087+
2088+ for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
2089+ buf_block_t* block = chunk->blocks;
2090+
2091+ for (n_blocks = chunk->size; n_blocks--; block++) {
2092+ const buf_frame_t* frame = block->frame;
2093+
2094+ char page_type[64];
2095+
2096+ switch(fil_page_get_type(frame))
2097+ {
2098+ case FIL_PAGE_INDEX:
2099+ strcpy(page_type, "index");
2100+ break;
2101+ case FIL_PAGE_UNDO_LOG:
2102+ strcpy(page_type, "undo_log");
2103+ break;
2104+ case FIL_PAGE_INODE:
2105+ strcpy(page_type, "inode");
2106+ break;
2107+ case FIL_PAGE_IBUF_FREE_LIST:
2108+ strcpy(page_type, "ibuf_free_list");
2109+ break;
2110+ case FIL_PAGE_TYPE_ALLOCATED:
2111+ strcpy(page_type, "allocated");
2112+ break;
2113+ case FIL_PAGE_IBUF_BITMAP:
2114+ strcpy(page_type, "bitmap");
2115+ break;
2116+ case FIL_PAGE_TYPE_SYS:
2117+ strcpy(page_type, "sys");
2118+ break;
2119+ case FIL_PAGE_TYPE_TRX_SYS:
2120+ strcpy(page_type, "trx_sys");
2121+ break;
2122+ case FIL_PAGE_TYPE_FSP_HDR:
2123+ strcpy(page_type, "fsp_hdr");
2124+ break;
2125+ case FIL_PAGE_TYPE_XDES:
2126+ strcpy(page_type, "xdes");
2127+ break;
2128+ case FIL_PAGE_TYPE_BLOB:
2129+ strcpy(page_type, "blob");
2130+ break;
2131+ case FIL_PAGE_TYPE_ZBLOB:
2132+ strcpy(page_type, "zblob");
2133+ break;
2134+ case FIL_PAGE_TYPE_ZBLOB2:
2135+ strcpy(page_type, "zblob2");
2136+ break;
2137+ default:
2138+ sprintf(page_type, "unknown (type=%li)", fil_page_get_type(frame));
2139+ }
2140+
2141+ field_store_string(table->field[0], page_type);
2142+ table->field[1]->store(block->page.space);
2143+ table->field[2]->store(block->page.offset);
2144+ table->field[3]->store(0);
2145+ table->field[4]->store(block->page.buf_fix_count);
2146+ table->field[5]->store(block->page.flush_type);
2147+
2148+ if (schema_table_store_record(thd, table)) {
2149+ status = 1;
2150+ break;
2151+ }
2152+
2153+ }
2154+ }
2155+
2156+ buf_pool_mutex_exit();
2157+
2158+ DBUG_RETURN(status);
2159+}
2160+
2161+/***********************************************************************
2162+Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
2163+static
2164+int
2165+i_s_innodb_buffer_pool_pages_index_fill(
2166+/*================*/
2167+ /* out: 0 on success, 1 on failure */
2168+ THD* thd, /* in: thread */
2169+ TABLE_LIST* tables, /* in/out: tables to fill */
2170+ COND* cond) /* in: condition (ignored) */
2171+{
2172+ TABLE* table = (TABLE *) tables->table;
2173+ int status = 0;
2174+
2175+ ulint n_chunks, n_blocks;
2176+ dulint index_id;
2177+
2178+ buf_chunk_t* chunk;
2179+
2180+ DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_fill");
2181+
2182+ /* deny access to non-superusers */
2183+ if (check_global_access(thd, PROCESS_ACL)) {
2184+
2185+ DBUG_RETURN(0);
2186+ }
2187+
2188+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2189+
2190+ buf_pool_mutex_enter();
2191+
2192+ chunk = buf_pool->chunks;
2193+
2194+ for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
2195+ buf_block_t* block = chunk->blocks;
2196+
2197+ for (n_blocks = chunk->size; n_blocks--; block++) {
2198+ const buf_frame_t* frame = block->frame;
2199+
2200+ if (fil_page_get_type(frame) == FIL_PAGE_INDEX) {
2201+ index_id = btr_page_get_index_id(frame);
2202+ table->field[0]->store(ut_conv_dulint_to_longlong(index_id));
2203+ table->field[1]->store(block->page.space);
2204+ table->field[2]->store(block->page.offset);
2205+ table->field[3]->store(page_get_n_recs(frame));
2206+ table->field[4]->store(page_get_data_size(frame));
2207+ table->field[5]->store(block->index != NULL); /* is_hashed */
2208+ table->field[6]->store(block->page.access_time);
2209+ table->field[7]->store(block->page.newest_modification != 0);
2210+ table->field[8]->store(block->page.oldest_modification != 0);
2211+ table->field[9]->store(block->page.old);
2212+ table->field[10]->store(0);
2213+ table->field[11]->store(block->page.buf_fix_count);
2214+ table->field[12]->store(block->page.flush_type);
2215+
2216+ if (schema_table_store_record(thd, table)) {
2217+ status = 1;
2218+ break;
2219+ }
2220+ }
2221+ }
2222+ }
2223+
2224+ buf_pool_mutex_exit();
2225+
2226+ DBUG_RETURN(status);
2227+}
2228+
2229+/***********************************************************************
2230+Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
2231+static
2232+int
2233+i_s_innodb_buffer_pool_pages_blob_fill(
2234+/*================*/
2235+ /* out: 0 on success, 1 on failure */
2236+ THD* thd, /* in: thread */
2237+ TABLE_LIST* tables, /* in/out: tables to fill */
2238+ COND* cond) /* in: condition (ignored) */
2239+{
2240+ TABLE* table = (TABLE *) tables->table;
2241+ int status = 0;
2242+
2243+ ulint n_chunks, n_blocks;
2244+ buf_chunk_t* chunk;
2245+ page_zip_des_t* block_page_zip;
2246+
2247+ ulint part_len;
2248+ ulint next_page_no;
2249+
2250+ DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_fill");
2251+
2252+ /* deny access to non-superusers */
2253+ if (check_global_access(thd, PROCESS_ACL)) {
2254+
2255+ DBUG_RETURN(0);
2256+ }
2257+
2258+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2259+
2260+ buf_pool_mutex_enter();
2261+
2262+ chunk = buf_pool->chunks;
2263+
2264+ for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
2265+ buf_block_t* block = chunk->blocks;
2266+ block_page_zip = buf_block_get_page_zip(block);
2267+
2268+ for (n_blocks = chunk->size; n_blocks--; block++) {
2269+ const buf_frame_t* frame = block->frame;
2270+
2271+ if (fil_page_get_type(frame) == FIL_PAGE_TYPE_BLOB) {
2272+
2273+ if (UNIV_LIKELY_NULL(block_page_zip)) {
2274+ part_len = 0; /* hmm, can't figure it out */
2275+
2276+ next_page_no = mach_read_from_4(
2277+ buf_block_get_frame(block)
2278+ + FIL_PAGE_NEXT);
2279+ } else {
2280+ part_len = mach_read_from_4(
2281+ buf_block_get_frame(block)
2282+ + FIL_PAGE_DATA
2283+ + 0 /*BTR_BLOB_HDR_PART_LEN*/);
2284+
2285+ next_page_no = mach_read_from_4(
2286+ buf_block_get_frame(block)
2287+ + FIL_PAGE_DATA
2288+ + 4 /*BTR_BLOB_HDR_NEXT_PAGE_NO*/);
2289+ }
2290+
2291+ table->field[0]->store(block->page.space);
2292+ table->field[1]->store(block->page.offset);
2293+ table->field[2]->store(block_page_zip != NULL);
2294+ table->field[3]->store(part_len);
2295+
2296+ if(next_page_no == FIL_NULL)
2297+ {
2298+ table->field[4]->store(0);
2299+ } else {
2300+ table->field[4]->store(block->page.offset);
2301+ }
2302+
2303+ table->field[5]->store(0);
2304+ table->field[6]->store(block->page.buf_fix_count);
2305+ table->field[7]->store(block->page.flush_type);
2306+
2307+ if (schema_table_store_record(thd, table)) {
2308+ status = 1;
2309+ break;
2310+ }
2311+
2312+ }
2313+ }
2314+ }
2315+
2316+ buf_pool_mutex_exit();
2317+
2318+ DBUG_RETURN(status);
2319+}
2320+
2321+/***********************************************************************
2322+Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
2323+static
2324+int
2325+i_s_innodb_buffer_pool_pages_init(
2326+/*=========*/
2327+ /* out: 0 on success */
2328+ void* p) /* in/out: table schema object */
2329+{
2330+ DBUG_ENTER("i_s_innodb_buffer_pool_pages_init");
2331+ ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
2332+
2333+ schema->fields_info = i_s_innodb_buffer_pool_pages_fields_info;
2334+ schema->fill_table = i_s_innodb_buffer_pool_pages_fill;
2335+
2336+ DBUG_RETURN(0);
2337+}
2338+
2339+/***********************************************************************
2340+Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
2341+static
2342+int
2343+i_s_innodb_buffer_pool_pages_index_init(
2344+/*=========*/
2345+ /* out: 0 on success */
2346+ void* p) /* in/out: table schema object */
2347+{
2348+ DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_init");
2349+ ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
2350+
2351+ schema->fields_info = i_s_innodb_buffer_pool_pages_index_fields_info;
2352+ schema->fill_table = i_s_innodb_buffer_pool_pages_index_fill;
2353+
2354+ DBUG_RETURN(0);
2355+}
2356+
2357+/***********************************************************************
2358+Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
2359+static
2360+int
2361+i_s_innodb_buffer_pool_pages_blob_init(
2362+/*=========*/
2363+ /* out: 0 on success */
2364+ void* p) /* in/out: table schema object */
2365+{
2366+ DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_init");
2367+ ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
2368+
2369+ schema->fields_info = i_s_innodb_buffer_pool_pages_blob_fields_info;
2370+ schema->fill_table = i_s_innodb_buffer_pool_pages_blob_fill;
2371+
2372+ DBUG_RETURN(0);
2373+}
2374+
2375+
2376+UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages =
2377+{
2378+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
2379+ /* int */
2380+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
2381+
2382+ /* pointer to type-specific plugin descriptor */
2383+ /* void* */
2384+ STRUCT_FLD(info, &i_s_info),
2385+
2386+ /* plugin name */
2387+ /* const char* */
2388+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES"),
2389+
2390+ /* plugin author (for SHOW PLUGINS) */
2391+ /* const char* */
2392+ STRUCT_FLD(author, "Percona"),
2393+
2394+ /* general descriptive text (for SHOW PLUGINS) */
2395+ /* const char* */
2396+ STRUCT_FLD(descr, "InnoDB buffer pool pages"),
2397+
2398+ /* the plugin license (PLUGIN_LICENSE_XXX) */
2399+ /* int */
2400+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
2401+
2402+ /* the function to invoke when plugin is loaded */
2403+ /* int (*)(void*); */
2404+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_init),
2405+
2406+ /* the function to invoke when plugin is unloaded */
2407+ /* int (*)(void*); */
2408+ STRUCT_FLD(deinit, i_s_common_deinit),
2409+
2410+ /* plugin version (for SHOW PLUGINS) */
2411+ /* unsigned int */
2412+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
2413+
2414+ /* struct st_mysql_show_var* */
2415+ STRUCT_FLD(status_vars, NULL),
2416+
2417+ /* struct st_mysql_sys_var** */
2418+ STRUCT_FLD(system_vars, NULL),
2419+
2420+ /* reserved for dependency checking */
2421+ /* void* */
2422+ STRUCT_FLD(__reserved1, NULL)
2423+};
2424+
2425+UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index =
2426+{
2427+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
2428+ /* int */
2429+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
2430+
2431+ /* pointer to type-specific plugin descriptor */
2432+ /* void* */
2433+ STRUCT_FLD(info, &i_s_info),
2434+
2435+ /* plugin name */
2436+ /* const char* */
2437+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_INDEX"),
2438+
2439+ /* plugin author (for SHOW PLUGINS) */
2440+ /* const char* */
2441+ STRUCT_FLD(author, "Percona"),
2442+
2443+ /* general descriptive text (for SHOW PLUGINS) */
2444+ /* const char* */
2445+ STRUCT_FLD(descr, "InnoDB buffer pool index pages"),
2446+
2447+ /* the plugin license (PLUGIN_LICENSE_XXX) */
2448+ /* int */
2449+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
2450+
2451+ /* the function to invoke when plugin is loaded */
2452+ /* int (*)(void*); */
2453+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_index_init),
2454+
2455+ /* the function to invoke when plugin is unloaded */
2456+ /* int (*)(void*); */
2457+ STRUCT_FLD(deinit, i_s_common_deinit),
2458+
2459+ /* plugin version (for SHOW PLUGINS) */
2460+ /* unsigned int */
2461+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
2462+
2463+ /* struct st_mysql_show_var* */
2464+ STRUCT_FLD(status_vars, NULL),
2465+
2466+ /* struct st_mysql_sys_var** */
2467+ STRUCT_FLD(system_vars, NULL),
2468+
2469+ /* reserved for dependency checking */
2470+ /* void* */
2471+ STRUCT_FLD(__reserved1, NULL)
2472+};
2473+
2474+UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob =
2475+{
2476+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
2477+ /* int */
2478+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
2479+
2480+ /* pointer to type-specific plugin descriptor */
2481+ /* void* */
2482+ STRUCT_FLD(info, &i_s_info),
2483+
2484+ /* plugin name */
2485+ /* const char* */
2486+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_BLOB"),
2487+
2488+ /* plugin author (for SHOW PLUGINS) */
2489+ /* const char* */
2490+ STRUCT_FLD(author, "Percona"),
2491+
2492+ /* general descriptive text (for SHOW PLUGINS) */
2493+ /* const char* */
2494+ STRUCT_FLD(descr, "InnoDB buffer pool blob pages"),
2495+
2496+ /* the plugin license (PLUGIN_LICENSE_XXX) */
2497+ /* int */
2498+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
2499+
2500+ /* the function to invoke when plugin is loaded */
2501+ /* int (*)(void*); */
2502+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_blob_init),
2503+
2504+ /* the function to invoke when plugin is unloaded */
2505+ /* int (*)(void*); */
2506+ STRUCT_FLD(deinit, i_s_common_deinit),
2507+
2508+ /* plugin version (for SHOW PLUGINS) */
2509+ /* unsigned int */
2510+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
2511+
2512+ /* struct st_mysql_show_var* */
2513+ STRUCT_FLD(status_vars, NULL),
2514+
2515+ /* struct st_mysql_sys_var** */
2516+ STRUCT_FLD(system_vars, NULL),
2517+
2518+ /* reserved for dependency checking */
2519+ /* void* */
2520+ STRUCT_FLD(__reserved1, NULL)
2521+};
2522+
2523+
2524+>>>>>>> MERGE-SOURCE
2525 /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
2526 static ST_FIELD_INFO innodb_trx_fields_info[] =
2527 {
2528@@ -1290,6 +2013,8 @@
2529
2530 DBUG_ENTER("i_s_cmp_fill_low");
2531
2532+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2533+
2534 /* deny access to non-superusers */
2535 if (check_global_access(thd, PROCESS_ACL)) {
2536
2537@@ -1574,6 +2299,8 @@
2538
2539 DBUG_ENTER("i_s_cmpmem_fill_low");
2540
2541+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2542+
2543 /* deny access to non-superusers */
2544 if (check_global_access(thd, PROCESS_ACL)) {
2545
2546@@ -3819,6 +4546,8 @@
2547
2548 DBUG_ENTER("i_s_innodb_rseg_fill");
2549
2550+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2551+
2552 /* deny access to non-superusers */
2553 if (check_global_access(thd, PROCESS_ACL)) {
2554
2555@@ -3910,11 +4639,183 @@
2556
2557 /* reserved for dependency checking */
2558 /* void* */
2559+<<<<<<< TREE
2560 STRUCT_FLD(__reserved1, NULL),
2561
2562 /* Plugin flags */
2563 /* unsigned long */
2564 STRUCT_FLD(flags, 0UL),
2565+=======
2566+ STRUCT_FLD(__reserved1, NULL)
2567+};
2568+
2569+/***********************************************************************
2570+*/
2571+static ST_FIELD_INFO i_s_innodb_admin_command_info[] =
2572+{
2573+ {STRUCT_FLD(field_name, "result_message"),
2574+ STRUCT_FLD(field_length, 1024),
2575+ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
2576+ STRUCT_FLD(value, 0),
2577+ STRUCT_FLD(field_flags, 0),
2578+ STRUCT_FLD(old_name, ""),
2579+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2580+
2581+ END_OF_ST_FIELD_INFO
2582+};
2583+
2584+#ifndef INNODB_COMPATIBILITY_HOOKS
2585+#error InnoDB needs MySQL to be built with #define INNODB_COMPATIBILITY_HOOKS
2586+#endif
2587+
2588+extern "C" {
2589+char **thd_query(MYSQL_THD thd);
2590+}
2591+
2592+static
2593+int
2594+i_s_innodb_admin_command_fill(
2595+/*==========================*/
2596+ THD* thd,
2597+ TABLE_LIST* tables,
2598+ COND* cond)
2599+{
2600+ TABLE* i_s_table = (TABLE *) tables->table;
2601+ char** query_str;
2602+ char* ptr;
2603+ char quote = '\0';
2604+ const char* command_head = "XTRA_";
2605+
2606+ DBUG_ENTER("i_s_innodb_admin_command_fill");
2607+
2608+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2609+
2610+ /* deny access to non-superusers */
2611+ if (check_global_access(thd, PROCESS_ACL)) {
2612+ DBUG_RETURN(0);
2613+ }
2614+
2615+ if(thd_sql_command(thd) != SQLCOM_SELECT) {
2616+ field_store_string(i_s_table->field[0],
2617+ "SELECT command is only accepted.");
2618+ goto end_func;
2619+ }
2620+
2621+ query_str = thd_query(thd);
2622+ ptr = *query_str;
2623+
2624+ for (; *ptr; ptr++) {
2625+ if (*ptr == quote) {
2626+ quote = '\0';
2627+ } else if (quote) {
2628+ } else if (*ptr == '`' || *ptr == '"') {
2629+ quote = *ptr;
2630+ } else {
2631+ long i;
2632+ for (i = 0; command_head[i]; i++) {
2633+ if (toupper((int)(unsigned char)(ptr[i]))
2634+ != toupper((int)(unsigned char)
2635+ (command_head[i]))) {
2636+ goto nomatch;
2637+ }
2638+ }
2639+ break;
2640+nomatch:
2641+ ;
2642+ }
2643+ }
2644+
2645+ if (!*ptr) {
2646+ field_store_string(i_s_table->field[0],
2647+ "No XTRA_* command in the SQL statement."
2648+ " Please add /*!XTRA_xxxx*/ to the SQL.");
2649+ goto end_func;
2650+ }
2651+
2652+ if (!strncasecmp("XTRA_HELLO", ptr, 10)) {
2653+ /* This is example command XTRA_HELLO */
2654+
2655+ ut_print_timestamp(stderr);
2656+ fprintf(stderr, " InnoDB: administration command test for XtraDB"
2657+ " 'XTRA_HELLO' was detected.\n");
2658+
2659+ field_store_string(i_s_table->field[0],
2660+ "Hello!");
2661+ goto end_func;
2662+ }
2663+ else if (!strncasecmp("XTRA_LRU_DUMP", ptr, 13)) {
2664+ ut_print_timestamp(stderr);
2665+ fprintf(stderr, " InnoDB: administration command 'XTRA_LRU_DUMP'"
2666+ " was detected.\n");
2667+
2668+ if (buf_LRU_file_dump()) {
2669+ field_store_string(i_s_table->field[0],
2670+ "XTRA_LRU_DUMP was succeeded.");
2671+ } else {
2672+ field_store_string(i_s_table->field[0],
2673+ "XTRA_LRU_DUMP was failed.");
2674+ }
2675+
2676+ goto end_func;
2677+ }
2678+ else if (!strncasecmp("XTRA_LRU_RESTORE", ptr, 16)) {
2679+ ut_print_timestamp(stderr);
2680+ fprintf(stderr, " InnoDB: administration command 'XTRA_LRU_RESTORE'"
2681+ " was detected.\n");
2682+
2683+ if (buf_LRU_file_restore()) {
2684+ field_store_string(i_s_table->field[0],
2685+ "XTRA_LRU_RESTORE was succeeded.");
2686+ } else {
2687+ field_store_string(i_s_table->field[0],
2688+ "XTRA_LRU_RESTORE was failed.");
2689+ }
2690+
2691+ goto end_func;
2692+ }
2693+
2694+ field_store_string(i_s_table->field[0],
2695+ "Undefined XTRA_* command.");
2696+ goto end_func;
2697+
2698+end_func:
2699+ if (schema_table_store_record(thd, i_s_table)) {
2700+ DBUG_RETURN(1);
2701+ } else {
2702+ DBUG_RETURN(0);
2703+ }
2704+}
2705+
2706+static
2707+int
2708+i_s_innodb_admin_command_init(
2709+/*==========================*/
2710+ void* p)
2711+{
2712+ DBUG_ENTER("i_s_innodb_admin_command_init");
2713+ ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
2714+
2715+ schema->fields_info = i_s_innodb_admin_command_info;
2716+ schema->fill_table = i_s_innodb_admin_command_fill;
2717+
2718+ DBUG_RETURN(0);
2719+}
2720+
2721+UNIV_INTERN struct st_mysql_plugin i_s_innodb_admin_command =
2722+{
2723+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
2724+ STRUCT_FLD(info, &i_s_info),
2725+ STRUCT_FLD(name, "XTRADB_ADMIN_COMMAND"),
2726+ STRUCT_FLD(author, "Percona"),
2727+ STRUCT_FLD(descr, "XtraDB specific command acceptor"),
2728+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
2729+ STRUCT_FLD(init, i_s_innodb_admin_command_init),
2730+ STRUCT_FLD(deinit, i_s_common_deinit),
2731+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
2732+ STRUCT_FLD(status_vars, NULL),
2733+ STRUCT_FLD(system_vars, NULL),
2734+ STRUCT_FLD(__reserved1, NULL)
2735+>>>>>>> MERGE-SOURCE
2736 };
2737
2738 /***********************************************************************
2739@@ -4308,6 +5209,8 @@
2740
2741 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2742
2743+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2744+
2745 /* deny access to non-superusers */
2746 if (check_global_access(thd, PROCESS_ACL)) {
2747 DBUG_RETURN(0);
2748@@ -4410,6 +5313,7 @@
2749 /*==========================*/
2750 void* p)
2751 {
2752+<<<<<<< TREE
2753 DBUG_ENTER("i_s_innodb_admin_command_init");
2754 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
2755
2756@@ -5389,3 +6293,346 @@
2757 STRUCT_FLD(flags, 0UL),
2758 };
2759
2760+=======
2761+ DBUG_ENTER("i_s_innodb_sys_stats_init");
2762+ ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
2763+
2764+ schema->fields_info = i_s_innodb_sys_stats_info;
2765+ schema->fill_table = i_s_innodb_schema_table_fill;
2766+
2767+ DBUG_RETURN(0);
2768+}
2769+
2770+UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_tables =
2771+{
2772+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
2773+ STRUCT_FLD(info, &i_s_info),
2774+ STRUCT_FLD(name, "INNODB_SYS_TABLES"),
2775+ STRUCT_FLD(author, "Percona"),
2776+ STRUCT_FLD(descr, "InnoDB SYS_TABLES table"),
2777+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
2778+ STRUCT_FLD(init, i_s_innodb_sys_tables_init),
2779+ STRUCT_FLD(deinit, i_s_common_deinit),
2780+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
2781+ STRUCT_FLD(status_vars, NULL),
2782+ STRUCT_FLD(system_vars, NULL),
2783+ STRUCT_FLD(__reserved1, NULL)
2784+};
2785+
2786+UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_indexes =
2787+{
2788+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
2789+ STRUCT_FLD(info, &i_s_info),
2790+ STRUCT_FLD(name, "INNODB_SYS_INDEXES"),
2791+ STRUCT_FLD(author, "Percona"),
2792+ STRUCT_FLD(descr, "InnoDB SYS_INDEXES table"),
2793+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
2794+ STRUCT_FLD(init, i_s_innodb_sys_indexes_init),
2795+ STRUCT_FLD(deinit, i_s_common_deinit),
2796+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
2797+ STRUCT_FLD(status_vars, NULL),
2798+ STRUCT_FLD(system_vars, NULL),
2799+ STRUCT_FLD(__reserved1, NULL)
2800+};
2801+
2802+UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_stats =
2803+{
2804+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
2805+ STRUCT_FLD(info, &i_s_info),
2806+ STRUCT_FLD(name, "INNODB_SYS_STATS"),
2807+ STRUCT_FLD(author, "Percona"),
2808+ STRUCT_FLD(descr, "InnoDB SYS_STATS table"),
2809+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
2810+ STRUCT_FLD(init, i_s_innodb_sys_stats_init),
2811+ STRUCT_FLD(deinit, i_s_common_deinit),
2812+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
2813+ STRUCT_FLD(status_vars, NULL),
2814+ STRUCT_FLD(system_vars, NULL),
2815+ STRUCT_FLD(__reserved1, NULL)
2816+};
2817+
2818+static ST_FIELD_INFO i_s_innodb_changed_pages_info[] =
2819+{
2820+ {STRUCT_FLD(field_name, "space_id"),
2821+ STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
2822+ STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
2823+ STRUCT_FLD(value, 0),
2824+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2825+ STRUCT_FLD(old_name, ""),
2826+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2827+
2828+ {STRUCT_FLD(field_name, "page_id"),
2829+ STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
2830+ STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
2831+ STRUCT_FLD(value, 0),
2832+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2833+ STRUCT_FLD(old_name, ""),
2834+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2835+
2836+ {STRUCT_FLD(field_name, "start_lsn"),
2837+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2838+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2839+ STRUCT_FLD(value, 0),
2840+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2841+ STRUCT_FLD(old_name, ""),
2842+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2843+
2844+ {STRUCT_FLD(field_name, "end_lsn"),
2845+ STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
2846+ STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
2847+ STRUCT_FLD(value, 0),
2848+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
2849+ STRUCT_FLD(old_name, ""),
2850+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
2851+
2852+ END_OF_ST_FIELD_INFO
2853+};
2854+
2855+/***********************************************************************
2856+ This function parses condition and gets upper bounds for start and end LSN's
2857+ if condition corresponds to certain pattern.
2858+
2859+ We can't know right position to avoid scanning bitmap files from the beginning
2860+ to the lower bound. But we can stop scanning bitmap files if we reach upper bound.
2861+
2862+ It's expected the most used queries will be like the following:
2863+
2864+ SELECT * FROM INNODB_CHANGED_PAGES WHERE START_LSN > num1 AND start_lsn < num2;
2865+
2866+ That's why the pattern is:
2867+
2868+ pattern: comp | and_comp;
2869+ comp: lsn < int_num | lsn <= int_num | int_num > lsn | int_num >= lsn;
2870+ lsn: start_lsn | end_lsn;
2871+ and_comp: some_expression AND some_expression | some_expression AND and_comp;
2872+ some_expression: comp | any_other_expression;
2873+
2874+ Suppose the condition is start_lsn < 100, this means we have to read all
2875+ blocks with start_lsn < 100. Which is equivalent to reading all the blocks
2876+ with end_lsn <= 99, or just end_lsn < 100. That's why it's enough to find
2877+ maximum lsn value, doesn't matter if this is start or end lsn and compare
2878+ it with "start_lsn" field.
2879+
2880+ Example:
2881+
2882+ SELECT * FROM INNODB_CHANGED_PAGES
2883+ WHERE
2884+ start_lsn > 10 AND
2885+ end_lsn <= 1111 AND
2886+ 555 > end_lsn AND
2887+ page_id = 100;
2888+
2889+ max_lsn will be set to 555.
2890+*/
2891+static
2892+void
2893+limit_lsn_range_from_condition(
2894+/*===========================*/
2895+ TABLE* table, /*!<in: table */
2896+ COND* cond, /*!<in: condition */
2897+ ib_uint64_t* max_lsn) /*!<in/out: maximum LSN
2898+ (must be initialized with maximum
2899+ available value) */
2900+{
2901+ if (cond->type() != Item::COND_ITEM &&
2902+ cond->type() != Item::FUNC_ITEM)
2903+ return;
2904+
2905+ switch (((Item_func*) cond)->functype())
2906+ {
2907+ case Item_func::COND_AND_FUNC:
2908+ {
2909+ List_iterator<Item> li(*((Item_cond*) cond)->
2910+ argument_list());
2911+ Item *item;
2912+ while ((item= li++))
2913+ limit_lsn_range_from_condition(table,
2914+ item,
2915+ max_lsn);
2916+ break;
2917+ }
2918+ case Item_func::LT_FUNC:
2919+ case Item_func::LE_FUNC:
2920+ case Item_func::GT_FUNC:
2921+ case Item_func::GE_FUNC:
2922+ {
2923+ Item *left;
2924+ Item *right;
2925+ Item_field *item_field;
2926+ ib_uint64_t tmp_result;
2927+
2928+ /*
2929+ a <= b equals to b >= a that's why we just exchange
2930+ "left" and "right" in the case of ">" or ">="
2931+ function
2932+ */
2933+ if (((Item_func*) cond)->functype() ==
2934+ Item_func::LT_FUNC ||
2935+ ((Item_func*) cond)->functype() ==
2936+ Item_func::LE_FUNC)
2937+ {
2938+ left = ((Item_func*) cond)->arguments()[0];
2939+ right = ((Item_func*) cond)->arguments()[1];
2940+ } else {
2941+ left = ((Item_func*) cond)->arguments()[1];
2942+ right = ((Item_func*) cond)->arguments()[0];
2943+ }
2944+
2945+ if (!left || !right)
2946+ return;
2947+ if (left->type() != Item::FIELD_ITEM)
2948+ return;
2949+ if (right->type() != Item::INT_ITEM)
2950+ return;
2951+
2952+ item_field = (Item_field*)left;
2953+
2954+ if (/* START_LSN */
2955+ table->field[2] != item_field->field &&
2956+ /* END_LSN */
2957+ table->field[3] != item_field->field)
2958+ {
2959+ return;
2960+ }
2961+
2962+ /* Check if the current field belongs to our table */
2963+ if (table != item_field->field->table)
2964+ return;
2965+
2966+ tmp_result = right->val_int();
2967+ if (tmp_result < *max_lsn)
2968+ *max_lsn = tmp_result;
2969+
2970+ break;
2971+ }
2972+ default:;
2973+ }
2974+
2975+}
2976+
2977+/***********************************************************************
2978+Fill the dynamic table information_schema.innodb_changed_pages.
2979+@return 0 on success, 1 on failure */
2980+static
2981+int
2982+i_s_innodb_changed_pages_fill(
2983+/*==========================*/
2984+ THD* thd, /*!<in: thread */
2985+ TABLE_LIST* tables, /*!<in/out: tables to fill */
2986+ COND* cond) /*!<in: condition */
2987+{
2988+ TABLE* table = (TABLE *) tables->table;
2989+ log_bitmap_iterator_t i;
2990+ ib_uint64_t output_rows_num = 0UL;
2991+ ib_uint64_t max_lsn = ~0ULL;
2992+
2993+ if (!srv_track_changed_pages)
2994+ return 0;
2995+
2996+ if (!log_online_bitmap_iterator_init(&i))
2997+ return 1;
2998+
2999+ if (cond)
3000+ limit_lsn_range_from_condition(table, cond, &max_lsn);
3001+
3002+ while(log_online_bitmap_iterator_next(&i) &&
3003+ (!srv_changed_pages_limit ||
3004+ output_rows_num < srv_changed_pages_limit) &&
3005+ /*
3006+ There is no need to compare both start LSN and end LSN fields
3007+ with maximum value. It's enough to compare only start LSN.
3008+ Example:
3009+
3010+ max_lsn = 100
3011+ \\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1
3012+ I------I I-------I I-------------I I----I
3013+ ////////////////// | - Query 2
3014+ 1 2 3 4
3015+
3016+ Query 1:
3017+ SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100
3018+ will select 1,2,3 bitmaps
3019+ Query 2:
3020+ SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100
3021+ will select 1,2 bitmaps
3022+
3023+ The condition start_lsn <= 100 will be false after reading
3024+ 1,2,3 bitmaps which suits for both cases.
3025+ */
3026+ LOG_BITMAP_ITERATOR_START_LSN(i) <= max_lsn)
3027+ {
3028+ if (!LOG_BITMAP_ITERATOR_PAGE_CHANGED(i))
3029+ continue;
3030+
3031+ /* SPACE_ID */
3032+ table->field[0]->store(
3033+ LOG_BITMAP_ITERATOR_SPACE_ID(i));
3034+ /* PAGE_ID */
3035+ table->field[1]->store(
3036+ LOG_BITMAP_ITERATOR_PAGE_NUM(i));
3037+ /* START_LSN */
3038+ table->field[2]->store(
3039+ LOG_BITMAP_ITERATOR_START_LSN(i));
3040+ /* END_LSN */
3041+ table->field[3]->store(
3042+ LOG_BITMAP_ITERATOR_END_LSN(i));
3043+
3044+ /*
3045+ I_S tables are in-memory tables. If bitmap file is big enough
3046+ a lot of memory can be used to store the table. But the size
3047+ of used memory can be diminished if we store only data which
3048+ corresponds to some conditions (in WHERE sql clause). Here
3049+ conditions are checked for the field values stored above.
3050+
3051+ Conditions are checked twice. The first is here (during table
3052+ generation) and the second during query execution. Maybe it
3053+ makes sense to use some flag in THD object to avoid double
3054+ checking.
3055+ */
3056+ if (cond && !cond->val_int())
3057+ continue;
3058+
3059+ if (schema_table_store_record(thd, table))
3060+ {
3061+ log_online_bitmap_iterator_release(&i);
3062+ return 1;
3063+ }
3064+
3065+ ++output_rows_num;
3066+ }
3067+
3068+ log_online_bitmap_iterator_release(&i);
3069+ return 0;
3070+}
3071+
3072+static
3073+int
3074+i_s_innodb_changed_pages_init(
3075+/*==========================*/
3076+ void* p)
3077+{
3078+ DBUG_ENTER("i_s_innodb_changed_pages_init");
3079+ ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
3080+
3081+ schema->fields_info = i_s_innodb_changed_pages_info;
3082+ schema->fill_table = i_s_innodb_changed_pages_fill;
3083+
3084+ DBUG_RETURN(0);
3085+}
3086+
3087+UNIV_INTERN struct st_mysql_plugin i_s_innodb_changed_pages =
3088+{
3089+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
3090+ STRUCT_FLD(info, &i_s_info),
3091+ STRUCT_FLD(name, "INNODB_CHANGED_PAGES"),
3092+ STRUCT_FLD(author, "Percona"),
3093+ STRUCT_FLD(descr, "InnoDB CHANGED_PAGES table"),
3094+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
3095+ STRUCT_FLD(init, i_s_innodb_changed_pages_init),
3096+ STRUCT_FLD(deinit, i_s_common_deinit),
3097+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
3098+ STRUCT_FLD(status_vars, NULL),
3099+ STRUCT_FLD(system_vars, NULL),
3100+ STRUCT_FLD(__reserved1, NULL)
3101+};
3102+>>>>>>> MERGE-SOURCE
3103
3104=== modified file 'Percona-Server/storage/innobase/handler/i_s.h'
3105--- Percona-Server/storage/innobase/handler/i_s.h 2012-06-19 16:19:46 +0000
3106+++ Percona-Server/storage/innobase/handler/i_s.h 2012-08-15 14:13:50 +0000
3107@@ -35,6 +35,7 @@
3108 extern struct st_mysql_plugin i_s_innodb_cmp_reset;
3109 extern struct st_mysql_plugin i_s_innodb_cmpmem;
3110 extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;
3111+<<<<<<< TREE
3112 extern struct st_mysql_plugin i_s_innodb_sys_tables;
3113 extern struct st_mysql_plugin i_s_innodb_sys_tablestats;
3114 extern struct st_mysql_plugin i_s_innodb_sys_indexes;
3115@@ -42,14 +43,23 @@
3116 extern struct st_mysql_plugin i_s_innodb_sys_fields;
3117 extern struct st_mysql_plugin i_s_innodb_sys_foreign;
3118 extern struct st_mysql_plugin i_s_innodb_sys_foreign_cols;
3119+=======
3120+>>>>>>> MERGE-SOURCE
3121 extern struct st_mysql_plugin i_s_innodb_rseg;
3122 extern struct st_mysql_plugin i_s_innodb_undo_logs;
3123 extern struct st_mysql_plugin i_s_innodb_sys_stats;
3124 extern struct st_mysql_plugin i_s_innodb_table_stats;
3125 extern struct st_mysql_plugin i_s_innodb_index_stats;
3126 extern struct st_mysql_plugin i_s_innodb_admin_command;
3127+<<<<<<< TREE
3128 extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages;
3129 extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index;
3130 extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob;
3131+=======
3132+extern struct st_mysql_plugin i_s_innodb_sys_tables;
3133+extern struct st_mysql_plugin i_s_innodb_sys_indexes;
3134+extern struct st_mysql_plugin i_s_innodb_sys_stats;
3135+extern struct st_mysql_plugin i_s_innodb_changed_pages;
3136+>>>>>>> MERGE-SOURCE
3137
3138 #endif /* i_s_h */
3139
3140=== modified file 'Percona-Server/storage/innobase/include/log0log.h'
3141--- Percona-Server/storage/innobase/include/log0log.h 2012-08-07 06:10:00 +0000
3142+++ Percona-Server/storage/innobase/include/log0log.h 2012-08-15 14:13:50 +0000
3143@@ -962,6 +962,11 @@
3144 become signaled */
3145 /* @} */
3146 #endif /* UNIV_LOG_ARCHIVE */
3147+ ib_uint64_t tracked_lsn; /*!< log tracking has advanced to this
3148+ lsn. Field accessed atomically where
3149+ 64-bit atomic ops are supported,
3150+ protected by the log sys mutex
3151+ otherwise. */
3152 };
3153
3154 /** Test if flush order mutex is owned. */
3155
3156=== added file 'Percona-Server/storage/innobase/include/log0online.h'
3157--- Percona-Server/storage/innobase/include/log0online.h 1970-01-01 00:00:00 +0000
3158+++ Percona-Server/storage/innobase/include/log0online.h 2012-08-15 14:13:50 +0000
3159@@ -0,0 +1,111 @@
3160+/*****************************************************************************
3161+
3162+Copyright (c) 2011-2012, Percona Inc. All Rights Reserved.
3163+
3164+This program is free software; you can redistribute it and/or modify it under
3165+the terms of the GNU General Public License as published by the Free Software
3166+Foundation; version 2 of the License.
3167+
3168+This program is distributed in the hope that it will be useful, but WITHOUT
3169+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3170+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
3171+
3172+You should have received a copy of the GNU General Public License along with
3173+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
3174+Place, Suite 330, Boston, MA 02111-1307 USA
3175+
3176+*****************************************************************************/
3177+
3178+/**************************************************//**
3179+@file include/log0online.h
3180+Online database log parsing for changed page tracking
3181+*******************************************************/
3182+
3183+#ifndef log0online_h
3184+#define log0online_h
3185+
3186+#include "univ.i"
3187+#include "os0file.h"
3188+
3189+/*********************************************************************//**
3190+Initializes the online log following subsytem. */
3191+UNIV_INTERN
3192+void
3193+log_online_read_init();
3194+/*===================*/
3195+
3196+/*********************************************************************//**
3197+Shuts down the online log following subsystem. */
3198+UNIV_INTERN
3199+void
3200+log_online_read_shutdown();
3201+/*=======================*/
3202+
3203+/*********************************************************************//**
3204+Reads and parses the redo log up to last checkpoint LSN to build the changed
3205+page bitmap which is then written to disk. */
3206+UNIV_INTERN
3207+void
3208+log_online_follow_redo_log();
3209+/*=========================*/
3210+
3211+/** The iterator through all bits of changed pages bitmap blocks */
3212+struct log_bitmap_iterator_struct
3213+{
3214+ char in_name[FN_REFLEN]; /*!< the file name for bitmap
3215+ input */
3216+ os_file_t in; /*!< the bitmap input file */
3217+ ib_uint64_t in_offset; /*!< the next write position in the
3218+ bitmap output file */
3219+ ib_uint32_t bit_offset; /*!< bit offset inside of bitmap
3220+ block*/
3221+ ib_uint64_t start_lsn; /*!< Start lsn of the block */
3222+ ib_uint64_t end_lsn; /*!< End lsn of the block */
3223+ ib_uint32_t space_id; /*!< Block space id */
3224+ ib_uint32_t first_page_id; /*!< First block page id */
3225+ ibool changed; /*!< true if current page was changed */
3226+ byte* page; /*!< Bitmap block */
3227+};
3228+
3229+typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t;
3230+
3231+#define LOG_BITMAP_ITERATOR_START_LSN(i) \
3232+ ((i).start_lsn)
3233+#define LOG_BITMAP_ITERATOR_END_LSN(i) \
3234+ ((i).end_lsn)
3235+#define LOG_BITMAP_ITERATOR_SPACE_ID(i) \
3236+ ((i).space_id)
3237+#define LOG_BITMAP_ITERATOR_PAGE_NUM(i) \
3238+ ((i).first_page_id + (i).bit_offset)
3239+#define LOG_BITMAP_ITERATOR_PAGE_CHANGED(i) \
3240+ ((i).changed)
3241+
3242+/*********************************************************************//**
3243+Initializes log bitmap iterator.
3244+@return TRUE if the iterator is initialized OK, FALSE otherwise. */
3245+UNIV_INTERN
3246+ibool
3247+log_online_bitmap_iterator_init(
3248+/*============================*/
3249+ log_bitmap_iterator_t *i); /*!<in/out: iterator */
3250+
3251+/*********************************************************************//**
3252+Releases log bitmap iterator. */
3253+UNIV_INTERN
3254+void
3255+log_online_bitmap_iterator_release(
3256+/*===============================*/
3257+ log_bitmap_iterator_t *i); /*!<in/out: iterator */
3258+
3259+/*********************************************************************//**
3260+Iterates through bits of saved bitmap blocks.
3261+Sequentially reads blocks from bitmap file(s) and interates through
3262+their bits. Ignores blocks with wrong checksum.
3263+@return TRUE if iteration is successful, FALSE if all bits are iterated. */
3264+UNIV_INTERN
3265+ibool
3266+log_online_bitmap_iterator_next(
3267+/*============================*/
3268+ log_bitmap_iterator_t *i); /*!<in/out: iterator */
3269+
3270+#endif
3271
3272=== modified file 'Percona-Server/storage/innobase/include/log0recv.h'
3273--- Percona-Server/storage/innobase/include/log0recv.h 2012-05-10 07:49:14 +0000
3274+++ Percona-Server/storage/innobase/include/log0recv.h 2012-08-15 14:13:50 +0000
3275@@ -32,6 +32,28 @@
3276 #include "hash0hash.h"
3277 #include "log0log.h"
3278
3279+/******************************************************//**
3280+Checks the 4-byte checksum to the trailer checksum field of a log
3281+block. We also accept a log block in the old format before
3282+InnoDB-3.23.52 where the checksum field contains the log block number.
3283+@return TRUE if ok, or if the log block may be in the format of InnoDB
3284+version predating 3.23.52 */
3285+UNIV_INTERN
3286+ibool
3287+log_block_checksum_is_ok_or_old_format(
3288+/*===================================*/
3289+ const byte* block); /*!< in: pointer to a log block */
3290+
3291+/*******************************************************//**
3292+Calculates the new value for lsn when more data is added to the log. */
3293+UNIV_INTERN
3294+ib_uint64_t
3295+recv_calc_lsn_on_data_add(
3296+/*======================*/
3297+ ib_uint64_t lsn, /*!< in: old lsn */
3298+ ib_uint64_t len); /*!< in: this many bytes of data is
3299+ added, log block headers not included */
3300+
3301 #ifdef UNIV_HOTBACKUP
3302 extern ibool recv_replay_file_ops;
3303
3304@@ -182,6 +204,21 @@
3305 void
3306 recv_recovery_rollback_active(void);
3307 /*===============================*/
3308+
3309+/*******************************************************************//**
3310+Tries to parse a single log record and returns its length.
3311+@return length of the record, or 0 if the record was not complete */
3312+UNIV_INTERN
3313+ulint
3314+recv_parse_log_rec(
3315+/*===============*/
3316+ byte* ptr, /*!< in: pointer to a buffer */
3317+ byte* end_ptr,/*!< in: pointer to the buffer end */
3318+ byte* type, /*!< out: type */
3319+ ulint* space, /*!< out: space id */
3320+ ulint* page_no,/*!< out: page number */
3321+ byte** body); /*!< out: log record body start */
3322+
3323 /*******************************************************//**
3324 Scans log from a buffer and stores new log data to the parsing buffer.
3325 Parses and hashes the log records if new data found. Unless
3326
3327=== modified file 'Percona-Server/storage/innobase/include/os0file.h'
3328--- Percona-Server/storage/innobase/include/os0file.h 2012-08-07 06:10:00 +0000
3329+++ Percona-Server/storage/innobase/include/os0file.h 2012-08-15 14:13:50 +0000
3330@@ -867,7 +867,18 @@
3331 /*============*/
3332 FILE* file); /*!< in: file to be truncated */
3333 /***********************************************************************//**
3334+<<<<<<< TREE
3335 NOTE! Use the corresponding macro os_file_flush(), not directly this function!
3336+=======
3337+Truncates a file at the specified position.
3338+@return TRUE if success */
3339+UNIV_INTERN
3340+ibool
3341+os_file_set_eof_at(
3342+ os_file_t file, /*!< in: handle to a file */
3343+ ib_uint64_t new_len);/*!< in: new file length */
3344+/***********************************************************************//**
3345+>>>>>>> MERGE-SOURCE
3346 Flushes the write buffers of a given file to the disk.
3347 @return TRUE if success */
3348 UNIV_INTERN
3349
3350=== modified file 'Percona-Server/storage/innobase/include/os0sync.h'
3351--- Percona-Server/storage/innobase/include/os0sync.h 2012-05-10 07:49:14 +0000
3352+++ Percona-Server/storage/innobase/include/os0sync.h 2012-08-15 14:13:50 +0000
3353@@ -265,7 +265,11 @@
3354
3355 #if defined(HAVE_IB_GCC_ATOMIC_BUILTINS)
3356
3357-#define HAVE_ATOMIC_BUILTINS
3358+# define HAVE_ATOMIC_BUILTINS
3359+
3360+# ifdef HAVE_IB_GCC_ATOMIC_BUILTINS_64
3361+# define HAVE_ATOMIC_BUILTINS_64
3362+# endif
3363
3364 /**********************************************************//**
3365 Returns true if swapped, ptr is pointer to target, old_val is value to
3366@@ -304,6 +308,9 @@
3367 # define os_atomic_increment_ulint(ptr, amount) \
3368 os_atomic_increment(ptr, amount)
3369
3370+# define os_atomic_increment_uint64(ptr, amount) \
3371+ os_atomic_increment(ptr, amount)
3372+
3373 /**********************************************************//**
3374 Returns the old value of *ptr, atomically sets *ptr to new_val */
3375
3376@@ -312,12 +319,13 @@
3377
3378 #elif defined(HAVE_IB_SOLARIS_ATOMICS)
3379
3380-#define HAVE_ATOMIC_BUILTINS
3381+# define HAVE_ATOMIC_BUILTINS
3382+# define HAVE_ATOMIC_BUILTINS_64
3383
3384 /* If not compiling with GCC or GCC doesn't support the atomic
3385 intrinsics and running on Solaris >= 10 use Solaris atomics */
3386
3387-#include <atomic.h>
3388+# include <atomic.h>
3389
3390 /**********************************************************//**
3391 Returns true if swapped, ptr is pointer to target, old_val is value to
3392@@ -357,6 +365,9 @@
3393 # define os_atomic_increment_ulint(ptr, amount) \
3394 atomic_add_long_nv(ptr, amount)
3395
3396+# define os_atomic_increment_uint64(ptr, amount) \
3397+ atomic_add_64_nv(ptr, amount)
3398+
3399 /**********************************************************//**
3400 Returns the old value of *ptr, atomically sets *ptr to new_val */
3401
3402@@ -365,7 +376,11 @@
3403
3404 #elif defined(HAVE_WINDOWS_ATOMICS)
3405
3406-#define HAVE_ATOMIC_BUILTINS
3407+# define HAVE_ATOMIC_BUILTINS
3408+
3409+# ifndef _WIN32
3410+# define HAVE_ATOMIC_BUILTINS_64
3411+# endif
3412
3413 /* On Windows, use Windows atomics / interlocked */
3414 # ifdef _WIN64
3415@@ -403,6 +418,11 @@
3416 # define os_atomic_increment_ulint(ptr, amount) \
3417 ((ulint) (win_xchg_and_add(ptr, amount) + amount))
3418
3419+# define os_atomic_increment_uint64(ptr, amount) \
3420+ ((ib_uint64_t) (InterlockedExchangeAdd64( \
3421+ (ib_int64_t*) ptr, \
3422+ (ib_int64_t) amount) + amount))
3423+
3424 /**********************************************************//**
3425 Returns the old value of *ptr, atomically sets *ptr to new_val.
3426 InterlockedExchange() operates on LONG, and the LONG will be
3427
3428=== modified file 'Percona-Server/storage/innobase/include/srv0srv.h'
3429--- Percona-Server/storage/innobase/include/srv0srv.h 2012-08-07 06:10:00 +0000
3430+++ Percona-Server/storage/innobase/include/srv0srv.h 2012-08-15 14:13:50 +0000
3431@@ -66,6 +66,14 @@
3432 /* The error monitor thread waits on this event. */
3433 extern os_event_t srv_error_event;
3434
3435+/* This event is set on checkpoint completion to wake the redo log parser
3436+thread */
3437+extern os_event_t srv_checkpoint_completed_event;
3438+
3439+/* This event is set on the online redo log following thread exit to signal
3440+that the (slow) shutdown may proceed */
3441+extern os_event_t srv_redo_log_thread_finished_event;
3442+
3443 /* If the last data file is auto-extended, we add this many pages to it
3444 at a time */
3445 #define SRV_AUTO_EXTEND_INCREMENT \
3446@@ -133,6 +141,16 @@
3447
3448 extern ibool srv_recovery_stats;
3449
3450+<<<<<<< TREE
3451+=======
3452+extern ulint srv_use_purge_thread;
3453+
3454+extern my_bool srv_track_changed_pages;
3455+
3456+extern
3457+ulonglong srv_changed_pages_limit;
3458+
3459+>>>>>>> MERGE-SOURCE
3460 extern ibool srv_auto_extend_last_data_file;
3461 extern ulint srv_last_file_size_max;
3462 extern char** srv_log_group_home_dirs;
3463@@ -694,6 +712,15 @@
3464 void* arg); /*!< in: a dummy parameter required by
3465 os_thread_create */
3466 /******************************************************************//**
3467+A thread which follows the redo log and outputs the changed page bitmap.
3468+@return a dummy value */
3469+UNIV_INTERN
3470+os_thread_ret_t
3471+srv_redo_log_follow_thread(
3472+/*=======================*/
3473+ void* arg); /*!< in: a dummy parameter required by
3474+ os_thread_create */
3475+/******************************************************************//**
3476 Outputs to a file the output of the InnoDB Monitor.
3477 @return FALSE if not all information printed
3478 due to failure to obtain necessary mutex */
3479
3480=== added file 'Percona-Server/storage/innobase/include/ut0rbt.h.OTHER'
3481--- Percona-Server/storage/innobase/include/ut0rbt.h.OTHER 1970-01-01 00:00:00 +0000
3482+++ Percona-Server/storage/innobase/include/ut0rbt.h.OTHER 2012-08-15 14:13:50 +0000
3483@@ -0,0 +1,332 @@
3484+/*****************************************************************************
3485+Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
3486+
3487+This program is free software; you can redistribute it and/or modify it under
3488+the terms of the GNU General Public License as published by the Free Software
3489+Foundation; version 2 of the License.
3490+
3491+This program is distributed in the hope that it will be useful, but WITHOUT
3492+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3493+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
3494+
3495+You should have received a copy of the GNU General Public License along with
3496+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
3497+Place, Suite 330, Boston, MA 02111-1307 USA
3498+
3499+*****************************************************************************/
3500+
3501+/*******************************************************************//**
3502+@file include/ut0rbt.h
3503+Red-Black tree implementation.
3504+
3505+Created 2007-03-20 Sunny Bains
3506+************************************************************************/
3507+
3508+#ifndef INNOBASE_UT0RBT_H
3509+#define INNOBASE_UT0RBT_H
3510+
3511+#if !defined(IB_RBT_TESTING)
3512+#include "univ.i"
3513+#include "ut0mem.h"
3514+#else
3515+#include <stdio.h>
3516+#include <stdlib.h>
3517+#include <string.h>
3518+#include <assert.h>
3519+
3520+#define ut_malloc malloc
3521+#define ut_free free
3522+#define ulint unsigned long
3523+#define ut_a(c) assert(c)
3524+#define ut_error assert(0)
3525+#define ibool unsigned int
3526+#define TRUE 1
3527+#define FALSE 0
3528+#endif
3529+
3530+/* Red black tree typedefs */
3531+typedef struct ib_rbt_struct ib_rbt_t;
3532+typedef struct ib_rbt_node_struct ib_rbt_node_t;
3533+/* FIXME: Iterator is a better name than _bound_ */
3534+typedef struct ib_rbt_bound_struct ib_rbt_bound_t;
3535+typedef void (*ib_rbt_print_node)(const ib_rbt_node_t* node);
3536+typedef int (*ib_rbt_compare)(const void* p1, const void* p2);
3537+
3538+/* Red black tree color types */
3539+enum ib_rbt_color_enum {
3540+ IB_RBT_RED,
3541+ IB_RBT_BLACK
3542+};
3543+
3544+typedef enum ib_rbt_color_enum ib_rbt_color_t;
3545+
3546+/* Red black tree node */
3547+struct ib_rbt_node_struct {
3548+ ib_rbt_color_t color; /* color of this node */
3549+
3550+ ib_rbt_node_t* left; /* points left child */
3551+ ib_rbt_node_t* right; /* points right child */
3552+ ib_rbt_node_t* parent; /* points parent node */
3553+
3554+ char value[1]; /* Data value */
3555+};
3556+
3557+/* Red black tree instance.*/
3558+struct ib_rbt_struct {
3559+ ib_rbt_node_t* nil; /* Black colored node that is
3560+ used as a sentinel. This is
3561+ pre-allocated too.*/
3562+
3563+ ib_rbt_node_t* root; /* Root of the tree, this is
3564+ pre-allocated and the first
3565+ data node is the left child.*/
3566+
3567+ ulint n_nodes; /* Total number of data nodes */
3568+
3569+ ib_rbt_compare compare; /* Fn. to use for comparison */
3570+ ulint sizeof_value; /* Sizeof the item in bytes */
3571+};
3572+
3573+/* The result of searching for a key in the tree, this is useful for
3574+a speedy lookup and insert if key doesn't exist.*/
3575+struct ib_rbt_bound_struct {
3576+ const ib_rbt_node_t*
3577+ last; /* Last node visited */
3578+
3579+ int result; /* Result of comparing with
3580+ the last non-nil node that
3581+ was visited */
3582+};
3583+
3584+/* Size in elements (t is an rb tree instance) */
3585+#define rbt_size(t) (t->n_nodes)
3586+
3587+/* Check whether the rb tree is empty (t is an rb tree instance) */
3588+#define rbt_empty(t) (rbt_size(t) == 0)
3589+
3590+/* Get data value (t is the data type, n is an rb tree node instance) */
3591+#define rbt_value(t, n) ((t*) &n->value[0])
3592+
3593+/* Compare a key with the node value (t is tree, k is key, n is node)*/
3594+#define rbt_compare(t, k, n) (t->compare(k, n->value))
3595+
3596+/* Node size. FIXME: name might clash, but currently it does not, so for easier
3597+maintenance do not rename it for now. */
3598+#define SIZEOF_NODE(t) ((sizeof(ib_rbt_node_t) + t->sizeof_value) - 1)
3599+
3600+/****************************************************************//**
3601+Free an instance of a red black tree */
3602+UNIV_INTERN
3603+void
3604+rbt_free(
3605+/*=====*/
3606+ ib_rbt_t* tree); /*!< in: rb tree to free */
3607+/****************************************************************//**
3608+Create an instance of a red black tree
3609+@return rb tree instance */
3610+UNIV_INTERN
3611+ib_rbt_t*
3612+rbt_create(
3613+/*=======*/
3614+ size_t sizeof_value, /*!< in: size in bytes */
3615+ ib_rbt_compare compare); /*!< in: comparator */
3616+/****************************************************************//**
3617+Delete a node from the red black tree, identified by key.
3618+@return TRUE if success FALSE if not found */
3619+UNIV_INTERN
3620+ibool
3621+rbt_delete(
3622+/*=======*/
3623+ ib_rbt_t* tree, /*!< in: rb tree */
3624+ const void* key); /*!< in: key to delete */
3625+/****************************************************************//**
3626+Remove a node from the rb tree, the node is not free'd, that is the
3627+callers responsibility.
3628+@return the deleted node with the const. */
3629+UNIV_INTERN
3630+ib_rbt_node_t*
3631+rbt_remove_node(
3632+/*============*/
3633+ ib_rbt_t* tree, /*!< in: rb tree */
3634+ const ib_rbt_node_t*
3635+ node); /*!< in: node to delete, this
3636+ is a fudge and declared const
3637+ because the caller has access
3638+ only to const nodes.*/
3639+/****************************************************************//**
3640+Find a matching node in the rb tree.
3641+@return node if found else return NULL */
3642+UNIV_INTERN
3643+const ib_rbt_node_t*
3644+rbt_lookup(
3645+/*=======*/
3646+ const ib_rbt_t* tree, /*!< in: rb tree to search */
3647+ const void* key); /*!< in: key to lookup */
3648+/****************************************************************//**
3649+Generic insert of a value in the rb tree.
3650+@return inserted node */
3651+UNIV_INTERN
3652+const ib_rbt_node_t*
3653+rbt_insert(
3654+/*=======*/
3655+ ib_rbt_t* tree, /*!< in: rb tree */
3656+ const void* key, /*!< in: key for ordering */
3657+ const void* value); /*!< in: data that will be
3658+ copied to the node.*/
3659+/****************************************************************//**
3660+Add a new node to the tree, useful for data that is pre-sorted.
3661+@return appended node */
3662+UNIV_INTERN
3663+const ib_rbt_node_t*
3664+rbt_add_node(
3665+/*=========*/
3666+ ib_rbt_t* tree, /*!< in: rb tree */
3667+ ib_rbt_bound_t* parent, /*!< in: parent */
3668+ const void* value); /*!< in: this value is copied
3669+ to the node */
3670+/****************************************************************//**
3671+Add a new caller-provided node to tree at the specified position.
3672+The node must have its key fields initialized correctly.
3673+@return added node */
3674+UNIV_INTERN
3675+const ib_rbt_node_t*
3676+rbt_add_preallocated_node(
3677+/*======================*/
3678+ ib_rbt_t* tree, /*!< in: rb tree */
3679+ ib_rbt_bound_t* parent, /*!< in: parent */
3680+ ib_rbt_node_t* node); /*!< in: node */
3681+
3682+/****************************************************************//**
3683+Return the left most data node in the tree
3684+@return left most node */
3685+UNIV_INTERN
3686+const ib_rbt_node_t*
3687+rbt_first(
3688+/*======*/
3689+ const ib_rbt_t* tree); /*!< in: rb tree */
3690+/****************************************************************//**
3691+Return the right most data node in the tree
3692+@return right most node */
3693+UNIV_INTERN
3694+const ib_rbt_node_t*
3695+rbt_last(
3696+/*=====*/
3697+ const ib_rbt_t* tree); /*!< in: rb tree */
3698+/****************************************************************//**
3699+Return the next node from current.
3700+@return successor node to current that is passed in. */
3701+UNIV_INTERN
3702+const ib_rbt_node_t*
3703+rbt_next(
3704+/*=====*/
3705+ const ib_rbt_t* tree, /*!< in: rb tree */
3706+ const ib_rbt_node_t* /*!< in: current node */
3707+ current);
3708+/****************************************************************//**
3709+Return the prev node from current.
3710+@return precedessor node to current that is passed in */
3711+UNIV_INTERN
3712+const ib_rbt_node_t*
3713+rbt_prev(
3714+/*=====*/
3715+ const ib_rbt_t* tree, /*!< in: rb tree */
3716+ const ib_rbt_node_t* /*!< in: current node */
3717+ current);
3718+/****************************************************************//**
3719+Find the node that has the lowest key that is >= key.
3720+@return node that satisfies the lower bound constraint or NULL */
3721+UNIV_INTERN
3722+const ib_rbt_node_t*
3723+rbt_lower_bound(
3724+/*============*/
3725+ const ib_rbt_t* tree, /*!< in: rb tree */
3726+ const void* key); /*!< in: key to search */
3727+/****************************************************************//**
3728+Find the node that has the greatest key that is <= key.
3729+@return node that satisifies the upper bound constraint or NULL */
3730+UNIV_INTERN
3731+const ib_rbt_node_t*
3732+rbt_upper_bound(
3733+/*============*/
3734+ const ib_rbt_t* tree, /*!< in: rb tree */
3735+ const void* key); /*!< in: key to search */
3736+/****************************************************************//**
3737+Search for the key, a node will be retuned in parent.last, whether it
3738+was found or not. If not found then parent.last will contain the
3739+parent node for the possibly new key otherwise the matching node.
3740+@return result of last comparison */
3741+UNIV_INTERN
3742+int
3743+rbt_search(
3744+/*=======*/
3745+ const ib_rbt_t* tree, /*!< in: rb tree */
3746+ ib_rbt_bound_t* parent, /*!< in: search bounds */
3747+ const void* key); /*!< in: key to search */
3748+/****************************************************************//**
3749+Search for the key, a node will be retuned in parent.last, whether it
3750+was found or not. If not found then parent.last will contain the
3751+parent node for the possibly new key otherwise the matching node.
3752+@return result of last comparison */
3753+UNIV_INTERN
3754+int
3755+rbt_search_cmp(
3756+/*===========*/
3757+ const ib_rbt_t* tree, /*!< in: rb tree */
3758+ ib_rbt_bound_t* parent, /*!< in: search bounds */
3759+ const void* key, /*!< in: key to search */
3760+ ib_rbt_compare compare); /*!< in: comparator */
3761+/****************************************************************//**
3762+Clear the tree, deletes (and free's) all the nodes. */
3763+UNIV_INTERN
3764+void
3765+rbt_clear(
3766+/*======*/
3767+ ib_rbt_t* tree); /*!< in: rb tree */
3768+/****************************************************************//**
3769+Clear the tree without deleting and freeing its nodes. */
3770+UNIV_INTERN
3771+void
3772+rbt_reset(
3773+/*======*/
3774+ ib_rbt_t* tree); /*!< in: rb tree */
3775+/****************************************************************//**
3776+Merge the node from dst into src. Return the number of nodes merged.
3777+@return no. of recs merged */
3778+UNIV_INTERN
3779+ulint
3780+rbt_merge_uniq(
3781+/*===========*/
3782+ ib_rbt_t* dst, /*!< in: dst rb tree */
3783+ const ib_rbt_t* src); /*!< in: src rb tree */
3784+/****************************************************************//**
3785+Merge the node from dst into src. Return the number of nodes merged.
3786+Delete the nodes from src after copying node to dst. As a side effect
3787+the duplicates will be left untouched in the src, since we don't support
3788+duplicates (yet). NOTE: src and dst must be similar, the function doesn't
3789+check for this condition (yet).
3790+@return no. of recs merged */
3791+UNIV_INTERN
3792+ulint
3793+rbt_merge_uniq_destructive(
3794+/*=======================*/
3795+ ib_rbt_t* dst, /*!< in: dst rb tree */
3796+ ib_rbt_t* src); /*!< in: src rb tree */
3797+/****************************************************************//**
3798+Verify the integrity of the RB tree. For debugging. 0 failure else height
3799+of tree (in count of black nodes).
3800+@return TRUE if OK FALSE if tree invalid. */
3801+UNIV_INTERN
3802+ibool
3803+rbt_validate(
3804+/*=========*/
3805+ const ib_rbt_t* tree); /*!< in: tree to validate */
3806+/****************************************************************//**
3807+Iterate over the tree in depth first order. */
3808+UNIV_INTERN
3809+void
3810+rbt_print(
3811+/*======*/
3812+ const ib_rbt_t* tree, /*!< in: tree to traverse */
3813+ ib_rbt_print_node print); /*!< in: print function */
3814+
3815+#endif /* INNOBASE_UT0RBT_H */
3816
3817=== modified file 'Percona-Server/storage/innobase/log/log0log.c'
3818--- Percona-Server/storage/innobase/log/log0log.c 2012-05-10 07:49:14 +0000
3819+++ Percona-Server/storage/innobase/log/log0log.c 2012-08-15 14:13:50 +0000
3820@@ -214,6 +214,54 @@
3821 return(lsn);
3822 }
3823
3824+/****************************************************************//**
3825+Safely reads the log_sys->tracked_lsn value. Uses atomic operations
3826+if available, otherwise this field is protected with the log system
3827+mutex. The writer counterpart function is log_set_tracked_lsn() in
3828+log0online.c.
3829+
3830+@return log_sys->tracked_lsn value. */
3831+UNIV_INLINE
3832+ib_uint64_t
3833+log_get_tracked_lsn()
3834+{
3835+#ifdef HAVE_ATOMIC_BUILTINS_64
3836+ return os_atomic_increment_uint64(&log_sys->tracked_lsn, 0);
3837+#else
3838+ ut_ad(mutex_own(&(log_sys->mutex)));
3839+ return log_sys->tracked_lsn;
3840+#endif
3841+}
3842+
3843+/****************************************************************//**
3844+Checks if the log groups have a big enough margin of free space in
3845+so that a new log entry can be written without overwriting log data
3846+that is not read by the changed page bitmap thread.
3847+@return TRUE if there is not enough free space. */
3848+static
3849+ibool
3850+log_check_tracking_margin(
3851+ ulint lsn_advance) /*!< in: an upper limit on how much log data we
3852+ plan to write. If zero, the margin will be
3853+ checked for the already-written log. */
3854+{
3855+ ib_uint64_t tracked_lsn;
3856+ ulint tracked_lsn_age;
3857+
3858+ if (!srv_track_changed_pages) {
3859+ return FALSE;
3860+ }
3861+
3862+ ut_ad(mutex_own(&(log_sys->mutex)));
3863+
3864+ tracked_lsn = log_get_tracked_lsn();
3865+ tracked_lsn_age = log_sys->lsn - tracked_lsn;
3866+
3867+ /* The overwrite would happen when log_sys->log_group_capacity is
3868+ exceeded, but we use max_checkpoint_age for an extra safety margin. */
3869+ return tracked_lsn_age + lsn_advance > log_sys->max_checkpoint_age;
3870+}
3871+
3872 /************************************************************//**
3873 Opens the log for log_write_low. The log must be closed with log_close and
3874 released with log_release.
3875@@ -230,9 +278,7 @@
3876 ulint archived_lsn_age;
3877 ulint dummy;
3878 #endif /* UNIV_LOG_ARCHIVE */
3879-#ifdef UNIV_DEBUG
3880 ulint count = 0;
3881-#endif /* UNIV_DEBUG */
3882
3883 ut_a(len < log->buf_size / 2);
3884 loop:
3885@@ -260,6 +306,19 @@
3886 goto loop;
3887 }
3888
3889+ if (log_check_tracking_margin(len_upper_limit) && (++count < 50)) {
3890+
3891+ /* This log write would violate the untracked LSN free space
3892+ margin. Limit this to 50 retries as there might be situations
3893+ where we have no choice but to proceed anyway, i.e. if the log
3894+ is about to be overflown, log tracking or not. */
3895+ mutex_exit(&(log->mutex));
3896+
3897+ os_thread_sleep(10000);
3898+
3899+ goto loop;
3900+ }
3901+
3902 #ifdef UNIV_LOG_ARCHIVE
3903 if (log->archiving_state != LOG_ARCH_OFF) {
3904
3905@@ -398,6 +457,8 @@
3906 ulint first_rec_group;
3907 ib_uint64_t oldest_lsn;
3908 ib_uint64_t lsn;
3909+ ib_uint64_t tracked_lsn;
3910+ ulint tracked_lsn_age;
3911 log_t* log = log_sys;
3912 ib_uint64_t checkpoint_age;
3913
3914@@ -424,6 +485,19 @@
3915 log->check_flush_or_checkpoint = TRUE;
3916 }
3917
3918+ if (srv_track_changed_pages) {
3919+
3920+ tracked_lsn = log_get_tracked_lsn();
3921+ tracked_lsn_age = lsn - tracked_lsn;
3922+
3923+ if (tracked_lsn_age >= log->log_group_capacity) {
3924+
3925+ fprintf(stderr, " InnoDB: Error: the age of the "
3926+ "oldest untracked record exceeds the log "
3927+ "group capacity!\n");
3928+ }
3929+ }
3930+
3931 checkpoint_age = lsn - log->last_checkpoint_lsn;
3932
3933 if (checkpoint_age >= log->log_group_capacity) {
3934@@ -891,6 +965,8 @@
3935 log_sys->archiving_on = os_event_create(NULL);
3936 #endif /* UNIV_LOG_ARCHIVE */
3937
3938+ log_sys->tracked_lsn = 0;
3939+
3940 /*----------------------------*/
3941
3942 log_block_init(log_sys->buf, log_sys->lsn);
3943@@ -1740,6 +1816,12 @@
3944 }
3945
3946 mutex_exit(&(log_sys->mutex));
3947+
3948+ /* Wake the redo log watching thread to parse the log up to this
3949+ checkpoint. */
3950+ if (srv_track_changed_pages) {
3951+ os_event_set(srv_checkpoint_completed_event);
3952+ }
3953 }
3954
3955 /*******************************************************************//**
3956@@ -3086,6 +3168,15 @@
3957
3958 log_checkpoint_margin();
3959
3960+ mutex_enter(&(log_sys->mutex));
3961+ if (log_check_tracking_margin(0)) {
3962+
3963+ mutex_exit(&(log_sys->mutex));
3964+ os_thread_sleep(10000);
3965+ goto loop;
3966+ }
3967+ mutex_exit(&(log_sys->mutex));
3968+
3969 #ifdef UNIV_LOG_ARCHIVE
3970 log_archive_margin();
3971 #endif /* UNIV_LOG_ARCHIVE */
3972@@ -3113,12 +3204,18 @@
3973 logs_empty_and_mark_files_at_shutdown(void)
3974 /*=======================================*/
3975 {
3976+<<<<<<< TREE
3977 ib_uint64_t lsn;
3978 ulint arch_log_no;
3979 ibool server_busy;
3980 ulint count = 0;
3981 ulint pending_io;
3982 ulint active_thd;
3983+=======
3984+ ib_uint64_t lsn;
3985+ ib_uint64_t tracked_lsn;
3986+ ulint arch_log_no;
3987+>>>>>>> MERGE-SOURCE
3988
3989 if (srv_print_verbose_log) {
3990 ut_print_timestamp(stderr);
3991@@ -3308,9 +3405,12 @@
3992
3993 mutex_enter(&log_sys->mutex);
3994
3995+ tracked_lsn = log_get_tracked_lsn();
3996+
3997 lsn = log_sys->lsn;
3998
3999 if (lsn != log_sys->last_checkpoint_lsn
4000+ || (srv_track_changed_pages && (tracked_lsn != log_sys->last_checkpoint_lsn))
4001 #ifdef UNIV_LOG_ARCHIVE
4002 || (srv_log_archive_on
4003 && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE)
4004@@ -3368,6 +3468,11 @@
4005
4006 srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE;
4007
4008+ /* Signal the log following thread to quit */
4009+ if (srv_track_changed_pages) {
4010+ os_event_set(srv_checkpoint_completed_event);
4011+ }
4012+
4013 /* Make some checks that the server really is quiet */
4014 ut_a(srv_get_active_thread_type() == ULINT_UNDEFINED);
4015
4016@@ -3388,6 +3493,10 @@
4017
4018 fil_flush_file_spaces(FIL_TABLESPACE);
4019
4020+ if (srv_track_changed_pages) {
4021+ os_event_wait(srv_redo_log_thread_finished_event);
4022+ }
4023+
4024 fil_close_all_files();
4025
4026 /* Make some checks that the server really is quiet */
4027@@ -3514,6 +3623,18 @@
4028 ((log_sys->n_log_ios - log_sys->n_log_ios_old)
4029 / time_elapsed));
4030
4031+ if (srv_track_changed_pages) {
4032+
4033+ /* The maximum tracked LSN age is equal to the maximum
4034+ checkpoint age */
4035+ fprintf(file,
4036+ "Log tracking enabled\n"
4037+ "Log tracked up to %llu\n"
4038+ "Max tracked LSN age %lu\n",
4039+ log_get_tracked_lsn(),
4040+ log_sys->max_checkpoint_age);
4041+ }
4042+
4043 log_sys->n_log_ios_old = log_sys->n_log_ios;
4044 log_sys->last_printout_time = current_time;
4045
4046
4047=== added file 'Percona-Server/storage/innobase/log/log0online.c'
4048--- Percona-Server/storage/innobase/log/log0online.c 1970-01-01 00:00:00 +0000
4049+++ Percona-Server/storage/innobase/log/log0online.c 2012-08-15 14:13:50 +0000
4050@@ -0,0 +1,1083 @@
4051+/*****************************************************************************
4052+
4053+Copyright (c) 2011-2012 Percona Inc. All Rights Reserved.
4054+
4055+This program is free software; you can redistribute it and/or modify it under
4056+the terms of the GNU General Public License as published by the Free Software
4057+Foundation; version 2 of the License.
4058+
4059+This program is distributed in the hope that it will be useful, but WITHOUT
4060+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
4061+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
4062+
4063+You should have received a copy of the GNU General Public License along with
4064+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
4065+Place, Suite 330, Boston, MA 02111-1307 USA
4066+
4067+*****************************************************************************/
4068+
4069+/**************************************************//**
4070+@file log/log0online.c
4071+Online database log parsing for changed page tracking
4072+
4073+*******************************************************/
4074+
4075+#include "log0online.h"
4076+
4077+#include "my_dbug.h"
4078+
4079+#include "log0recv.h"
4080+#include "mach0data.h"
4081+#include "mtr0log.h"
4082+#include "srv0srv.h"
4083+#include "srv0start.h"
4084+#include "trx0sys.h"
4085+#include "ut0rbt.h"
4086+
4087+enum { FOLLOW_SCAN_SIZE = 4 * (UNIV_PAGE_SIZE_MAX) };
4088+
4089+/** Log parsing and bitmap output data structure */
4090+struct log_bitmap_struct {
4091+ byte read_buf[FOLLOW_SCAN_SIZE];
4092+ /*!< log read buffer */
4093+ byte parse_buf[RECV_PARSING_BUF_SIZE];
4094+ /*!< log parse buffer */
4095+ byte* parse_buf_end; /*!< parse buffer position where the
4096+ next read log data should be copied to.
4097+ If the previous log records were fully
4098+ parsed, it points to the start,
4099+ otherwise points immediatelly past the
4100+ end of the incomplete log record. */
4101+ char* out_name; /*!< the file name for bitmap output */
4102+ os_file_t out; /*!< the bitmap output file */
4103+ ib_uint64_t out_offset; /*!< the next write position in the
4104+ bitmap output file */
4105+ ib_uint64_t start_lsn; /*!< the LSN of the next unparsed
4106+ record and the start of the next LSN
4107+ interval to be parsed. */
4108+ ib_uint64_t end_lsn; /*!< the end of the LSN interval to be
4109+ parsed, equal to the next checkpoint
4110+ LSN at the time of parse */
4111+ ib_uint64_t next_parse_lsn; /*!< the LSN of the next unparsed
4112+ record in the current parse */
4113+ ib_rbt_t* modified_pages; /*!< the current modified page set,
4114+ organized as the RB-tree with the keys
4115+ of (space, 4KB-block-start-page-id)
4116+ pairs */
4117+ ib_rbt_node_t* page_free_list; /*!< Singly-linked list of freed nodes
4118+ of modified_pages tree for later
4119+ reuse. Nodes are linked through
4120+ ib_rbt_node_t.left as this field has
4121+ both the correct type and the tree does
4122+ not mind its overwrite during
4123+ rbt_next() tree traversal. */
4124+};
4125+
4126+/* The log parsing and bitmap output struct instance */
4127+static struct log_bitmap_struct* log_bmp_sys;
4128+
4129+/* File name stem for modified page bitmaps */
4130+static const char* modified_page_stem = "ib_modified_log.";
4131+
4132+/* On server startup with empty database srv_start_lsn == 0, in
4133+which case the first LSN of actual log records will be this. */
4134+#define MIN_TRACKED_LSN ((LOG_START_LSN) + (LOG_BLOCK_HDR_SIZE))
4135+
4136+/* Tests if num bit of bitmap is set */
4137+#define IS_BIT_SET(bitmap, num) \
4138+ (*((bitmap) + ((num) >> 3)) & (1UL << ((num) & 7UL)))
4139+
4140+/** The bitmap file block size in bytes. All writes will be multiples of this.
4141+ */
4142+enum {
4143+ MODIFIED_PAGE_BLOCK_SIZE = 4096
4144+};
4145+
4146+
4147+/** Offsets in a file bitmap block */
4148+enum {
4149+ MODIFIED_PAGE_IS_LAST_BLOCK = 0,/* 1 if last block in the current
4150+ write, 0 otherwise. */
4151+ MODIFIED_PAGE_START_LSN = 4, /* The starting tracked LSN of this and
4152+ other blocks in the same write */
4153+ MODIFIED_PAGE_END_LSN = 12, /* The ending tracked LSN of this and
4154+ other blocks in the same write */
4155+ MODIFIED_PAGE_SPACE_ID = 20, /* The space ID of tracked pages in
4156+ this block */
4157+ MODIFIED_PAGE_1ST_PAGE_ID = 24, /* The page ID of the first tracked
4158+ page in this block */
4159+ MODIFIED_PAGE_BLOCK_UNUSED_1 = 28,/* Unused in order to align the start
4160+ of bitmap at 8 byte boundary */
4161+ MODIFIED_PAGE_BLOCK_BITMAP = 32,/* Start of the bitmap itself */
4162+ MODIFIED_PAGE_BLOCK_UNUSED_2 = MODIFIED_PAGE_BLOCK_SIZE - 8,
4163+ /* Unused in order to align the end of
4164+ bitmap at 8 byte boundary */
4165+ MODIFIED_PAGE_BLOCK_CHECKSUM = MODIFIED_PAGE_BLOCK_SIZE - 4
4166+ /* The checksum of the current block */
4167+};
4168+
4169+/** Length of the bitmap data in a block */
4170+enum { MODIFIED_PAGE_BLOCK_BITMAP_LEN
4171+ = MODIFIED_PAGE_BLOCK_UNUSED_2 - MODIFIED_PAGE_BLOCK_BITMAP };
4172+
4173+
4174+/****************************************************************//**
4175+Provide a comparisson function for the RB-tree tree (space,
4176+block_start_page) pairs. Actual implementation does not matter as
4177+long as the ordering is full.
4178+@return -1 if p1 < p2, 0 if p1 == p2, 1 if p1 > p2
4179+*/
4180+static
4181+int
4182+log_online_compare_bmp_keys(
4183+/*========================*/
4184+ const void* p1, /*!<in: 1st key to compare */
4185+ const void* p2) /*!<in: 2nd key to compare */
4186+{
4187+ const byte *k1 = (const byte *)p1;
4188+ const byte *k2 = (const byte *)p2;
4189+
4190+ ulint k1_space = mach_read_from_4(k1 + MODIFIED_PAGE_SPACE_ID);
4191+ ulint k2_space = mach_read_from_4(k2 + MODIFIED_PAGE_SPACE_ID);
4192+ if (k1_space == k2_space) {
4193+ ulint k1_start_page
4194+ = mach_read_from_4(k1 + MODIFIED_PAGE_1ST_PAGE_ID);
4195+ ulint k2_start_page
4196+ = mach_read_from_4(k2 + MODIFIED_PAGE_1ST_PAGE_ID);
4197+ return k1_start_page < k2_start_page
4198+ ? -1 : k1_start_page > k2_start_page ? 1 : 0;
4199+ }
4200+ return k1_space < k2_space ? -1 : 1;
4201+}
4202+
4203+/****************************************************************//**
4204+Set a bit for tracked page in the bitmap. Expand the bitmap tree as
4205+necessary. */
4206+static
4207+void
4208+log_online_set_page_bit(
4209+/*====================*/
4210+ ulint space, /*!<in: log record space id */
4211+ ulint page_no)/*!<in: log record page id */
4212+{
4213+ ulint block_start_page;
4214+ ulint block_pos;
4215+ uint bit_pos;
4216+ ib_rbt_bound_t tree_search_pos;
4217+ byte search_page[MODIFIED_PAGE_BLOCK_SIZE];
4218+ byte *page_ptr;
4219+
4220+ ut_a(space != ULINT_UNDEFINED);
4221+ ut_a(page_no != ULINT_UNDEFINED);
4222+
4223+ block_start_page = page_no / (8 * MODIFIED_PAGE_BLOCK_BITMAP_LEN)
4224+ * MODIFIED_PAGE_BLOCK_BITMAP_LEN;
4225+ block_pos = block_start_page ? (page_no % block_start_page / 8)
4226+ : (page_no / 8);
4227+ bit_pos = page_no % 8;
4228+
4229+ mach_write_to_4(search_page + MODIFIED_PAGE_SPACE_ID, space);
4230+ mach_write_to_4(search_page + MODIFIED_PAGE_1ST_PAGE_ID,
4231+ block_start_page);
4232+
4233+ if (!rbt_search(log_bmp_sys->modified_pages, &tree_search_pos,
4234+ search_page)) {
4235+ page_ptr = rbt_value(byte, tree_search_pos.last);
4236+ }
4237+ else {
4238+ ib_rbt_node_t *new_node;
4239+
4240+ if (log_bmp_sys->page_free_list) {
4241+ new_node = log_bmp_sys->page_free_list;
4242+ log_bmp_sys->page_free_list = new_node->left;
4243+ }
4244+ else {
4245+ new_node = ut_malloc(SIZEOF_NODE(
4246+ log_bmp_sys->modified_pages));
4247+ }
4248+ memset(new_node, 0, SIZEOF_NODE(log_bmp_sys->modified_pages));
4249+
4250+ page_ptr = rbt_value(byte, new_node);
4251+ mach_write_to_4(page_ptr + MODIFIED_PAGE_SPACE_ID, space);
4252+ mach_write_to_4(page_ptr + MODIFIED_PAGE_1ST_PAGE_ID,
4253+ block_start_page);
4254+
4255+ rbt_add_preallocated_node(log_bmp_sys->modified_pages,
4256+ &tree_search_pos, new_node);
4257+ }
4258+ page_ptr[MODIFIED_PAGE_BLOCK_BITMAP + block_pos] |= (1U << bit_pos);
4259+}
4260+
4261+/****************************************************************//**
4262+Calculate a bitmap block checksum. Algorithm borrowed from
4263+log_block_calc_checksum.
4264+@return checksum */
4265+UNIV_INLINE
4266+ulint
4267+log_online_calc_checksum(
4268+/*=====================*/
4269+ const byte* block) /*!<in: bitmap block */
4270+{
4271+ ulint sum;
4272+ ulint sh;
4273+ ulint i;
4274+
4275+ sum = 1;
4276+ sh = 0;
4277+
4278+ for (i = 0; i < MODIFIED_PAGE_BLOCK_CHECKSUM; i++) {
4279+
4280+ ulint b = block[i];
4281+ sum &= 0x7FFFFFFFUL;
4282+ sum += b;
4283+ sum += b << sh;
4284+ sh++;
4285+ if (sh > 24) {
4286+ sh = 0;
4287+ }
4288+ }
4289+
4290+ return sum;
4291+}
4292+
4293+/****************************************************************//**
4294+Get the last tracked fully LSN from the bitmap file by reading
4295+backwards untile a correct end page is found. Detects incomplete
4296+writes and corrupted data. Sets the start output position for the
4297+written bitmap data.
4298+@return the last fully tracked LSN */
4299+static
4300+ib_uint64_t
4301+log_online_read_last_tracked_lsn()
4302+/*==============================*/
4303+{
4304+ byte page[MODIFIED_PAGE_BLOCK_SIZE];
4305+ ib_uint64_t read_offset = log_bmp_sys->out_offset;
4306+ /* Initialize these to nonequal values so that file size == 0 case with
4307+ zero loop repetitions is handled correctly */
4308+ ulint checksum = 0;
4309+ ulint actual_checksum = !checksum;
4310+ ibool is_last_page = FALSE;
4311+ ib_uint64_t result;
4312+
4313+ ut_ad(log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE == 0);
4314+
4315+ while (checksum != actual_checksum && read_offset > 0 && !is_last_page)
4316+ {
4317+
4318+ ulint offset_low, offset_high;
4319+ ibool success;
4320+
4321+ read_offset -= MODIFIED_PAGE_BLOCK_SIZE;
4322+ offset_high = (ulint)(read_offset >> 32);
4323+ offset_low = (ulint)(read_offset & 0xFFFFFFFF);
4324+
4325+ success = os_file_read(log_bmp_sys->out, page, offset_low,
4326+ offset_high, MODIFIED_PAGE_BLOCK_SIZE);
4327+ if (!success) {
4328+
4329+ /* The following call prints an error message */
4330+ os_file_get_last_error(TRUE);
4331+ /* Here and below assume that bitmap file names do not
4332+ contain apostrophes, thus no need for
4333+ ut_print_filename(). */
4334+ fprintf(stderr, "InnoDB: Warning: failed reading "
4335+ "changed page bitmap file \'%s\'\n",
4336+ log_bmp_sys->out_name);
4337+ return MIN_TRACKED_LSN;
4338+ }
4339+
4340+ is_last_page
4341+ = mach_read_from_4(page + MODIFIED_PAGE_IS_LAST_BLOCK);
4342+ checksum = mach_read_from_4(page
4343+ + MODIFIED_PAGE_BLOCK_CHECKSUM);
4344+ actual_checksum = log_online_calc_checksum(page);
4345+ if (checksum != actual_checksum) {
4346+
4347+ fprintf(stderr, "InnoDB: Warning: corruption "
4348+ "detected in \'%s\' at offset %llu\n",
4349+ log_bmp_sys->out_name, read_offset);
4350+ }
4351+
4352+ };
4353+
4354+ if (UNIV_LIKELY(checksum == actual_checksum && is_last_page)) {
4355+
4356+ log_bmp_sys->out_offset = read_offset
4357+ + MODIFIED_PAGE_BLOCK_SIZE;
4358+ result = mach_read_ull(page + MODIFIED_PAGE_END_LSN);
4359+ }
4360+ else {
4361+ log_bmp_sys->out_offset = read_offset;
4362+ result = 0;
4363+ }
4364+
4365+ /* Truncate the output file to discard the corrupted bitmap data, if
4366+ any */
4367+ if (!os_file_set_eof_at(log_bmp_sys->out,
4368+ log_bmp_sys->out_offset)) {
4369+ fprintf(stderr, "InnoDB: Warning: failed truncating "
4370+ "changed page bitmap file \'%s\' to %llu bytes\n",
4371+ log_bmp_sys->out_name, log_bmp_sys->out_offset);
4372+ result = 0;
4373+ }
4374+ return result;
4375+}
4376+
4377+/****************************************************************//**
4378+Safely write the log_sys->tracked_lsn value. Uses atomic operations
4379+if available, otherwise this field is protected with the log system
4380+mutex. The reader counterpart function is log_get_tracked_lsn() in
4381+log0log.c. */
4382+UNIV_INLINE
4383+void
4384+log_set_tracked_lsn(
4385+/*================*/
4386+ ib_uint64_t tracked_lsn) /*!<in: new value */
4387+{
4388+#ifdef HAVE_ATOMIC_BUILTINS_64
4389+ /* Single writer, no data race here */
4390+ ib_uint64_t old_value
4391+ = os_atomic_increment_uint64(&log_sys->tracked_lsn, 0);
4392+ os_atomic_increment_uint64(&log_sys->tracked_lsn,
4393+ tracked_lsn - old_value);
4394+#else
4395+ mutex_enter(&log_sys->mutex);
4396+ log_sys->tracked_lsn = tracked_lsn;
4397+ mutex_exit(&log_sys->mutex);
4398+#endif
4399+}
4400+
4401+/****************************************************************//**
4402+Diagnose a gap in tracked LSN range on server startup due to crash or
4403+very fast shutdown and try to close it by tracking the data
4404+immediatelly, if possible. */
4405+static
4406+void
4407+log_online_track_missing_on_startup(
4408+/*================================*/
4409+ ib_uint64_t last_tracked_lsn, /*!<in: last tracked LSN read
4410+ from the bitmap file */
4411+ ib_uint64_t tracking_start_lsn) /*!<in: last checkpoint LSN of
4412+ the current server startup */
4413+{
4414+ ut_ad(last_tracked_lsn != tracking_start_lsn);
4415+
4416+ fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' is %llu, but "
4417+ "last checkpoint LSN is %llu. This might be due to a server "
4418+ "crash or a very fast shutdown. ", log_bmp_sys->out_name,
4419+ last_tracked_lsn, tracking_start_lsn);
4420+
4421+ /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
4422+ bitmap file, handle this too. */
4423+ last_tracked_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN);
4424+
4425+ /* See if we can fully recover the missing interval */
4426+ if (log_sys->lsn - last_tracked_lsn < log_sys->log_group_capacity) {
4427+
4428+ fprintf(stderr,
4429+ "Reading the log to advance the last tracked LSN.\n");
4430+
4431+ log_bmp_sys->start_lsn = last_tracked_lsn;
4432+ log_set_tracked_lsn(log_bmp_sys->start_lsn);
4433+ log_online_follow_redo_log();
4434+ ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn);
4435+
4436+ fprintf(stderr,
4437+ "InnoDB: continuing tracking changed pages from LSN "
4438+ "%llu\n", log_bmp_sys->end_lsn);
4439+ }
4440+ else {
4441+ fprintf(stderr,
4442+ "The age of last tracked LSN exceeds log capacity, "
4443+ "tracking-based incremental backups will work only "
4444+ "from the higher LSN!\n");
4445+
4446+ log_bmp_sys->end_lsn = log_bmp_sys->start_lsn
4447+ = tracking_start_lsn;
4448+ log_set_tracked_lsn(log_bmp_sys->start_lsn);
4449+
4450+ fprintf(stderr,
4451+ "InnoDB: starting tracking changed pages from LSN "
4452+ "%llu\n", log_bmp_sys->end_lsn);
4453+ }
4454+}
4455+
4456+/*********************************************************************//**
4457+Initialize the online log following subsytem. */
4458+UNIV_INTERN
4459+void
4460+log_online_read_init()
4461+/*==================*/
4462+{
4463+ char buf[FN_REFLEN];
4464+ ibool success;
4465+ ib_uint64_t tracking_start_lsn
4466+ = ut_max(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
4467+
4468+ /* Assert (could be compile-time assert) that bitmap data start and end
4469+ in a bitmap block is 8-byte aligned */
4470+ ut_a(MODIFIED_PAGE_BLOCK_BITMAP % 8 == 0);
4471+ ut_a(MODIFIED_PAGE_BLOCK_BITMAP_LEN % 8 == 0);
4472+
4473+ log_bmp_sys = ut_malloc(sizeof(*log_bmp_sys));
4474+
4475+ ut_snprintf(buf, FN_REFLEN, "%s%s%d", srv_data_home,
4476+ modified_page_stem, 1);
4477+ log_bmp_sys->out_name = ut_malloc(strlen(buf) + 1);
4478+ ut_strcpy(log_bmp_sys->out_name, buf);
4479+
4480+ log_bmp_sys->modified_pages = rbt_create(MODIFIED_PAGE_BLOCK_SIZE,
4481+ log_online_compare_bmp_keys);
4482+ log_bmp_sys->page_free_list = NULL;
4483+
4484+ log_bmp_sys->out
4485+ = os_file_create_simple_no_error_handling
4486+ (log_bmp_sys->out_name, OS_FILE_OPEN, OS_FILE_READ_WRITE,
4487+ &success);
4488+
4489+ if (!success) {
4490+
4491+ /* New file, tracking from scratch */
4492+ log_bmp_sys->out
4493+ = os_file_create_simple_no_error_handling
4494+ (log_bmp_sys->out_name, OS_FILE_CREATE,
4495+ OS_FILE_READ_WRITE, &success);
4496+ if (!success) {
4497+
4498+ /* The following call prints an error message */
4499+ os_file_get_last_error(TRUE);
4500+ fprintf(stderr,
4501+ "InnoDB: Error: Cannot create \'%s\'\n",
4502+ log_bmp_sys->out_name);
4503+ exit(1);
4504+ }
4505+
4506+ log_bmp_sys->out_offset = 0;
4507+ }
4508+ else {
4509+
4510+ /* Old file, read last tracked LSN and continue from there */
4511+ ulint size_low;
4512+ ulint size_high;
4513+ ib_uint64_t last_tracked_lsn;
4514+
4515+ success = os_file_get_size(log_bmp_sys->out, &size_low,
4516+ &size_high);
4517+ ut_a(success);
4518+
4519+ log_bmp_sys->out_offset
4520+ = ((ib_uint64_t)size_high << 32) | size_low;
4521+
4522+ if (log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE != 0) {
4523+
4524+ fprintf(stderr,
4525+ "InnoDB: Warning: truncated block detected "
4526+ "in \'%s\' at offset %llu\n",
4527+ log_bmp_sys->out_name,
4528+ log_bmp_sys->out_offset);
4529+ log_bmp_sys->out_offset -=
4530+ log_bmp_sys->out_offset
4531+ % MODIFIED_PAGE_BLOCK_SIZE;
4532+ }
4533+
4534+ last_tracked_lsn = log_online_read_last_tracked_lsn();
4535+
4536+ if (last_tracked_lsn < tracking_start_lsn) {
4537+
4538+ log_online_track_missing_on_startup(last_tracked_lsn,
4539+ tracking_start_lsn);
4540+ return;
4541+ }
4542+
4543+ if (last_tracked_lsn > tracking_start_lsn) {
4544+
4545+ fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' "
4546+ "is %llu, but last checkpoint LSN is %llu. "
4547+ "The tracking-based incremental backups will "
4548+ "work only from the latter LSN!\n",
4549+ log_bmp_sys->out_name, last_tracked_lsn,
4550+ tracking_start_lsn);
4551+ }
4552+
4553+ }
4554+
4555+ fprintf(stderr, "InnoDB: starting tracking changed pages from "
4556+ "LSN %llu\n", tracking_start_lsn);
4557+ log_bmp_sys->start_lsn = tracking_start_lsn;
4558+ log_set_tracked_lsn(tracking_start_lsn);
4559+}
4560+
4561+/*********************************************************************//**
4562+Shut down the online log following subsystem. */
4563+UNIV_INTERN
4564+void
4565+log_online_read_shutdown()
4566+/*======================*/
4567+{
4568+ ib_rbt_node_t *free_list_node = log_bmp_sys->page_free_list;
4569+
4570+ os_file_close(log_bmp_sys->out);
4571+
4572+ rbt_free(log_bmp_sys->modified_pages);
4573+
4574+ while (free_list_node) {
4575+ ib_rbt_node_t *next = free_list_node->left;
4576+ ut_free(free_list_node);
4577+ free_list_node = next;
4578+ }
4579+
4580+ ut_free(log_bmp_sys->out_name);
4581+ ut_free(log_bmp_sys);
4582+}
4583+
4584+/*********************************************************************//**
4585+For the given minilog record type determine if the record has (space; page)
4586+associated with it.
4587+@return TRUE if the record has (space; page) in it */
4588+static
4589+ibool
4590+log_online_rec_has_page(
4591+/*====================*/
4592+ byte type) /*!<in: the minilog record type */
4593+{
4594+ return type != MLOG_MULTI_REC_END && type != MLOG_DUMMY_RECORD;
4595+}
4596+
4597+/*********************************************************************//**
4598+Check if a page field for a given log record type actually contains a page
4599+id. It does not for file operations and MLOG_LSN.
4600+@return TRUE if page field contains actual page id, FALSE otherwise */
4601+static
4602+ibool
4603+log_online_rec_page_means_page(
4604+/*===========================*/
4605+ byte type) /*!<in: log record type */
4606+{
4607+ return log_online_rec_has_page(type)
4608+#ifdef UNIV_LOG_LSN_DEBUG
4609+ && type != MLOG_LSN
4610+#endif
4611+ && type != MLOG_FILE_CREATE
4612+ && type != MLOG_FILE_RENAME
4613+ && type != MLOG_FILE_DELETE
4614+ && type != MLOG_FILE_CREATE2;
4615+}
4616+
4617+/*********************************************************************//**
4618+Parse the log data in the parse buffer for the (space, page) pairs and add
4619+them to the modified page set as necessary. Removes the fully-parsed records
4620+from the buffer. If an incomplete record is found, moves it to the end of the
4621+buffer. */
4622+static
4623+void
4624+log_online_parse_redo_log()
4625+/*=======================*/
4626+{
4627+ byte *ptr = log_bmp_sys->parse_buf;
4628+ byte *end = log_bmp_sys->parse_buf_end;
4629+
4630+ ulint len = 0;
4631+
4632+ while (ptr != end
4633+ && log_bmp_sys->next_parse_lsn < log_bmp_sys->end_lsn) {
4634+
4635+ byte type;
4636+ ulint space;
4637+ ulint page_no;
4638+ byte* body;
4639+
4640+ /* recv_sys is not initialized, so on corrupt log we will
4641+ SIGSEGV. But the log of a live database should not be
4642+ corrupt. */
4643+ len = recv_parse_log_rec(ptr, end, &type, &space, &page_no,
4644+ &body);
4645+ if (len > 0) {
4646+
4647+ if (log_online_rec_page_means_page(type)
4648+ && (space != TRX_DOUBLEWRITE_SPACE)) {
4649+
4650+ ut_a(len >= 3);
4651+ log_online_set_page_bit(space, page_no);
4652+ }
4653+
4654+ ptr += len;
4655+ ut_ad(ptr <= end);
4656+ log_bmp_sys->next_parse_lsn
4657+ = recv_calc_lsn_on_data_add
4658+ (log_bmp_sys->next_parse_lsn, len);
4659+ }
4660+ else {
4661+
4662+ /* Incomplete log record. Shift it to the
4663+ beginning of the parse buffer and leave it to be
4664+ completed on the next read. */
4665+ ut_memmove(log_bmp_sys->parse_buf, ptr, end - ptr);
4666+ log_bmp_sys->parse_buf_end
4667+ = log_bmp_sys->parse_buf + (end - ptr);
4668+ ptr = end;
4669+ }
4670+ }
4671+
4672+ if (len > 0) {
4673+
4674+ log_bmp_sys->parse_buf_end = log_bmp_sys->parse_buf;
4675+ }
4676+}
4677+
4678+/*********************************************************************//**
4679+Check the log block checksum.
4680+@return TRUE if the log block checksum is OK, FALSE otherwise. */
4681+static
4682+ibool
4683+log_online_is_valid_log_seg(
4684+/*========================*/
4685+ const byte* log_block) /*!< in: read log data */
4686+{
4687+ ibool checksum_is_ok
4688+ = log_block_checksum_is_ok_or_old_format(log_block);
4689+
4690+ if (!checksum_is_ok) {
4691+
4692+ fprintf(stderr,
4693+ "InnoDB Error: log block checksum mismatch"
4694+ "expected %lu, calculated checksum %lu\n",
4695+ (ulong) log_block_get_checksum(log_block),
4696+ (ulong) log_block_calc_checksum(log_block));
4697+ }
4698+
4699+ return checksum_is_ok;
4700+}
4701+
4702+/*********************************************************************//**
4703+Copy new log data to the parse buffer while skipping log block header,
4704+trailer and already parsed data. */
4705+static
4706+void
4707+log_online_add_to_parse_buf(
4708+/*========================*/
4709+ const byte* log_block, /*!< in: read log data */
4710+ ulint data_len, /*!< in: length of read log data */
4711+ ulint skip_len) /*!< in: how much of log data to
4712+ skip */
4713+{
4714+ ulint start_offset = skip_len ? skip_len : LOG_BLOCK_HDR_SIZE;
4715+ ulint end_offset
4716+ = (data_len == OS_FILE_LOG_BLOCK_SIZE)
4717+ ? data_len - LOG_BLOCK_TRL_SIZE
4718+ : data_len;
4719+ ulint actual_data_len = (end_offset >= start_offset)
4720+ ? end_offset - start_offset : 0;
4721+
4722+ ut_memcpy(log_bmp_sys->parse_buf_end, log_block + start_offset,
4723+ actual_data_len);
4724+
4725+ log_bmp_sys->parse_buf_end += actual_data_len;
4726+
4727+ ut_a(log_bmp_sys->parse_buf_end - log_bmp_sys->parse_buf
4728+ <= RECV_PARSING_BUF_SIZE);
4729+}
4730+
4731+/*********************************************************************//**
4732+Parse the log block: first copies the read log data to the parse buffer while
4733+skipping log block header, trailer and already parsed data. Then it actually
4734+parses the log to add to the modified page bitmap. */
4735+static
4736+void
4737+log_online_parse_redo_log_block(
4738+/*============================*/
4739+ const byte* log_block, /*!< in: read log data */
4740+ ulint skip_already_parsed_len) /*!< in: how many bytes of
4741+ log data should be skipped as
4742+ they were parsed before */
4743+{
4744+ ulint block_data_len;
4745+
4746+ block_data_len = log_block_get_data_len(log_block);
4747+
4748+ ut_ad(block_data_len % OS_FILE_LOG_BLOCK_SIZE == 0
4749+ || block_data_len < OS_FILE_LOG_BLOCK_SIZE);
4750+
4751+ log_online_add_to_parse_buf(log_block, block_data_len,
4752+ skip_already_parsed_len);
4753+ log_online_parse_redo_log();
4754+}
4755+
4756+/*********************************************************************//**
4757+Read and parse one redo log chunk and updates the modified page bitmap. */
4758+static
4759+void
4760+log_online_follow_log_seg(
4761+/*======================*/
4762+ log_group_t* group, /*!< in: the log group to use */
4763+ ib_uint64_t block_start_lsn, /*!< in: the LSN to read from */
4764+ ib_uint64_t block_end_lsn) /*!< in: the LSN to read to */
4765+{
4766+ /* Pointer to the current OS_FILE_LOG_BLOCK-sized chunk of the read log
4767+ data to parse */
4768+ byte* log_block = log_bmp_sys->read_buf;
4769+ byte* log_block_end = log_bmp_sys->read_buf
4770+ + (block_end_lsn - block_start_lsn);
4771+
4772+ mutex_enter(&log_sys->mutex);
4773+ log_group_read_log_seg(LOG_RECOVER, log_bmp_sys->read_buf,
4774+ group, block_start_lsn, block_end_lsn);
4775+ mutex_exit(&log_sys->mutex);
4776+
4777+ while (log_block < log_block_end
4778+ && log_bmp_sys->next_parse_lsn < log_bmp_sys->end_lsn) {
4779+
4780+ /* How many bytes of log data should we skip in the current log
4781+ block. Skipping is necessary because we round down the next
4782+ parse LSN thus it is possible to read the already-processed log
4783+ data many times */
4784+ ulint skip_already_parsed_len = 0;
4785+
4786+ if (!log_online_is_valid_log_seg(log_block)) {
4787+ break;
4788+ }
4789+
4790+ if ((block_start_lsn <= log_bmp_sys->next_parse_lsn)
4791+ && (block_start_lsn + OS_FILE_LOG_BLOCK_SIZE
4792+ > log_bmp_sys->next_parse_lsn)) {
4793+
4794+ /* The next parse LSN is inside the current block, skip
4795+ data preceding it. */
4796+ skip_already_parsed_len
4797+ = log_bmp_sys->next_parse_lsn
4798+ - block_start_lsn;
4799+ }
4800+ else {
4801+
4802+ /* If the next parse LSN is not inside the current
4803+ block, then the only option is that we have processed
4804+ ahead already. */
4805+ ut_a(block_start_lsn > log_bmp_sys->next_parse_lsn);
4806+ }
4807+
4808+ /* TODO: merge the copying to the parse buf code with
4809+ skip_already_len calculations */
4810+ log_online_parse_redo_log_block(log_block,
4811+ skip_already_parsed_len);
4812+
4813+ log_block += OS_FILE_LOG_BLOCK_SIZE;
4814+ block_start_lsn += OS_FILE_LOG_BLOCK_SIZE;
4815+ }
4816+
4817+ return;
4818+}
4819+
4820+/*********************************************************************//**
4821+Read and parse the redo log in a given group in FOLLOW_SCAN_SIZE-sized
4822+chunks and updates the modified page bitmap. */
4823+static
4824+void
4825+log_online_follow_log_group(
4826+/*========================*/
4827+ log_group_t* group, /*!< in: the log group to use */
4828+ ib_uint64_t contiguous_lsn) /*!< in: the LSN of log block start
4829+ containing the log_parse_start_lsn */
4830+{
4831+ ib_uint64_t block_start_lsn = contiguous_lsn;
4832+ ib_uint64_t block_end_lsn;
4833+
4834+ log_bmp_sys->next_parse_lsn = log_bmp_sys->start_lsn;
4835+ log_bmp_sys->parse_buf_end = log_bmp_sys->parse_buf;
4836+
4837+ do {
4838+ block_end_lsn = block_start_lsn + FOLLOW_SCAN_SIZE;
4839+
4840+ log_online_follow_log_seg(group, block_start_lsn,
4841+ block_end_lsn);
4842+
4843+ /* Next parse LSN can become higher than the last read LSN
4844+ only in the case when the read LSN falls right on the block
4845+ boundary, in which case next parse lsn is bumped to the actual
4846+ data LSN on the next (not yet read) block. This assert is
4847+ slightly conservative. */
4848+ ut_a(log_bmp_sys->next_parse_lsn
4849+ <= block_end_lsn + LOG_BLOCK_HDR_SIZE
4850+ + LOG_BLOCK_TRL_SIZE);
4851+
4852+ block_start_lsn = block_end_lsn;
4853+ } while (block_end_lsn < log_bmp_sys->end_lsn);
4854+
4855+ /* Assert that the last read log record is a full one */
4856+ ut_a(log_bmp_sys->parse_buf_end == log_bmp_sys->parse_buf);
4857+}
4858+
4859+/*********************************************************************//**
4860+Write, flush one bitmap block to disk and advance the output position if
4861+successful. */
4862+static
4863+void
4864+log_online_write_bitmap_page(
4865+/*=========================*/
4866+ const byte *block) /*!< in: block to write */
4867+{
4868+ ibool success;
4869+
4870+ success = os_file_write(log_bmp_sys->out_name,log_bmp_sys->out,
4871+ block,
4872+ (ulint)(log_bmp_sys->out_offset & 0xFFFFFFFF),
4873+ (ulint)(log_bmp_sys->out_offset << 32),
4874+ MODIFIED_PAGE_BLOCK_SIZE);
4875+ if (UNIV_UNLIKELY(!success)) {
4876+
4877+ /* The following call prints an error message */
4878+ os_file_get_last_error(TRUE);
4879+ fprintf(stderr, "InnoDB: Error: failed writing changed page "
4880+ "bitmap file \'%s\'\n", log_bmp_sys->out_name);
4881+ return;
4882+ }
4883+
4884+ success = os_file_flush(log_bmp_sys->out, FALSE);
4885+ if (UNIV_UNLIKELY(!success)) {
4886+
4887+ /* The following call prints an error message */
4888+ os_file_get_last_error(TRUE);
4889+ fprintf(stderr, "InnoDB: Error: failed flushing "
4890+ "changed page bitmap file \'%s\'\n",
4891+ log_bmp_sys->out_name);
4892+ return;
4893+ }
4894+
4895+ log_bmp_sys->out_offset += MODIFIED_PAGE_BLOCK_SIZE;
4896+}
4897+
4898+/*********************************************************************//**
4899+Append the current changed page bitmap to the bitmap file. Clears the
4900+bitmap tree and recycles its nodes to the free list. */
4901+static
4902+void
4903+log_online_write_bitmap()
4904+/*=====================*/
4905+{
4906+ ib_rbt_node_t *bmp_tree_node;
4907+ const ib_rbt_node_t *last_bmp_tree_node;
4908+
4909+ bmp_tree_node = (ib_rbt_node_t *)
4910+ rbt_first(log_bmp_sys->modified_pages);
4911+ last_bmp_tree_node = rbt_last(log_bmp_sys->modified_pages);
4912+
4913+ while (bmp_tree_node) {
4914+
4915+ byte *page = rbt_value(byte, bmp_tree_node);
4916+
4917+ if (bmp_tree_node == last_bmp_tree_node) {
4918+ mach_write_to_4(page + MODIFIED_PAGE_IS_LAST_BLOCK, 1);
4919+ }
4920+
4921+ mach_write_ull(page + MODIFIED_PAGE_START_LSN,
4922+ log_bmp_sys->start_lsn);
4923+ mach_write_ull(page + MODIFIED_PAGE_END_LSN,
4924+ log_bmp_sys->end_lsn);
4925+ mach_write_to_4(page + MODIFIED_PAGE_BLOCK_CHECKSUM,
4926+ log_online_calc_checksum(page));
4927+
4928+ log_online_write_bitmap_page(page);
4929+
4930+ bmp_tree_node->left = log_bmp_sys->page_free_list;
4931+ log_bmp_sys->page_free_list = bmp_tree_node;
4932+
4933+ bmp_tree_node = (ib_rbt_node_t*)
4934+ rbt_next(log_bmp_sys->modified_pages, bmp_tree_node);
4935+ }
4936+
4937+ rbt_reset(log_bmp_sys->modified_pages);
4938+}
4939+
4940+/*********************************************************************//**
4941+Read and parse the redo log up to last checkpoint LSN to build the changed
4942+page bitmap which is then written to disk. */
4943+UNIV_INTERN
4944+void
4945+log_online_follow_redo_log()
4946+/*========================*/
4947+{
4948+ ib_uint64_t contiguous_start_lsn;
4949+ log_group_t* group;
4950+
4951+ /* Grab the LSN of the last checkpoint, we will parse up to it */
4952+ mutex_enter(&(log_sys->mutex));
4953+ log_bmp_sys->end_lsn = log_sys->last_checkpoint_lsn;
4954+ mutex_exit(&(log_sys->mutex));
4955+
4956+ if (log_bmp_sys->end_lsn == log_bmp_sys->start_lsn) {
4957+ return;
4958+ }
4959+
4960+ group = UT_LIST_GET_FIRST(log_sys->log_groups);
4961+ ut_a(group);
4962+
4963+ contiguous_start_lsn = ut_uint64_align_down(log_bmp_sys->start_lsn,
4964+ OS_FILE_LOG_BLOCK_SIZE);
4965+
4966+ while (group) {
4967+ log_online_follow_log_group(group, contiguous_start_lsn);
4968+ group = UT_LIST_GET_NEXT(log_groups, group);
4969+ }
4970+
4971+ /* A crash injection site that ensures last checkpoint LSN > last
4972+ tracked LSN, so that LSN tracking for this interval is tested. */
4973+ DBUG_EXECUTE_IF("crash_before_bitmap_write", DBUG_SUICIDE(););
4974+
4975+ log_online_write_bitmap();
4976+ log_bmp_sys->start_lsn = log_bmp_sys->end_lsn;
4977+ log_set_tracked_lsn(log_bmp_sys->start_lsn);
4978+}
4979+
4980+/*********************************************************************//**
4981+Initializes log bitmap iterator.
4982+@return TRUE if the iterator is initialized OK, FALSE otherwise. */
4983+UNIV_INTERN
4984+ibool
4985+log_online_bitmap_iterator_init(
4986+/*============================*/
4987+ log_bitmap_iterator_t *i) /*!<in/out: iterator */
4988+{
4989+ ibool success;
4990+
4991+ ut_a(i);
4992+ ut_snprintf(i->in_name, FN_REFLEN, "%s%s%d", srv_data_home,
4993+ modified_page_stem, 1);
4994+ i->in_offset = 0;
4995+ /*
4996+ Set up bit offset out of the reasonable limit
4997+ to intiate reading block from file in
4998+ log_online_bitmap_iterator_next()
4999+ */
5000+ i->bit_offset = MODIFIED_PAGE_BLOCK_BITMAP_LEN;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches