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

Proposed by Vlad Lesin
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) Needs Fixing
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.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

It seems that the target branch is wrong.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'Makefile.OTHER'
--- Makefile.OTHER 1970-01-01 00:00:00 +0000
+++ Makefile.OTHER 2012-08-15 14:13:50 +0000
@@ -0,0 +1,77 @@
1MYSQL_VERSION=5.1.63
2PERCONA_SERVER_VERSION=rel13.4
3PERCONA_SERVER ?=Percona-Server-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)
4PERCONA_SERVER_SHORT_1 ?=Percona-Server-$(MYSQL_VERSION)
5PERCONA_SERVER_SHORT_2 ?=Percona-Server
6KEWPIE ?=kewpie
7BASEDIR = $(CURDIR)
8
9all: main install-lic handlersocket maatkit-udf autorun
10 @echo ""
11 @echo "Percona Server source code is ready"
12 @echo "Now change directory to $(PERCONA_SERVER) define variables as show below"
13 @echo ""
14 export CFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2"
15 export CXXFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2"
16 export LIBS=-lrt
17 @echo ""
18 @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"
19 @echo ""
20
21autorun:
22 cd $(PERCONA_SERVER) && ./BUILD/autorun.sh
23
24handlersocket:
25 cp -R HandlerSocket-Plugin-for-MySQL $(PERCONA_SERVER)/storage
26 patch -p1 -d $(PERCONA_SERVER)/storage < handlersocket.patch
27
28maatkit-udf:
29 cp -R UDF "$(PERCONA_SERVER)"
30 cd "$(PERCONA_SERVER)"/UDF && autoreconf --install
31
32install-lic:
33 @echo "Installing license files"
34 install -m 644 COPYING.* $(PERCONA_SERVER)
35
36prepare:
37 @echo "Prepare Percona Server sources"
38 rm -rf $(PERCONA_SERVER) $(PERCONA_SERVER_SHORT_1)
39 ln -s $(PERCONA_SERVER_SHORT_2) $(PERCONA_SERVER)
40 ln -s $(PERCONA_SERVER_SHORT_2) $(PERCONA_SERVER_SHORT_1)
41
42main: prepare
43
44clean:
45 rm -rf $(PERCONA_SERVER) $(PERCONA_SERVER_SHORT_1)
46
47test-crashme:
48 cd $(KEWPIE) && ./kewpie.py --suite=crashme --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
49
50test-sqlbench:
51 cd $(KEWPIE) && ./kewpie.py --suite=sqlbench --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
52
53test-randgen:
54 cd $(KEWPIE) && ./kewpie.py --suite=randgen_basic --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
55
56test-randgen-bugs:
57 cd $(KEWPIE) && ./kewpie.py --suite=randgen_bugs --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
58
59test-cluster:
60 cd $(KEWPIE) && ./kewpie.py --suite=cluster_basic,cluster_randgen --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
61
62test-cluster-basic:
63 cd $(KEWPIE) && ./kewpie.py --suite=cluster_basic --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
64
65test-cluster-randgen:
66 cd $(KEWPIE) && ./kewpie.py --suite=cluster_randgen --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
67
68test-cluster-bugs:
69 cd $(KEWPIE) && ./kewpie.py --suite=cluster_bugs --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
70
71test-innodb-crash:
72 cd $(KEWPIE) && ./kewpie.py --suite=innodbCrash --basedir=$(BASEDIR)/$(PERCONA_SERVER_SHORT_2)
73
74
75
76
77
078
=== modified file 'Percona-Server/mysql-test/r/information_schema.result'
--- Percona-Server/mysql-test/r/information_schema.result 2012-07-31 05:33:11 +0000
+++ Percona-Server/mysql-test/r/information_schema.result 2012-08-15 14:13:50 +0000
@@ -83,7 +83,30 @@
83USER_PRIVILEGES83USER_PRIVILEGES
84USER_STATISTICS84USER_STATISTICS
85VIEWS85VIEWS
86<<<<<<< TREE
87=======
88INNODB_BUFFER_POOL_PAGES_INDEX
89INNODB_RSEG
90INNODB_CHANGED_PAGES
91INNODB_BUFFER_POOL_PAGES
92INNODB_TABLE_STATS
93INNODB_TRX
94>>>>>>> MERGE-SOURCE
86XTRADB_ADMIN_COMMAND95XTRADB_ADMIN_COMMAND
96<<<<<<< TREE
97=======
98INNODB_LOCK_WAITS
99INNODB_SYS_TABLES
100INNODB_CMP
101INNODB_SYS_STATS
102INNODB_CMP_RESET
103INNODB_CMPMEM
104INNODB_INDEX_STATS
105INNODB_SYS_INDEXES
106INNODB_BUFFER_POOL_PAGES_BLOB
107INNODB_CMPMEM_RESET
108INNODB_LOCKS
109>>>>>>> MERGE-SOURCE
87columns_priv110columns_priv
88db111db
89event112event
@@ -900,6 +923,11 @@
900TABLE_STATISTICS TABLE_NAME select923TABLE_STATISTICS TABLE_NAME select
901TEMPORARY_TABLES TABLE_NAME select924TEMPORARY_TABLES TABLE_NAME select
902VIEWS TABLE_NAME select925VIEWS TABLE_NAME select
926<<<<<<< TREE
927=======
928INNODB_TABLE_STATS table_name select
929INNODB_INDEX_STATS table_name select
930>>>>>>> MERGE-SOURCE
903delete from mysql.user where user='mysqltest_4';931delete from mysql.user where user='mysqltest_4';
904delete from mysql.db where user='mysqltest_4';932delete from mysql.db where user='mysqltest_4';
905flush privileges;933flush privileges;
@@ -1280,6 +1308,147 @@
1280DROP FUNCTION f1;1308DROP FUNCTION f1;
1281DROP PROCEDURE p1;1309DROP PROCEDURE p1;
1282DROP USER mysql_bug20230@localhost;1310DROP USER mysql_bug20230@localhost;
1311<<<<<<< TREE
1312=======
1313SELECT t.table_name, c1.column_name
1314FROM information_schema.tables t
1315INNER JOIN
1316information_schema.columns c1
1317ON t.table_schema = c1.table_schema AND
1318t.table_name = c1.table_name
1319WHERE t.table_schema = 'information_schema' AND
1320c1.ordinal_position =
1321( SELECT COALESCE(MIN(c2.ordinal_position),1)
1322FROM information_schema.columns c2
1323WHERE c2.table_schema = t.table_schema AND
1324c2.table_name = t.table_name AND
1325c2.column_name LIKE '%SCHEMA%'
1326 );
1327table_name column_name
1328CHARACTER_SETS CHARACTER_SET_NAME
1329CLIENT_STATISTICS CLIENT
1330COLLATIONS COLLATION_NAME
1331COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
1332COLUMNS TABLE_SCHEMA
1333COLUMN_PRIVILEGES TABLE_SCHEMA
1334INDEX_STATISTICS TABLE_SCHEMA
1335ENGINES ENGINE
1336EVENTS EVENT_SCHEMA
1337FILES TABLE_SCHEMA
1338GLOBAL_STATUS VARIABLE_NAME
1339GLOBAL_TEMPORARY_TABLES TABLE_SCHEMA
1340GLOBAL_VARIABLES VARIABLE_NAME
1341KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
1342PARTITIONS TABLE_SCHEMA
1343PLUGINS PLUGIN_NAME
1344PROCESSLIST ID
1345PROFILING QUERY_ID
1346REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
1347ROUTINES ROUTINE_SCHEMA
1348QUERY_RESPONSE_TIME time
1349SCHEMATA SCHEMA_NAME
1350SCHEMA_PRIVILEGES TABLE_SCHEMA
1351SESSION_STATUS VARIABLE_NAME
1352SESSION_VARIABLES VARIABLE_NAME
1353STATISTICS TABLE_SCHEMA
1354TABLES TABLE_SCHEMA
1355TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
1356TABLE_PRIVILEGES TABLE_SCHEMA
1357TEMPORARY_TABLES TABLE_SCHEMA
1358TABLE_STATISTICS TABLE_SCHEMA
1359THREAD_STATISTICS THREAD_ID
1360TRIGGERS TRIGGER_SCHEMA
1361USER_PRIVILEGES GRANTEE
1362USER_STATISTICS USER
1363VIEWS TABLE_SCHEMA
1364INNODB_BUFFER_POOL_PAGES_INDEX index_id
1365INNODB_RSEG rseg_id
1366INNODB_CHANGED_PAGES space_id
1367INNODB_BUFFER_POOL_PAGES page_type
1368INNODB_TABLE_STATS table_schema
1369INNODB_TRX trx_id
1370XTRADB_ADMIN_COMMAND result_message
1371INNODB_LOCK_WAITS requesting_trx_id
1372INNODB_SYS_TABLES SCHEMA
1373INNODB_CMP page_size
1374INNODB_SYS_STATS INDEX_ID
1375INNODB_CMP_RESET page_size
1376INNODB_CMPMEM page_size
1377INNODB_INDEX_STATS table_schema
1378INNODB_SYS_INDEXES TABLE_ID
1379INNODB_BUFFER_POOL_PAGES_BLOB space_id
1380INNODB_CMPMEM_RESET page_size
1381INNODB_LOCKS lock_id
1382SELECT t.table_name, c1.column_name
1383FROM information_schema.tables t
1384INNER JOIN
1385information_schema.columns c1
1386ON t.table_schema = c1.table_schema AND
1387t.table_name = c1.table_name
1388WHERE t.table_schema = 'information_schema' AND
1389c1.ordinal_position =
1390( SELECT COALESCE(MIN(c2.ordinal_position),1)
1391FROM information_schema.columns c2
1392WHERE c2.table_schema = 'information_schema' AND
1393c2.table_name = t.table_name AND
1394c2.column_name LIKE '%SCHEMA%'
1395 );
1396table_name column_name
1397CHARACTER_SETS CHARACTER_SET_NAME
1398CLIENT_STATISTICS CLIENT
1399COLLATIONS COLLATION_NAME
1400COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
1401COLUMNS TABLE_SCHEMA
1402COLUMN_PRIVILEGES TABLE_SCHEMA
1403INDEX_STATISTICS TABLE_SCHEMA
1404ENGINES ENGINE
1405EVENTS EVENT_SCHEMA
1406FILES TABLE_SCHEMA
1407GLOBAL_STATUS VARIABLE_NAME
1408GLOBAL_TEMPORARY_TABLES TABLE_SCHEMA
1409GLOBAL_VARIABLES VARIABLE_NAME
1410KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
1411PARTITIONS TABLE_SCHEMA
1412PLUGINS PLUGIN_NAME
1413PROCESSLIST ID
1414PROFILING QUERY_ID
1415REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
1416ROUTINES ROUTINE_SCHEMA
1417QUERY_RESPONSE_TIME time
1418SCHEMATA SCHEMA_NAME
1419SCHEMA_PRIVILEGES TABLE_SCHEMA
1420SESSION_STATUS VARIABLE_NAME
1421SESSION_VARIABLES VARIABLE_NAME
1422STATISTICS TABLE_SCHEMA
1423TABLES TABLE_SCHEMA
1424TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
1425TABLE_PRIVILEGES TABLE_SCHEMA
1426TEMPORARY_TABLES TABLE_SCHEMA
1427TABLE_STATISTICS TABLE_SCHEMA
1428THREAD_STATISTICS THREAD_ID
1429TRIGGERS TRIGGER_SCHEMA
1430USER_PRIVILEGES GRANTEE
1431USER_STATISTICS USER
1432VIEWS TABLE_SCHEMA
1433INNODB_BUFFER_POOL_PAGES_INDEX index_id
1434INNODB_RSEG rseg_id
1435INNODB_CHANGED_PAGES space_id
1436INNODB_BUFFER_POOL_PAGES page_type
1437INNODB_TABLE_STATS table_schema
1438INNODB_TRX trx_id
1439XTRADB_ADMIN_COMMAND result_message
1440INNODB_LOCK_WAITS requesting_trx_id
1441INNODB_SYS_TABLES SCHEMA
1442INNODB_CMP page_size
1443INNODB_SYS_STATS INDEX_ID
1444INNODB_CMP_RESET page_size
1445INNODB_CMPMEM page_size
1446INNODB_INDEX_STATS table_schema
1447INNODB_SYS_INDEXES TABLE_ID
1448INNODB_BUFFER_POOL_PAGES_BLOB space_id
1449INNODB_CMPMEM_RESET page_size
1450INNODB_LOCKS lock_id
1451>>>>>>> MERGE-SOURCE
1283SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');1452SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
1284MAX(table_name)1453MAX(table_name)
1285XTRADB_ADMIN_COMMAND1454XTRADB_ADMIN_COMMAND
@@ -1360,6 +1529,26 @@
1360GLOBAL_TEMPORARY_TABLES information_schema.GLOBAL_TEMPORARY_TABLES 11529GLOBAL_TEMPORARY_TABLES information_schema.GLOBAL_TEMPORARY_TABLES 1
1361GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 11530GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
1362INDEX_STATISTICS information_schema.INDEX_STATISTICS 11531INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
1532<<<<<<< TREE
1533=======
1534INNODB_BUFFER_POOL_PAGES information_schema.INNODB_BUFFER_POOL_PAGES 1
1535INNODB_BUFFER_POOL_PAGES_BLOB information_schema.INNODB_BUFFER_POOL_PAGES_BLOB 1
1536INNODB_BUFFER_POOL_PAGES_INDEX information_schema.INNODB_BUFFER_POOL_PAGES_INDEX 1
1537INNODB_CHANGED_PAGES information_schema.INNODB_CHANGED_PAGES 1
1538INNODB_CMP information_schema.INNODB_CMP 1
1539INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
1540INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
1541INNODB_CMP_RESET information_schema.INNODB_CMP_RESET 1
1542INNODB_INDEX_STATS information_schema.INNODB_INDEX_STATS 1
1543INNODB_LOCKS information_schema.INNODB_LOCKS 1
1544INNODB_LOCK_WAITS information_schema.INNODB_LOCK_WAITS 1
1545INNODB_RSEG information_schema.INNODB_RSEG 1
1546INNODB_SYS_INDEXES information_schema.INNODB_SYS_INDEXES 1
1547INNODB_SYS_STATS information_schema.INNODB_SYS_STATS 1
1548INNODB_SYS_TABLES information_schema.INNODB_SYS_TABLES 1
1549INNODB_TABLE_STATS information_schema.INNODB_TABLE_STATS 1
1550INNODB_TRX information_schema.INNODB_TRX 1
1551>>>>>>> MERGE-SOURCE
1363KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 11552KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
1364PARAMETERS information_schema.PARAMETERS 11553PARAMETERS information_schema.PARAMETERS 1
1365PARTITIONS information_schema.PARTITIONS 11554PARTITIONS information_schema.PARTITIONS 1
13661555
=== modified file 'Percona-Server/mysql-test/r/information_schema_db.result'
--- Percona-Server/mysql-test/r/information_schema_db.result 2012-05-10 07:49:14 +0000
+++ Percona-Server/mysql-test/r/information_schema_db.result 2012-08-15 14:13:50 +0000
@@ -43,7 +43,30 @@
43USER_PRIVILEGES43USER_PRIVILEGES
44USER_STATISTICS44USER_STATISTICS
45VIEWS45VIEWS
46<<<<<<< TREE
47=======
48INNODB_BUFFER_POOL_PAGES_INDEX
49INNODB_RSEG
50INNODB_CHANGED_PAGES
51INNODB_BUFFER_POOL_PAGES
52INNODB_TABLE_STATS
53INNODB_TRX
54>>>>>>> MERGE-SOURCE
46XTRADB_ADMIN_COMMAND55XTRADB_ADMIN_COMMAND
56<<<<<<< TREE
57=======
58INNODB_LOCK_WAITS
59INNODB_SYS_TABLES
60INNODB_CMP
61INNODB_SYS_STATS
62INNODB_CMP_RESET
63INNODB_CMPMEM
64INNODB_INDEX_STATS
65INNODB_SYS_INDEXES
66INNODB_BUFFER_POOL_PAGES_BLOB
67INNODB_CMPMEM_RESET
68INNODB_LOCKS
69>>>>>>> MERGE-SOURCE
47show tables from INFORMATION_SCHEMA like 'T%';70show tables from INFORMATION_SCHEMA like 'T%';
48Tables_in_information_schema (T%)71Tables_in_information_schema (T%)
49TABLES72TABLES
5073
=== modified file 'Percona-Server/mysql-test/r/mysqlshow.result'
--- Percona-Server/mysql-test/r/mysqlshow.result 2012-07-31 05:33:11 +0000
+++ Percona-Server/mysql-test/r/mysqlshow.result 2012-08-15 14:13:50 +0000
@@ -119,6 +119,7 @@
119| VIEWS |119| VIEWS |
120| INNODB_CMPMEM_RESET |120| INNODB_CMPMEM_RESET |
121| INNODB_RSEG |121| INNODB_RSEG |
122<<<<<<< TREE
122| INNODB_UNDO_LOGS |123| INNODB_UNDO_LOGS |
123| INNODB_CMPMEM |124| INNODB_CMPMEM |
124| INNODB_SYS_TABLESTATS |125| INNODB_SYS_TABLESTATS |
@@ -127,7 +128,14 @@
127| INNODB_CMP |128| INNODB_CMP |
128| INNODB_SYS_FOREIGN_COLS |129| INNODB_SYS_FOREIGN_COLS |
129| INNODB_CMP_RESET |130| INNODB_CMP_RESET |
131=======
132| INNODB_CHANGED_PAGES |
133>>>>>>> MERGE-SOURCE
130| INNODB_BUFFER_POOL_PAGES |134| INNODB_BUFFER_POOL_PAGES |
135<<<<<<< TREE
136=======
137| INNODB_TABLE_STATS |
138>>>>>>> MERGE-SOURCE
131| INNODB_TRX |139| INNODB_TRX |
132| INNODB_BUFFER_POOL_PAGES_INDEX |140| INNODB_BUFFER_POOL_PAGES_INDEX |
133| INNODB_LOCKS |141| INNODB_LOCKS |
@@ -139,7 +147,13 @@
139| INNODB_SYS_STATS |147| INNODB_SYS_STATS |
140| INNODB_SYS_FOREIGN |148| INNODB_SYS_FOREIGN |
141| INNODB_SYS_INDEXES |149| INNODB_SYS_INDEXES |
150<<<<<<< TREE
142| XTRADB_ADMIN_COMMAND |151| XTRADB_ADMIN_COMMAND |
152=======
153| INNODB_BUFFER_POOL_PAGES_BLOB |
154| INNODB_CMPMEM_RESET |
155| INNODB_LOCKS |
156>>>>>>> MERGE-SOURCE
143+---------------------------------------+157+---------------------------------------+
144Database: INFORMATION_SCHEMA158Database: INFORMATION_SCHEMA
145+---------------------------------------+159+---------------------------------------+
@@ -185,6 +199,7 @@
185| VIEWS |199| VIEWS |
186| INNODB_CMPMEM_RESET |200| INNODB_CMPMEM_RESET |
187| INNODB_RSEG |201| INNODB_RSEG |
202<<<<<<< TREE
188| INNODB_UNDO_LOGS |203| INNODB_UNDO_LOGS |
189| INNODB_CMPMEM |204| INNODB_CMPMEM |
190| INNODB_SYS_TABLESTATS |205| INNODB_SYS_TABLESTATS |
@@ -193,7 +208,14 @@
193| INNODB_CMP |208| INNODB_CMP |
194| INNODB_SYS_FOREIGN_COLS |209| INNODB_SYS_FOREIGN_COLS |
195| INNODB_CMP_RESET |210| INNODB_CMP_RESET |
211=======
212| INNODB_CHANGED_PAGES |
213>>>>>>> MERGE-SOURCE
196| INNODB_BUFFER_POOL_PAGES |214| INNODB_BUFFER_POOL_PAGES |
215<<<<<<< TREE
216=======
217| INNODB_TABLE_STATS |
218>>>>>>> MERGE-SOURCE
197| INNODB_TRX |219| INNODB_TRX |
198| INNODB_BUFFER_POOL_PAGES_INDEX |220| INNODB_BUFFER_POOL_PAGES_INDEX |
199| INNODB_LOCKS |221| INNODB_LOCKS |
@@ -205,7 +227,13 @@
205| INNODB_SYS_STATS |227| INNODB_SYS_STATS |
206| INNODB_SYS_FOREIGN |228| INNODB_SYS_FOREIGN |
207| INNODB_SYS_INDEXES |229| INNODB_SYS_INDEXES |
230<<<<<<< TREE
208| XTRADB_ADMIN_COMMAND |231| XTRADB_ADMIN_COMMAND |
232=======
233| INNODB_BUFFER_POOL_PAGES_BLOB |
234| INNODB_CMPMEM_RESET |
235| INNODB_LOCKS |
236>>>>>>> MERGE-SOURCE
209+---------------------------------------+237+---------------------------------------+
210Wildcard: inf_rmation_schema238Wildcard: inf_rmation_schema
211+--------------------+239+--------------------+
212240
=== added file 'Percona-Server/mysql-test/r/percona_server_variables_debug.result.OTHER'
--- Percona-Server/mysql-test/r/percona_server_variables_debug.result.OTHER 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/r/percona_server_variables_debug.result.OTHER 2012-08-15 14:13:50 +0000
@@ -0,0 +1,357 @@
1SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
2Variable_name
3AUTOCOMMIT
4AUTOMATIC_SP_PRIVILEGES
5AUTO_INCREMENT_INCREMENT
6AUTO_INCREMENT_OFFSET
7BACK_LOG
8BASEDIR
9BIG_TABLES
10BINLOG_CACHE_SIZE
11BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
12BINLOG_FORMAT
13BULK_INSERT_BUFFER_SIZE
14CHARACTER_SETS_DIR
15CHARACTER_SET_CLIENT
16CHARACTER_SET_CONNECTION
17CHARACTER_SET_DATABASE
18CHARACTER_SET_FILESYSTEM
19CHARACTER_SET_RESULTS
20CHARACTER_SET_SERVER
21CHARACTER_SET_SYSTEM
22COLLATION_CONNECTION
23COLLATION_DATABASE
24COLLATION_SERVER
25COMPLETION_TYPE
26CONCURRENT_INSERT
27CONNECT_TIMEOUT
28DATADIR
29DATETIME_FORMAT
30DATE_FORMAT
31DEBUG
32DEBUG_SYNC
33DEFAULT_WEEK_FORMAT
34DELAYED_INSERT_LIMIT
35DELAYED_INSERT_TIMEOUT
36DELAYED_QUEUE_SIZE
37DELAY_KEY_WRITE
38DIV_PRECISION_INCREMENT
39ENABLE_QUERY_RESPONSE_TIME_STATS
40ENGINE_CONDITION_PUSHDOWN
41ERROR_COUNT
42EVENT_SCHEDULER
43EXPAND_FAST_INDEX_CREATION
44EXPIRE_LOGS_DAYS
45FAST_INDEX_CREATION
46FLUSH
47FLUSH_TIME
48FOREIGN_KEY_CHECKS
49FT_BOOLEAN_SYNTAX
50FT_MAX_WORD_LEN
51FT_MIN_WORD_LEN
52FT_QUERY_EXPANSION_LIMIT
53FT_STOPWORD_FILE
54GENERAL_LOG
55GENERAL_LOG_FILE
56GROUP_CONCAT_MAX_LEN
57HAVE_COMMUNITY_FEATURES
58HAVE_COMPRESS
59HAVE_CRYPT
60HAVE_CSV
61HAVE_DYNAMIC_LOADING
62HAVE_GEOMETRY
63HAVE_INNODB
64HAVE_NDBCLUSTER
65HAVE_OPENSSL
66HAVE_PARTITIONING
67HAVE_QUERY_CACHE
68HAVE_RESPONSE_TIME_DISTRIBUTION
69HAVE_RTREE_KEYS
70HAVE_SSL
71HAVE_SYMLINK
72HOSTNAME
73IDENTITY
74IGNORE_BUILTIN_INNODB
75INIT_CONNECT
76INIT_FILE
77INIT_SLAVE
78INNODB_ADAPTIVE_CHECKPOINT
79INNODB_ADAPTIVE_FLUSHING
80INNODB_ADAPTIVE_HASH_INDEX
81INNODB_ADDITIONAL_MEM_POOL_SIZE
82INNODB_AUTOEXTEND_INCREMENT
83INNODB_AUTOINC_LOCK_MODE
84INNODB_AUTO_LRU_DUMP
85INNODB_BLOCKING_LRU_RESTORE
86INNODB_BUFFER_POOL_SHM_CHECKSUM
87INNODB_BUFFER_POOL_SHM_KEY
88INNODB_BUFFER_POOL_SIZE
89INNODB_CHANGED_PAGES_LIMIT
90INNODB_CHANGE_BUFFERING
91INNODB_CHECKPOINT_AGE_TARGET
92INNODB_CHECKSUMS
93INNODB_COMMIT_CONCURRENCY
94INNODB_CONCURRENCY_TICKETS
95INNODB_DATA_FILE_PATH
96INNODB_DATA_HOME_DIR
97INNODB_DICT_SIZE_LIMIT
98INNODB_DOUBLEWRITE
99INNODB_DOUBLEWRITE_FILE
100INNODB_ENABLE_UNSAFE_GROUP_COMMIT
101INNODB_EXPAND_IMPORT
102INNODB_EXTRA_RSEGMENTS
103INNODB_EXTRA_UNDOSLOTS
104INNODB_FAKE_CHANGES
105INNODB_FAST_CHECKSUM
106INNODB_FAST_RECOVERY
107INNODB_FAST_SHUTDOWN
108INNODB_FILE_FORMAT
109INNODB_FILE_FORMAT_CHECK
110INNODB_FILE_PER_TABLE
111INNODB_FLUSH_LOG_AT_TRX_COMMIT
112INNODB_FLUSH_LOG_AT_TRX_COMMIT_SESSION
113INNODB_FLUSH_METHOD
114INNODB_FLUSH_NEIGHBOR_PAGES
115INNODB_FORCE_RECOVERY
116INNODB_IBUF_ACCEL_RATE
117INNODB_IBUF_ACTIVE_CONTRACT
118INNODB_IBUF_MAX_SIZE
119INNODB_IO_CAPACITY
120INNODB_KILL_IDLE_TRANSACTION
121INNODB_LAZY_DROP_TABLE
122INNODB_LOCKS_UNSAFE_FOR_BINLOG
123INNODB_LOCK_WAIT_TIMEOUT
124INNODB_LOG_BLOCK_SIZE
125INNODB_LOG_BUFFER_SIZE
126INNODB_LOG_FILES_IN_GROUP
127INNODB_LOG_FILE_SIZE
128INNODB_LOG_GROUP_HOME_DIR
129INNODB_MAX_DIRTY_PAGES_PCT
130INNODB_MAX_PURGE_LAG
131INNODB_MIRRORED_LOG_GROUPS
132INNODB_OLD_BLOCKS_PCT
133INNODB_OLD_BLOCKS_TIME
134INNODB_OPEN_FILES
135INNODB_OVERWRITE_RELAY_LOG_INFO
136INNODB_PAGE_SIZE
137INNODB_PASS_CORRUPT_TABLE
138INNODB_RANDOM_READ_AHEAD
139INNODB_READ_AHEAD
140INNODB_READ_AHEAD_THRESHOLD
141INNODB_READ_IO_THREADS
142INNODB_RECOVERY_STATS
143INNODB_REPLICATION_DELAY
144INNODB_ROLLBACK_ON_TIMEOUT
145INNODB_SHOW_LOCKS_HELD
146INNODB_SHOW_VERBOSE_LOCKS
147INNODB_SPIN_WAIT_DELAY
148INNODB_STATS_AUTO_UPDATE
149INNODB_STATS_METHOD
150INNODB_STATS_ON_METADATA
151INNODB_STATS_SAMPLE_PAGES
152INNODB_STATS_UPDATE_NEED_LOCK
153INNODB_STRICT_MODE
154INNODB_SUPPORT_XA
155INNODB_SYNC_SPIN_LOOPS
156INNODB_TABLE_LOCKS
157INNODB_THREAD_CONCURRENCY
158INNODB_THREAD_CONCURRENCY_TIMER_BASED
159INNODB_THREAD_SLEEP_DELAY
160INNODB_TRACK_CHANGED_PAGES
161INNODB_USE_PURGE_THREAD
162INNODB_USE_SYS_MALLOC
163INNODB_USE_SYS_STATS_TABLE
164INNODB_VERSION
165INNODB_WRITE_IO_THREADS
166INSERT_ID
167INTERACTIVE_TIMEOUT
168JOIN_BUFFER_SIZE
169KEEP_FILES_ON_CREATE
170KEY_BUFFER_SIZE
171KEY_CACHE_AGE_THRESHOLD
172KEY_CACHE_BLOCK_SIZE
173KEY_CACHE_DIVISION_LIMIT
174LANGUAGE
175LARGE_FILES_SUPPORT
176LARGE_PAGES
177LARGE_PAGE_SIZE
178LAST_INSERT_ID
179LC_TIME_NAMES
180LICENSE
181LOCAL_INFILE
182LOCKED_IN_MEMORY
183LOG
184LOG_BIN
185LOG_BIN_TRUST_FUNCTION_CREATORS
186LOG_BIN_TRUST_ROUTINE_CREATORS
187LOG_ERROR
188LOG_OUTPUT
189LOG_QUERIES_NOT_USING_INDEXES
190LOG_SLAVE_UPDATES
191LOG_SLOW_ADMIN_STATEMENTS
192LOG_SLOW_FILTER
193LOG_SLOW_QUERIES
194LOG_SLOW_RATE_LIMIT
195LOG_SLOW_SLAVE_STATEMENTS
196LOG_SLOW_SP_STATEMENTS
197LOG_SLOW_TIMESTAMP_EVERY
198LOG_SLOW_VERBOSITY
199LOG_WARNINGS
200LONG_QUERY_TIME
201LOWER_CASE_FILE_SYSTEM
202LOWER_CASE_TABLE_NAMES
203LOW_PRIORITY_UPDATES
204MAX_ALLOWED_PACKET
205MAX_BINLOG_CACHE_SIZE
206MAX_BINLOG_SIZE
207MAX_CONNECTIONS
208MAX_CONNECT_ERRORS
209MAX_DELAYED_THREADS
210MAX_ERROR_COUNT
211MAX_HEAP_TABLE_SIZE
212MAX_INSERT_DELAYED_THREADS
213MAX_JOIN_SIZE
214MAX_LENGTH_FOR_SORT_DATA
215MAX_LONG_DATA_SIZE
216MAX_PREPARED_STMT_COUNT
217MAX_RELAY_LOG_SIZE
218MAX_SEEKS_FOR_KEY
219MAX_SORT_LENGTH
220MAX_SP_RECURSION_DEPTH
221MAX_TMP_TABLES
222MAX_USER_CONNECTIONS
223MAX_WRITE_LOCK_COUNT
224MIN_EXAMINED_ROW_LIMIT
225MULTI_RANGE_COUNT
226MYISAM_DATA_POINTER_SIZE
227MYISAM_MAX_SORT_FILE_SIZE
228MYISAM_MMAP_SIZE
229MYISAM_RECOVER_OPTIONS
230MYISAM_REPAIR_THREADS
231MYISAM_SORT_BUFFER_SIZE
232MYISAM_STATS_METHOD
233MYISAM_USE_MMAP
234NET_BUFFER_LENGTH
235NET_READ_TIMEOUT
236NET_RETRY_COUNT
237NET_WRITE_TIMEOUT
238NEW
239OLD
240OLD_ALTER_TABLE
241OLD_PASSWORDS
242OPEN_FILES_LIMIT
243OPTIMIZER_FIX
244OPTIMIZER_PRUNE_LEVEL
245OPTIMIZER_SEARCH_DEPTH
246OPTIMIZER_SWITCH
247PID_FILE
248PLUGIN_DIR
249PORT
250PRELOAD_BUFFER_SIZE
251PROFILING
252PROFILING_HISTORY_SIZE
253PROFILING_SERVER
254PROFILING_USE_GETRUSAGE
255PROTOCOL_VERSION
256PSEUDO_THREAD_ID
257QUERY_ALLOC_BLOCK_SIZE
258QUERY_CACHE_LIMIT
259QUERY_CACHE_MIN_RES_UNIT
260QUERY_CACHE_SIZE
261QUERY_CACHE_STRIP_COMMENTS
262QUERY_CACHE_TYPE
263QUERY_CACHE_WLOCK_INVALIDATE
264QUERY_EXEC_TIME
265QUERY_PREALLOC_SIZE
266QUERY_RESPONSE_TIME_RANGE_BASE
267RAND_SEED1
268RAND_SEED2
269RANGE_ALLOC_BLOCK_SIZE
270READ_BUFFER_SIZE
271READ_ONLY
272READ_RND_BUFFER_SIZE
273RELAY_LOG
274RELAY_LOG_INDEX
275RELAY_LOG_INFO_FILE
276RELAY_LOG_PURGE
277RELAY_LOG_SPACE_LIMIT
278REPORT_HOST
279REPORT_PASSWORD
280REPORT_PORT
281REPORT_USER
282RPL_RECOVERY_RANK
283SECURE_AUTH
284SECURE_FILE_PRIV
285SERVER_ID
286SKIP_EXTERNAL_LOCKING
287SKIP_NAME_RESOLVE
288SKIP_NETWORKING
289SKIP_SHOW_DATABASE
290SLAVE_COMPRESSED_PROTOCOL
291SLAVE_EXEC_MODE
292SLAVE_LOAD_TMPDIR
293SLAVE_NET_TIMEOUT
294SLAVE_SKIP_ERRORS
295SLAVE_TRANSACTION_RETRIES
296SLOW_LAUNCH_TIME
297SLOW_QUERY_LOG
298SLOW_QUERY_LOG_FILE
299SLOW_QUERY_LOG_LOCK_TIME
300SLOW_QUERY_LOG_MICROSECONDS_TIMESTAMP
301SLOW_QUERY_LOG_QUERY_TIME
302SOCKET
303SORT_BUFFER_SIZE
304SQL_AUTO_IS_NULL
305SQL_BIG_SELECTS
306SQL_BIG_TABLES
307SQL_BUFFER_RESULT
308SQL_LOG_BIN
309SQL_LOG_OFF
310SQL_LOG_UPDATE
311SQL_LOW_PRIORITY_UPDATES
312SQL_MAX_JOIN_SIZE
313SQL_MODE
314SQL_NOTES
315SQL_QUOTE_SHOW_CREATE
316SQL_SAFE_UPDATES
317SQL_SELECT_LIMIT
318SQL_SLAVE_SKIP_COUNTER
319SQL_WARNINGS
320SSL_CA
321SSL_CAPATH
322SSL_CERT
323SSL_CIPHER
324SSL_KEY
325STORAGE_ENGINE
326SUPPRESS_LOG_WARNING_1592
327SYNC_BINLOG
328SYNC_FRM
329SYSTEM_TIME_ZONE
330TABLE_DEFINITION_CACHE
331TABLE_LOCK_WAIT_TIMEOUT
332TABLE_OPEN_CACHE
333TABLE_TYPE
334THREAD_CACHE_SIZE
335THREAD_HANDLING
336THREAD_STACK
337THREAD_STATISTICS
338TIMED_MUTEXES
339TIMESTAMP
340TIME_FORMAT
341TIME_ZONE
342TMPDIR
343TMP_TABLE_SIZE
344TRANSACTION_ALLOC_BLOCK_SIZE
345TRANSACTION_PREALLOC_SIZE
346TX_ISOLATION
347UNIQUE_CHECKS
348UPDATABLE_VIEWS_WITH_LIMIT
349USERSTAT_RUNNING
350USE_GLOBAL_LOG_SLOW_CONTROL
351USE_GLOBAL_LONG_QUERY_TIME
352VERSION
353VERSION_COMMENT
354VERSION_COMPILE_MACHINE
355VERSION_COMPILE_OS
356WAIT_TIMEOUT
357WARNING_COUNT
0358
=== added file 'Percona-Server/mysql-test/r/percona_server_variables_release.result.OTHER'
--- Percona-Server/mysql-test/r/percona_server_variables_release.result.OTHER 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/r/percona_server_variables_release.result.OTHER 2012-08-15 14:13:50 +0000
@@ -0,0 +1,352 @@
1SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
2Variable_name
3AUTOCOMMIT
4AUTOMATIC_SP_PRIVILEGES
5AUTO_INCREMENT_INCREMENT
6AUTO_INCREMENT_OFFSET
7BACK_LOG
8BASEDIR
9BIG_TABLES
10BINLOG_CACHE_SIZE
11BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
12BINLOG_FORMAT
13BULK_INSERT_BUFFER_SIZE
14CHARACTER_SETS_DIR
15CHARACTER_SET_CLIENT
16CHARACTER_SET_CONNECTION
17CHARACTER_SET_DATABASE
18CHARACTER_SET_FILESYSTEM
19CHARACTER_SET_RESULTS
20CHARACTER_SET_SERVER
21CHARACTER_SET_SYSTEM
22COLLATION_CONNECTION
23COLLATION_DATABASE
24COLLATION_SERVER
25COMPLETION_TYPE
26CONCURRENT_INSERT
27CONNECT_TIMEOUT
28DATADIR
29DATETIME_FORMAT
30DATE_FORMAT
31DEFAULT_WEEK_FORMAT
32DELAYED_INSERT_LIMIT
33DELAYED_INSERT_TIMEOUT
34DELAYED_QUEUE_SIZE
35DELAY_KEY_WRITE
36DIV_PRECISION_INCREMENT
37ENABLE_QUERY_RESPONSE_TIME_STATS
38ENGINE_CONDITION_PUSHDOWN
39ERROR_COUNT
40EVENT_SCHEDULER
41EXPAND_FAST_INDEX_CREATION
42EXPIRE_LOGS_DAYS
43FAST_INDEX_CREATION
44FLUSH
45FLUSH_TIME
46FOREIGN_KEY_CHECKS
47FT_BOOLEAN_SYNTAX
48FT_MAX_WORD_LEN
49FT_MIN_WORD_LEN
50FT_QUERY_EXPANSION_LIMIT
51FT_STOPWORD_FILE
52GENERAL_LOG
53GENERAL_LOG_FILE
54GROUP_CONCAT_MAX_LEN
55HAVE_COMMUNITY_FEATURES
56HAVE_COMPRESS
57HAVE_CRYPT
58HAVE_CSV
59HAVE_DYNAMIC_LOADING
60HAVE_GEOMETRY
61HAVE_INNODB
62HAVE_NDBCLUSTER
63HAVE_OPENSSL
64HAVE_PARTITIONING
65HAVE_QUERY_CACHE
66HAVE_RESPONSE_TIME_DISTRIBUTION
67HAVE_RTREE_KEYS
68HAVE_SSL
69HAVE_SYMLINK
70HOSTNAME
71IDENTITY
72IGNORE_BUILTIN_INNODB
73INIT_CONNECT
74INIT_FILE
75INIT_SLAVE
76INNODB_ADAPTIVE_CHECKPOINT
77INNODB_ADAPTIVE_FLUSHING
78INNODB_ADAPTIVE_HASH_INDEX
79INNODB_ADDITIONAL_MEM_POOL_SIZE
80INNODB_AUTOEXTEND_INCREMENT
81INNODB_AUTOINC_LOCK_MODE
82INNODB_AUTO_LRU_DUMP
83INNODB_BLOCKING_LRU_RESTORE
84INNODB_BUFFER_POOL_SHM_CHECKSUM
85INNODB_BUFFER_POOL_SHM_KEY
86INNODB_BUFFER_POOL_SIZE
87INNODB_CHANGED_PAGES_LIMIT
88INNODB_CHANGE_BUFFERING
89INNODB_CHECKPOINT_AGE_TARGET
90INNODB_CHECKSUMS
91INNODB_COMMIT_CONCURRENCY
92INNODB_CONCURRENCY_TICKETS
93INNODB_DATA_FILE_PATH
94INNODB_DATA_HOME_DIR
95INNODB_DICT_SIZE_LIMIT
96INNODB_DOUBLEWRITE
97INNODB_DOUBLEWRITE_FILE
98INNODB_ENABLE_UNSAFE_GROUP_COMMIT
99INNODB_EXPAND_IMPORT
100INNODB_EXTRA_RSEGMENTS
101INNODB_EXTRA_UNDOSLOTS
102INNODB_FAKE_CHANGES
103INNODB_FAST_CHECKSUM
104INNODB_FAST_RECOVERY
105INNODB_FAST_SHUTDOWN
106INNODB_FILE_FORMAT
107INNODB_FILE_FORMAT_CHECK
108INNODB_FILE_PER_TABLE
109INNODB_FLUSH_LOG_AT_TRX_COMMIT
110INNODB_FLUSH_LOG_AT_TRX_COMMIT_SESSION
111INNODB_FLUSH_METHOD
112INNODB_FLUSH_NEIGHBOR_PAGES
113INNODB_FORCE_RECOVERY
114INNODB_IBUF_ACCEL_RATE
115INNODB_IBUF_ACTIVE_CONTRACT
116INNODB_IBUF_MAX_SIZE
117INNODB_IO_CAPACITY
118INNODB_KILL_IDLE_TRANSACTION
119INNODB_LAZY_DROP_TABLE
120INNODB_LOCKS_UNSAFE_FOR_BINLOG
121INNODB_LOCK_WAIT_TIMEOUT
122INNODB_LOG_BLOCK_SIZE
123INNODB_LOG_BUFFER_SIZE
124INNODB_LOG_FILES_IN_GROUP
125INNODB_LOG_FILE_SIZE
126INNODB_LOG_GROUP_HOME_DIR
127INNODB_MAX_DIRTY_PAGES_PCT
128INNODB_MAX_PURGE_LAG
129INNODB_MIRRORED_LOG_GROUPS
130INNODB_OLD_BLOCKS_PCT
131INNODB_OLD_BLOCKS_TIME
132INNODB_OPEN_FILES
133INNODB_OVERWRITE_RELAY_LOG_INFO
134INNODB_PAGE_SIZE
135INNODB_PASS_CORRUPT_TABLE
136INNODB_RANDOM_READ_AHEAD
137INNODB_READ_AHEAD
138INNODB_READ_AHEAD_THRESHOLD
139INNODB_READ_IO_THREADS
140INNODB_RECOVERY_STATS
141INNODB_REPLICATION_DELAY
142INNODB_ROLLBACK_ON_TIMEOUT
143INNODB_SHOW_LOCKS_HELD
144INNODB_SHOW_VERBOSE_LOCKS
145INNODB_SPIN_WAIT_DELAY
146INNODB_STATS_AUTO_UPDATE
147INNODB_STATS_METHOD
148INNODB_STATS_ON_METADATA
149INNODB_STATS_SAMPLE_PAGES
150INNODB_STATS_UPDATE_NEED_LOCK
151INNODB_STRICT_MODE
152INNODB_SUPPORT_XA
153INNODB_SYNC_SPIN_LOOPS
154INNODB_TABLE_LOCKS
155INNODB_THREAD_CONCURRENCY
156INNODB_THREAD_CONCURRENCY_TIMER_BASED
157INNODB_THREAD_SLEEP_DELAY
158INNODB_TRACK_CHANGED_PAGES
159INNODB_USE_PURGE_THREAD
160INNODB_USE_SYS_MALLOC
161INNODB_USE_SYS_STATS_TABLE
162INNODB_VERSION
163INNODB_WRITE_IO_THREADS
164INSERT_ID
165INTERACTIVE_TIMEOUT
166JOIN_BUFFER_SIZE
167KEEP_FILES_ON_CREATE
168KEY_BUFFER_SIZE
169KEY_CACHE_AGE_THRESHOLD
170KEY_CACHE_BLOCK_SIZE
171KEY_CACHE_DIVISION_LIMIT
172LANGUAGE
173LARGE_FILES_SUPPORT
174LARGE_PAGES
175LARGE_PAGE_SIZE
176LAST_INSERT_ID
177LC_TIME_NAMES
178LICENSE
179LOCAL_INFILE
180LOCKED_IN_MEMORY
181LOG
182LOG_BIN
183LOG_BIN_TRUST_FUNCTION_CREATORS
184LOG_BIN_TRUST_ROUTINE_CREATORS
185LOG_ERROR
186LOG_OUTPUT
187LOG_QUERIES_NOT_USING_INDEXES
188LOG_SLAVE_UPDATES
189LOG_SLOW_ADMIN_STATEMENTS
190LOG_SLOW_FILTER
191LOG_SLOW_QUERIES
192LOG_SLOW_RATE_LIMIT
193LOG_SLOW_SLAVE_STATEMENTS
194LOG_SLOW_SP_STATEMENTS
195LOG_SLOW_TIMESTAMP_EVERY
196LOG_SLOW_VERBOSITY
197LOG_WARNINGS
198LONG_QUERY_TIME
199LOWER_CASE_FILE_SYSTEM
200LOWER_CASE_TABLE_NAMES
201LOW_PRIORITY_UPDATES
202MAX_ALLOWED_PACKET
203MAX_BINLOG_CACHE_SIZE
204MAX_BINLOG_SIZE
205MAX_CONNECTIONS
206MAX_CONNECT_ERRORS
207MAX_DELAYED_THREADS
208MAX_ERROR_COUNT
209MAX_HEAP_TABLE_SIZE
210MAX_INSERT_DELAYED_THREADS
211MAX_JOIN_SIZE
212MAX_LENGTH_FOR_SORT_DATA
213MAX_LONG_DATA_SIZE
214MAX_PREPARED_STMT_COUNT
215MAX_RELAY_LOG_SIZE
216MAX_SEEKS_FOR_KEY
217MAX_SORT_LENGTH
218MAX_SP_RECURSION_DEPTH
219MAX_TMP_TABLES
220MAX_USER_CONNECTIONS
221MAX_WRITE_LOCK_COUNT
222MIN_EXAMINED_ROW_LIMIT
223MULTI_RANGE_COUNT
224MYISAM_DATA_POINTER_SIZE
225MYISAM_MAX_SORT_FILE_SIZE
226MYISAM_MMAP_SIZE
227MYISAM_RECOVER_OPTIONS
228MYISAM_REPAIR_THREADS
229MYISAM_SORT_BUFFER_SIZE
230MYISAM_STATS_METHOD
231MYISAM_USE_MMAP
232NET_BUFFER_LENGTH
233NET_READ_TIMEOUT
234NET_RETRY_COUNT
235NET_WRITE_TIMEOUT
236NEW
237OLD
238OLD_ALTER_TABLE
239OLD_PASSWORDS
240OPEN_FILES_LIMIT
241OPTIMIZER_FIX
242OPTIMIZER_PRUNE_LEVEL
243OPTIMIZER_SEARCH_DEPTH
244OPTIMIZER_SWITCH
245PID_FILE
246PLUGIN_DIR
247PORT
248PRELOAD_BUFFER_SIZE
249PROFILING
250PROFILING_HISTORY_SIZE
251PROFILING_SERVER
252PROFILING_USE_GETRUSAGE
253PROTOCOL_VERSION
254PSEUDO_THREAD_ID
255QUERY_ALLOC_BLOCK_SIZE
256QUERY_CACHE_LIMIT
257QUERY_CACHE_MIN_RES_UNIT
258QUERY_CACHE_SIZE
259QUERY_CACHE_STRIP_COMMENTS
260QUERY_CACHE_TYPE
261QUERY_CACHE_WLOCK_INVALIDATE
262QUERY_PREALLOC_SIZE
263QUERY_RESPONSE_TIME_RANGE_BASE
264RAND_SEED1
265RAND_SEED2
266RANGE_ALLOC_BLOCK_SIZE
267READ_BUFFER_SIZE
268READ_ONLY
269READ_RND_BUFFER_SIZE
270RELAY_LOG
271RELAY_LOG_INDEX
272RELAY_LOG_INFO_FILE
273RELAY_LOG_PURGE
274RELAY_LOG_SPACE_LIMIT
275REPORT_HOST
276REPORT_PASSWORD
277REPORT_PORT
278REPORT_USER
279RPL_RECOVERY_RANK
280SECURE_AUTH
281SECURE_FILE_PRIV
282SERVER_ID
283SKIP_EXTERNAL_LOCKING
284SKIP_NAME_RESOLVE
285SKIP_NETWORKING
286SKIP_SHOW_DATABASE
287SLAVE_COMPRESSED_PROTOCOL
288SLAVE_EXEC_MODE
289SLAVE_LOAD_TMPDIR
290SLAVE_NET_TIMEOUT
291SLAVE_SKIP_ERRORS
292SLAVE_TRANSACTION_RETRIES
293SLOW_LAUNCH_TIME
294SLOW_QUERY_LOG
295SLOW_QUERY_LOG_FILE
296SLOW_QUERY_LOG_MICROSECONDS_TIMESTAMP
297SOCKET
298SORT_BUFFER_SIZE
299SQL_AUTO_IS_NULL
300SQL_BIG_SELECTS
301SQL_BIG_TABLES
302SQL_BUFFER_RESULT
303SQL_LOG_BIN
304SQL_LOG_OFF
305SQL_LOG_UPDATE
306SQL_LOW_PRIORITY_UPDATES
307SQL_MAX_JOIN_SIZE
308SQL_MODE
309SQL_NOTES
310SQL_QUOTE_SHOW_CREATE
311SQL_SAFE_UPDATES
312SQL_SELECT_LIMIT
313SQL_SLAVE_SKIP_COUNTER
314SQL_WARNINGS
315SSL_CA
316SSL_CAPATH
317SSL_CERT
318SSL_CIPHER
319SSL_KEY
320STORAGE_ENGINE
321SUPPRESS_LOG_WARNING_1592
322SYNC_BINLOG
323SYNC_FRM
324SYSTEM_TIME_ZONE
325TABLE_DEFINITION_CACHE
326TABLE_LOCK_WAIT_TIMEOUT
327TABLE_OPEN_CACHE
328TABLE_TYPE
329THREAD_CACHE_SIZE
330THREAD_HANDLING
331THREAD_STACK
332THREAD_STATISTICS
333TIMED_MUTEXES
334TIMESTAMP
335TIME_FORMAT
336TIME_ZONE
337TMPDIR
338TMP_TABLE_SIZE
339TRANSACTION_ALLOC_BLOCK_SIZE
340TRANSACTION_PREALLOC_SIZE
341TX_ISOLATION
342UNIQUE_CHECKS
343UPDATABLE_VIEWS_WITH_LIMIT
344USERSTAT_RUNNING
345USE_GLOBAL_LOG_SLOW_CONTROL
346USE_GLOBAL_LONG_QUERY_TIME
347VERSION
348VERSION_COMMENT
349VERSION_COMPILE_MACHINE
350VERSION_COMPILE_OS
351WAIT_TIMEOUT
352WARNING_COUNT
0353
=== added directory 'Percona-Server/mysql-test/suite/innodb_plugin'
=== added directory 'Percona-Server/mysql-test/suite/innodb_plugin/r'
=== 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'
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp.result 2012-08-15 14:13:50 +0000
@@ -0,0 +1,21 @@
1DROP TABLE IF EXISTS t1, t2;
2CREATE TABLE t1 (x INT) ENGINE=InnoDB;
3INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
4INSERT INTO t1 SELECT x FROM t1;
5INSERT INTO t1 SELECT x FROM t1;
6INSERT INTO t1 SELECT x FROM t1;
7INSERT INTO t1 SELECT x FROM t1;
8INSERT INTO t1 SELECT x FROM t1;
9INSERT INTO t1 SELECT x FROM t1;
10INSERT INTO t1 SELECT x FROM t1;
11INSERT INTO t1 SELECT x FROM t1;
12INSERT INTO t1 SELECT x FROM t1;
13INSERT INTO t1 SELECT x FROM t1;
14INSERT INTO t1 SELECT x FROM t1;
15INSERT INTO t1 SELECT x FROM t1;
16CREATE TABLE t2 (x INT) ENGINE=InnoDB;
17INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
18INSERT INTO t1 SELECT x FROM t1;
19SET GLOBAL INNODB_FAST_SHUTDOWN=2;
20call mtr.add_suppression("InnoDB: Warning: truncated block detected.*");
21DROP TABLE t1, t2;
022
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_no_restart.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_no_restart.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_no_restart.result 2012-08-15 14:13:50 +0000
@@ -0,0 +1,6 @@
1DROP TABLE IF EXISTS t1, t2;
2CREATE TABLE t1 (x INT) ENGINE=InnoDB;
3INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
4CREATE TABLE t2 (x INT) ENGINE=InnoDB;
5INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
6DROP TABLE t1, t2;
07
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages.result 2012-08-15 14:13:50 +0000
@@ -0,0 +1,41 @@
1SELECT @@innodb_track_changed_pages;
2@@innodb_track_changed_pages
31
4SET @OLD_INNODB_CHANGED_PAGES_LIMIT = @@GLOBAL.INNODB_CHANGED_PAGES_LIMIT;
5SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
6CREATE TABLE T1 (F1 CHAR(255)) ENGINE=INNODB;
7SET @t1_space_id =
8(SELECT SPACE
9FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
10WHERE
11INFORMATION_SCHEMA.INNODB_SYS_TABLES.SCHEMA='test' AND
12INFORMATION_SCHEMA.INNODB_SYS_TABLES.NAME='T1');
13SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
14SELECT COUNT(DISTINCT PAGE_ID) >= (1024000/16384)
15FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
16WHERE SPACE_ID = @t1_space_id;
17COUNT(DISTINCT PAGE_ID) >= (1024000/16384)
181
19SELECT MAX(PAGE_ID) < (3*1024000/16384)
20FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
21WHERE SPACE_ID = @t1_space_id;
22MAX(PAGE_ID) < (3*1024000/16384)
231
24SELECT COUNT(*)
25FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
26WHERE START_LSN >= END_LSN;
27COUNT(*)
280
29SELECT COUNT(*) = @cond_test_pages_count
30FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
31WHERE
32END_LSN > (@cond_test_lsn - 1) AND
33END_LSN < (@cond_test_lsn + 1);
34COUNT(*) = @cond_test_pages_count
351
36SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 1;
37SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
38COUNT(*)
391
40SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = @OLD_INNODB_CHANGED_PAGES_LIMIT;
41DROP TABLE T1;
042
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages_empty.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages_empty.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_pages_empty.result 2012-08-15 14:13:50 +0000
@@ -0,0 +1,2 @@
1SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
2space_id page_id start_lsn end_lsn
03
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result 2012-08-15 14:13:50 +0000
@@ -0,0 +1,94 @@
1SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'INNODB%' ORDER BY TABLE_NAME;
2TABLE_NAME
3INNODB_BUFFER_POOL_PAGES
4INNODB_BUFFER_POOL_PAGES_BLOB
5INNODB_BUFFER_POOL_PAGES_INDEX
6INNODB_CHANGED_PAGES
7INNODB_CMP
8INNODB_CMPMEM
9INNODB_CMPMEM_RESET
10INNODB_CMP_RESET
11INNODB_INDEX_STATS
12INNODB_LOCKS
13INNODB_LOCK_WAITS
14INNODB_RSEG
15INNODB_SYS_INDEXES
16INNODB_SYS_STATS
17INNODB_SYS_TABLES
18INNODB_TABLE_STATS
19INNODB_TRX
20SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'XTRADB%' ORDER BY TABLE_NAME;
21TABLE_NAME
22XTRADB_ADMIN_COMMAND
23SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
24index_id space_id page_no n_recs data_size hashed access_time modified dirty old lru_position fix_count flush_type
25Warnings:
26Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX but the InnoDB storage engine is not installed
27SELECT * FROM INFORMATION_SCHEMA.INNODB_RSEG;
28rseg_id space_id zip_size page_no max_size curr_size
29Warnings:
30Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_RSEG but the InnoDB storage engine is not installed
31SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP;
32page_size compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
33Warnings:
34Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMP but the InnoDB storage engine is not installed
35SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
36trx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query
37Warnings:
38Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_TRX but the InnoDB storage engine is not installed
39SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
40requesting_trx_id requested_lock_id blocking_trx_id blocking_lock_id
41Warnings:
42Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_LOCK_WAITS but the InnoDB storage engine is not installed
43SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
44lock_id lock_trx_id lock_mode lock_type lock_table lock_index lock_space lock_page lock_rec lock_data
45Warnings:
46Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_LOCKS but the InnoDB storage engine is not installed
47SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_RESET;
48page_size compress_ops compress_ops_ok compress_time uncompress_ops uncompress_time
49Warnings:
50Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMP_RESET but the InnoDB storage engine is not installed
51SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES;
52page_type space_id page_no lru_position fix_count flush_type
53Warnings:
54Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES but the InnoDB storage engine is not installed
55SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
56SCHEMA NAME ID N_COLS TYPE MIX_ID MIX_LEN CLUSTER_NAME SPACE
57Warnings:
58Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_SYS_TABLES but the InnoDB storage engine is not installed
59SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
60index_id space_id page_no n_recs data_size hashed access_time modified dirty old lru_position fix_count flush_type
61Warnings:
62Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX but the InnoDB storage engine is not installed
63SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM;
64page_size pages_used pages_free relocation_ops relocation_time
65Warnings:
66Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMPMEM but the InnoDB storage engine is not installed
67SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB;
68space_id page_no compressed part_len next_page_no lru_position fix_count flush_type
69Warnings:
70Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB but the InnoDB storage engine is not installed
71SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM_RESET;
72page_size pages_used pages_free relocation_ops relocation_time
73Warnings:
74Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_CMPMEM_RESET but the InnoDB storage engine is not installed
75SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLE_STATS;
76table_schema table_name rows clust_size other_size modified
77Warnings:
78Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_TABLE_STATS but the InnoDB storage engine is not installed
79SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_STATS;
80INDEX_ID KEY_COLS DIFF_VALS NON_NULL_VALS
81Warnings:
82Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_SYS_STATS but the InnoDB storage engine is not installed
83SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEX_STATS;
84table_schema table_name index_name fields row_per_keys index_size leaf_pages
85Warnings:
86Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_INDEX_STATS but the InnoDB storage engine is not installed
87SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
88TABLE_ID ID NAME N_FIELDS TYPE SPACE PAGE_NO
89Warnings:
90Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_SYS_INDEXES but the InnoDB storage engine is not installed
91SELECT * FROM INFORMATION_SCHEMA.XTRADB_ADMIN_COMMAND;
92result_message
93Warnings:
94Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.XTRADB_ADMIN_COMMAND but the InnoDB storage engine is not installed
095
=== added directory 'Percona-Server/mysql-test/suite/innodb_plugin/t'
=== 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'
--- Percona-Server/mysql-test/suite/innodb/t/percona_bug_951588.test 2012-06-07 11:22:38 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test 2012-08-15 14:13:50 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1# Test for bug 951588 (Querying I_S.TEMPORARY_TABLES crashes parallel threads working on temp tables)2# Test for bug 951588 (Querying I_S.TEMPORARY_TABLES crashes parallel threads working on temp tables)
23
3--source include/have_innodb.inc4--source include/have_innodb.inc
@@ -27,3 +28,34 @@
27DROP TABLE t1;28DROP TABLE t1;
2829
29SET DEBUG_SYNC='reset';30SET DEBUG_SYNC='reset';
31=======
32# Test for bug 951588 (Querying I_S.TEMPORARY_TABLES crashes parallel threads working on temp tables)
33
34--source include/have_innodb_plugin.inc
35--source include/have_debug_sync.inc
36
37--disable_warnings
38DROP TABLE IF EXISTS t1;
39--enable_warnings
40
41CREATE TEMPORARY TABLE t1 (a INT) ENGINE=InnoDB;
42INSERT INTO t1 VALUES (1), (2), (3);
43
44SET DEBUG_SYNC= 'start_ha_write_row SIGNAL write_in_progress WAIT_FOR i_s_completed';
45send ALTER TABLE t1 ADD COLUMN b VARCHAR(10);
46
47connect (conn2,localhost,root,,);
48connection conn2;
49
50SET DEBUG_SYNC= 'now WAIT_FOR write_in_progress';
51SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_TEMPORARY_TABLES;
52SET DEBUG_SYNC= 'now SIGNAL i_s_completed';
53
54disconnect conn2;
55connection default;
56reap;
57
58DROP TABLE t1;
59
60SET DEBUG_SYNC='reset';
61>>>>>>> MERGE-SOURCE
3062
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp-master.opt'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp-master.opt 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp-master.opt 2012-08-15 14:13:50 +0000
@@ -0,0 +1,1 @@
1--innodb_track_changed_pages=TRUE --innodb_log_file_size=1M --innodb_file_per_table --skip-stack-trace --skip-core-file
02
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp.test'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp.test 2012-08-15 14:13:50 +0000
@@ -0,0 +1,100 @@
1# Tests for the changed page tracking bitmap.
2--source include/not_embedded.inc
3--source include/not_crashrep.inc
4--source include/have_debug.inc
5--source include/have_innodb_plugin.inc
6# Valgrind reports useless errors on very fast server shutdowns
7--source include/not_valgrind.inc
8
9let $MYSQLD_DATADIR= `select @@datadir`;
10let $BITMAP_FILE= $MYSQLD_DATADIR/ib_modified_log.1;
11
12--disable_warnings
13DROP TABLE IF EXISTS t1, t2;
14--enable_warnings
15
16# Create some log data, less than log capacity
17CREATE TABLE t1 (x INT) ENGINE=InnoDB;
18INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
19
20# Check that the bitmap file has been created
21file_exists $BITMAP_FILE;
22
23# Test that an empty existing bitmap file is handled properly when it's
24# possible to re-read the entire missing range.
25
26--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
27--shutdown_server 10
28--source include/wait_until_disconnected.inc
29remove_file $BITMAP_FILE;
30write_file $BITMAP_FILE;
31EOF
32--enable_reconnect
33--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
34--source include/wait_until_connected_again.inc
35
36# Create more log data, larger amount than the log group capacity. At the same time test second space id.
37INSERT INTO t1 SELECT x FROM t1;
38INSERT INTO t1 SELECT x FROM t1;
39INSERT INTO t1 SELECT x FROM t1;
40INSERT INTO t1 SELECT x FROM t1;
41INSERT INTO t1 SELECT x FROM t1;
42INSERT INTO t1 SELECT x FROM t1;
43INSERT INTO t1 SELECT x FROM t1;
44INSERT INTO t1 SELECT x FROM t1;
45INSERT INTO t1 SELECT x FROM t1;
46INSERT INTO t1 SELECT x FROM t1;
47INSERT INTO t1 SELECT x FROM t1;
48INSERT INTO t1 SELECT x FROM t1;
49CREATE TABLE t2 (x INT) ENGINE=InnoDB;
50INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
51
52file_exists $BITMAP_FILE;
53
54# Restart the server to check that the bitmap file is properly read on the startup
55# to resume tracking.
56
57# TODO: check the tracked LSN range continuity once this info is exposed through
58# INFORMATION_SCHEMA.
59--source include/restart_mysqld.inc
60
61file_exists $BITMAP_FILE;
62
63INSERT INTO t1 SELECT x FROM t1;
64
65# Restart the server again with the very fast shutdown
66SET GLOBAL INNODB_FAST_SHUTDOWN=2;
67
68--source include/restart_mysqld.inc
69
70file_exists $BITMAP_FILE;
71
72# Test that an empty existing bitmap file is handled properly when it's impossible to re-read the full missing range.
73
74--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
75--shutdown_server 10
76--source include/wait_until_disconnected.inc
77remove_file $BITMAP_FILE;
78write_file $BITMAP_FILE;
79EOF
80--enable_reconnect
81--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
82--source include/wait_until_connected_again.inc
83
84file_exists $BITMAP_FILE;
85
86# Test that the bitmap file is read in block size multiples with junk at the end discarded
87--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
88--shutdown_server 10
89--source include/wait_until_disconnected.inc
90append_file $BITMAP_FILE;
91junk junk junk junk
92EOF
93--enable_reconnect
94--exec echo "restart:-#d,crash_before_bitmap_write" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
95--source include/wait_until_connected_again.inc
96call mtr.add_suppression("InnoDB: Warning: truncated block detected.*");
97
98file_exists $BITMAP_FILE;
99
100DROP TABLE t1, t2;
0101
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart-master.opt'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart-master.opt 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart-master.opt 2012-08-15 14:13:50 +0000
@@ -0,0 +1,1 @@
1--innodb_track_changed_pages=TRUE --innodb-file-per-table
02
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart.test'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_no_restart.test 2012-08-15 14:13:50 +0000
@@ -0,0 +1,21 @@
1# Tests for the changed page tracking bitmap. A valgrindable subset of
2# percona_changed_page_bmp test, which contains the full functional tests.
3--source include/have_innodb_plugin.inc
4
5let $MYSQLD_DATADIR= `select @@datadir`;
6let $BITMAP_FILE= $MYSQLD_DATADIR/ib_modified_log.1;
7
8--disable_warnings
9DROP TABLE IF EXISTS t1, t2;
10--enable_warnings
11
12# Create some log data with several space ids to have more than bitmap poge.
13CREATE TABLE t1 (x INT) ENGINE=InnoDB;
14INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
15CREATE TABLE t2 (x INT) ENGINE=InnoDB;
16INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
17
18# Check that the bitmap file has been created
19file_exists $BITMAP_FILE;
20
21DROP TABLE t1, t2;
022
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages-master.opt'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages-master.opt 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages-master.opt 2012-08-15 14:13:50 +0000
@@ -0,0 +1,1 @@
1--innodb_track_changed_pages=TRUE --innodb_log_file_size=1M --innodb-file-per-table
02
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages.test'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages.test 2012-08-15 14:13:50 +0000
@@ -0,0 +1,103 @@
1###########################################
2# Test for I_S.INNODB_CHANGED_PAGES table #
3###########################################
4
5--source include/have_innodb_plugin.inc
6
7SELECT @@innodb_track_changed_pages;
8
9SET @OLD_INNODB_CHANGED_PAGES_LIMIT = @@GLOBAL.INNODB_CHANGED_PAGES_LIMIT;
10
11SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
12
13CREATE TABLE T1 (F1 CHAR(255)) ENGINE=INNODB;
14SET @t1_space_id =
15 (SELECT SPACE
16 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
17 WHERE
18 INFORMATION_SCHEMA.INNODB_SYS_TABLES.SCHEMA='test' AND
19 INFORMATION_SCHEMA.INNODB_SYS_TABLES.NAME='T1');
20
21--disable_query_log
22--disable_result_log
23
24#########################################################################
25# The maximum log size is 1MB. Each row occupies at least 256 bytes. #
26# Each iteration inserts 100 rows. They occupies at least 25KB. To be #
27# sure that tracking log thread wrote at least 1M/16K pages we need to #
28# exceed maximum log size twice. That means we should do at least #
29# 2M/25K = 80 iterations. #
30#########################################################################
31--let $i=80
32
33while ($i)
34{
35--dec $i
36INSERT INTO T1 (F1) VALUES
37("1"), ("2"), ("3"), ("4"), ("5"), ("6"), ("7"), ("8"), ("9"), ("10"),
38("11"), ("12"), ("13"), ("14"), ("15"), ("16"), ("17"), ("18"), ("19"), ("20"),
39("21"), ("22"), ("23"), ("24"), ("25"), ("26"), ("27"), ("28"), ("29"), ("30"),
40("31"), ("32"), ("33"), ("34"), ("35"), ("36"), ("37"), ("38"), ("39"), ("40"),
41("41"), ("42"), ("43"), ("44"), ("45"), ("46"), ("47"), ("48"), ("49"), ("50"),
42("51"), ("52"), ("53"), ("54"), ("55"), ("56"), ("57"), ("58"), ("59"), ("60"),
43("61"), ("62"), ("63"), ("64"), ("65"), ("66"), ("67"), ("68"), ("69"), ("70"),
44("71"), ("72"), ("73"), ("74"), ("75"), ("76"), ("77"), ("78"), ("79"), ("80"),
45("81"), ("82"), ("83"), ("84"), ("85"), ("86"), ("87"), ("88"), ("89"), ("90"),
46("91"), ("92"), ("93"), ("94"), ("95"), ("96"), ("97"), ("98"), ("99"), ("100");
47}
48
49###################################################################
50# Gather data for condition pushdown testing not using conditions #
51###################################################################
52SET @cond_test_lsn=
53 (SELECT MIN(end_lsn)
54 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES);
55
56SET @cond_test_pages_count=
57 (SELECT count(*)
58 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
59 GROUP BY end_lsn
60 ORDER BY end_lsn
61 LIMIT 1);
62
63--enable_query_log
64--enable_result_log
65
66###############################################################
67# Check if the number of changed pages is greater than 1M/16K #
68###############################################################
69SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 0;
70SELECT COUNT(DISTINCT PAGE_ID) >= (1024000/16384)
71 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
72 WHERE SPACE_ID = @t1_space_id;
73#############################################################
74# Check if the maximum page id is less than resonable limit #
75#############################################################
76SELECT MAX(PAGE_ID) < (3*1024000/16384)
77 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
78 WHERE SPACE_ID = @t1_space_id;
79########################################################
80# The records where START_LSN >= END_LSN should absent #
81########################################################
82SELECT COUNT(*)
83 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
84 WHERE START_LSN >= END_LSN;
85
86######################################################
87# Check condition if pushdown doesn't break anything #
88######################################################
89SELECT COUNT(*) = @cond_test_pages_count
90 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
91 WHERE
92 END_LSN > (@cond_test_lsn - 1) AND
93 END_LSN < (@cond_test_lsn + 1);
94
95################################################
96# Check how limit for maximum rows count works #
97################################################
98SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = 1;
99SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
100
101SET GLOBAL INNODB_CHANGED_PAGES_LIMIT = @OLD_INNODB_CHANGED_PAGES_LIMIT;
102
103DROP TABLE T1;
0104
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty-master.opt'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty-master.opt 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty-master.opt 2012-08-15 14:13:50 +0000
@@ -0,0 +1,1 @@
1--innodb_track_changed_pages=false
02
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty.test'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_pages_empty.test 2012-08-15 14:13:50 +0000
@@ -0,0 +1,8 @@
1###############################################################################
2# Test for empty I_S.INNODB_CHANGED_PAGES table. The table should be empty if#
3# innodb_track_changed_pages is false. #
4###############################################################################
5
6--source include/have_innodb_plugin.inc
7
8SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
09
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s-master.opt'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s-master.opt 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s-master.opt 2012-08-15 14:13:50 +0000
@@ -0,0 +1,1 @@
1--skip-innodb
02
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s.test'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/percona_skip_innodb_i_s.test 2012-08-15 14:13:50 +0000
@@ -0,0 +1,21 @@
1# 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
2SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'INNODB%' ORDER BY TABLE_NAME;
3SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'XTRADB%' ORDER BY TABLE_NAME;
4SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
5SELECT * FROM INFORMATION_SCHEMA.INNODB_RSEG;
6SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP;
7SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
8SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
9SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
10SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_RESET;
11SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES;
12SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
13SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
14SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM;
15SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB;
16SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM_RESET;
17SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLE_STATS;
18SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_STATS;
19SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEX_STATS;
20SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
21SELECT * FROM INFORMATION_SCHEMA.XTRADB_ADMIN_COMMAND;
022
=== modified file 'Percona-Server/sql/handler.cc'
--- Percona-Server/sql/handler.cc 2012-08-13 13:42:13 +0000
+++ Percona-Server/sql/handler.cc 2012-08-15 14:13:50 +0000
@@ -38,8 +38,12 @@
38#include <myisampack.h>38#include <myisampack.h>
39#include "transaction.h"39#include "transaction.h"
40#include <errno.h>40#include <errno.h>
41<<<<<<< TREE
41#include "probes_mysql.h"42#include "probes_mysql.h"
42#include "debug_sync.h" // DEBUG_SYNC43#include "debug_sync.h" // DEBUG_SYNC
44=======
45#include "debug_sync.h" // DEBUG_SYNC
46>>>>>>> MERGE-SOURCE
4347
44#ifdef WITH_PARTITION_STORAGE_ENGINE48#ifdef WITH_PARTITION_STORAGE_ENGINE
45#include "ha_partition.h"49#include "ha_partition.h"
4650
=== modified file 'Percona-Server/sql/signal_handler.cc'
=== modified file 'Percona-Server/sql/sql_show.cc'
=== modified file 'Percona-Server/storage/innobase/dict/dict0dict.c'
=== modified file 'Percona-Server/storage/innobase/fil/fil0fil.c'
--- Percona-Server/storage/innobase/fil/fil0fil.c 2012-08-07 06:10:00 +0000
+++ Percona-Server/storage/innobase/fil/fil0fil.c 2012-08-15 14:13:50 +0000
@@ -3558,9 +3558,15 @@
3558 }3558 }
3559 }3559 }
35603560
3561<<<<<<< TREE
3561 if (fil_page_get_type(page) ==3562 if (fil_page_get_type(page) ==
3562 FIL_PAGE_INDEX && !is_descr_page) {3563 FIL_PAGE_INDEX && !is_descr_page) {
3563 index_id_t tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));3564 index_id_t tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
3565=======
3566 if (fil_page_get_type(page) ==
3567 FIL_PAGE_INDEX && !is_descr_page) {
3568 dulint tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
3569>>>>>>> MERGE-SOURCE
35643570
3565 for (i = 0; i < n_index; i++) {3571 for (i = 0; i < n_index; i++) {
3566 if (old_id[i] == tmp) {3572 if (old_id[i] == tmp) {
35673573
=== modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc'
--- Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-08-07 06:10:00 +0000
+++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-08-15 14:13:50 +0000
@@ -12658,6 +12658,18 @@
12658 "NULLS_UNEQUAL and NULLS_IGNORED",12658 "NULLS_UNEQUAL and NULLS_IGNORED",
12659 NULL, NULL, SRV_STATS_NULLS_EQUAL, &innodb_stats_method_typelib);12659 NULL, NULL, SRV_STATS_NULLS_EQUAL, &innodb_stats_method_typelib);
1266012660
12661static MYSQL_SYSVAR_BOOL(track_changed_pages, srv_track_changed_pages,
12662 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
12663 "Track the redo log for changed pages and output a changed page bitmap",
12664 NULL, NULL, FALSE);
12665
12666static MYSQL_SYSVAR_ULONGLONG(changed_pages_limit, srv_changed_pages_limit,
12667 PLUGIN_VAR_RQCMDARG,
12668 "The maximum number of rows for "
12669 "INFORMATION_SCHEMA.INNODB_CHANGED_PAGES table, "
12670 "0 - unlimited",
12671 NULL, NULL, 1000000, 0, ~0ULL, 0);
12672
12661#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG12673#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
12662static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,12674static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
12663 PLUGIN_VAR_RQCMDARG,12675 PLUGIN_VAR_RQCMDARG,
@@ -12942,6 +12954,8 @@
12942 MYSQL_SYSVAR(use_sys_malloc),12954 MYSQL_SYSVAR(use_sys_malloc),
12943 MYSQL_SYSVAR(use_native_aio),12955 MYSQL_SYSVAR(use_native_aio),
12944 MYSQL_SYSVAR(change_buffering),12956 MYSQL_SYSVAR(change_buffering),
12957 MYSQL_SYSVAR(track_changed_pages),
12958 MYSQL_SYSVAR(changed_pages_limit),
12945#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG12959#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
12946 MYSQL_SYSVAR(change_buffering_debug),12960 MYSQL_SYSVAR(change_buffering_debug),
12947#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */12961#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
@@ -12996,12 +13010,16 @@
12996i_s_innodb_sys_foreign,13010i_s_innodb_sys_foreign,
12997i_s_innodb_sys_foreign_cols,13011i_s_innodb_sys_foreign_cols,
12998i_s_innodb_sys_stats,13012i_s_innodb_sys_stats,
13013<<<<<<< TREE
12999i_s_innodb_table_stats,13014i_s_innodb_table_stats,
13000i_s_innodb_index_stats,13015i_s_innodb_index_stats,
13001i_s_innodb_buffer_pool_pages,13016i_s_innodb_buffer_pool_pages,
13002i_s_innodb_buffer_pool_pages_index,13017i_s_innodb_buffer_pool_pages_index,
13003i_s_innodb_buffer_pool_pages_blob,13018i_s_innodb_buffer_pool_pages_blob,
13004i_s_innodb_admin_command13019i_s_innodb_admin_command
13020=======
13021i_s_innodb_changed_pages
13022>>>>>>> MERGE-SOURCE
13005mysql_declare_plugin_end;13023mysql_declare_plugin_end;
1300613024
13007/** @brief Initialize the default value of innodb_commit_concurrency.13025/** @brief Initialize the default value of innodb_commit_concurrency.
1300813026
=== modified file 'Percona-Server/storage/innobase/handler/i_s.cc'
--- Percona-Server/storage/innobase/handler/i_s.cc 2012-06-19 16:19:46 +0000
+++ Percona-Server/storage/innobase/handler/i_s.cc 2012-08-15 14:13:50 +0000
@@ -22,6 +22,14 @@
2222
23Created July 18, 2007 Vasil Dimov23Created July 18, 2007 Vasil Dimov
24*******************************************************/24*******************************************************/
25#ifndef MYSQL_SERVER
26#define MYSQL_SERVER /* For Item_* classes */
27#include <mysql_priv.h>
28/* Prevent influence of this definition to other headers */
29#undef MYSQL_SERVER
30#else
31#include <mysql_priv.h>
32#endif //MYSQL_SERVER
2533
26#include <mysqld_error.h>34#include <mysqld_error.h>
27#include <sql_acl.h> // PROCESS_ACL35#include <sql_acl.h> // PROCESS_ACL
@@ -32,8 +40,12 @@
32#include <mysys_err.h>40#include <mysys_err.h>
33#include <my_sys.h>41#include <my_sys.h>
34#include "i_s.h"42#include "i_s.h"
43<<<<<<< TREE
35#include <sql_plugin.h>44#include <sql_plugin.h>
36#include <mysql/innodb_priv.h>45#include <mysql/innodb_priv.h>
46=======
47#include <mysql/plugin.h>
48>>>>>>> MERGE-SOURCE
3749
38extern "C" {50extern "C" {
39#include "btr0pcur.h" /* for file sys_tables related info. */51#include "btr0pcur.h" /* for file sys_tables related info. */
@@ -52,7 +64,11 @@
52#include "trx0sys.h" /* for trx_sys */64#include "trx0sys.h" /* for trx_sys */
53#include "dict0dict.h" /* for dict_sys */65#include "dict0dict.h" /* for dict_sys */
54#include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */66#include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
67<<<<<<< TREE
55#include "btr0btr.h" /* for btr_page_get_index_id */68#include "btr0btr.h" /* for btr_page_get_index_id */
69=======
70#include "log0online.h"
71>>>>>>> MERGE-SOURCE
56}72}
5773
58#define OK(expr) \74#define OK(expr) \
@@ -221,6 +237,713 @@
221 return(ret);237 return(ret);
222}238}
223239
240<<<<<<< TREE
241=======
242static struct st_mysql_information_schema i_s_info =
243{
244 MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
245};
246
247static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_fields_info[] =
248{
249 {STRUCT_FLD(field_name, "page_type"),
250 STRUCT_FLD(field_length, 64),
251 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
252 STRUCT_FLD(value, 0),
253 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
254 STRUCT_FLD(old_name, ""),
255 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
256
257 {STRUCT_FLD(field_name, "space_id"),
258 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
259 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
260 STRUCT_FLD(value, 0),
261 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
262 STRUCT_FLD(old_name, ""),
263 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
264
265 {STRUCT_FLD(field_name, "page_no"),
266 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
267 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
268 STRUCT_FLD(value, 0),
269 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
270 STRUCT_FLD(old_name, ""),
271 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
272
273 {STRUCT_FLD(field_name, "lru_position"),
274 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
275 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
276 STRUCT_FLD(value, 0),
277 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
278 STRUCT_FLD(old_name, ""),
279 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
280
281 {STRUCT_FLD(field_name, "fix_count"),
282 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
283 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
284 STRUCT_FLD(value, 0),
285 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
286 STRUCT_FLD(old_name, ""),
287 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
288
289 {STRUCT_FLD(field_name, "flush_type"),
290 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
291 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
292 STRUCT_FLD(value, 0),
293 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
294 STRUCT_FLD(old_name, ""),
295 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
296
297 END_OF_ST_FIELD_INFO
298};
299
300static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_index_fields_info[] =
301{
302 {STRUCT_FLD(field_name, "index_id"),
303 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
304 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
305 STRUCT_FLD(value, 0),
306 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
307 STRUCT_FLD(old_name, ""),
308 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
309
310 {STRUCT_FLD(field_name, "space_id"),
311 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
312 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
313 STRUCT_FLD(value, 0),
314 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
315 STRUCT_FLD(old_name, ""),
316 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
317
318 {STRUCT_FLD(field_name, "page_no"),
319 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
320 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
321 STRUCT_FLD(value, 0),
322 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
323 STRUCT_FLD(old_name, ""),
324 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
325
326 {STRUCT_FLD(field_name, "n_recs"),
327 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
328 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
329 STRUCT_FLD(value, 0),
330 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
331 STRUCT_FLD(old_name, ""),
332 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
333
334 {STRUCT_FLD(field_name, "data_size"),
335 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
336 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
337 STRUCT_FLD(value, 0),
338 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
339 STRUCT_FLD(old_name, ""),
340 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
341
342 {STRUCT_FLD(field_name, "hashed"),
343 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
344 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
345 STRUCT_FLD(value, 0),
346 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
347 STRUCT_FLD(old_name, ""),
348 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
349
350 {STRUCT_FLD(field_name, "access_time"),
351 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
352 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
353 STRUCT_FLD(value, 0),
354 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
355 STRUCT_FLD(old_name, ""),
356 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
357
358 {STRUCT_FLD(field_name, "modified"),
359 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
360 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
361 STRUCT_FLD(value, 0),
362 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
363 STRUCT_FLD(old_name, ""),
364 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
365
366 {STRUCT_FLD(field_name, "dirty"),
367 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
368 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
369 STRUCT_FLD(value, 0),
370 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
371 STRUCT_FLD(old_name, ""),
372 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
373
374 {STRUCT_FLD(field_name, "old"),
375 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
376 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
377 STRUCT_FLD(value, 0),
378 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
379 STRUCT_FLD(old_name, ""),
380 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
381
382 {STRUCT_FLD(field_name, "lru_position"),
383 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
384 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
385 STRUCT_FLD(value, 0),
386 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
387 STRUCT_FLD(old_name, ""),
388 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
389
390 {STRUCT_FLD(field_name, "fix_count"),
391 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
392 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
393 STRUCT_FLD(value, 0),
394 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
395 STRUCT_FLD(old_name, ""),
396 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
397
398 {STRUCT_FLD(field_name, "flush_type"),
399 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
400 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
401 STRUCT_FLD(value, 0),
402 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
403 STRUCT_FLD(old_name, ""),
404 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
405
406 END_OF_ST_FIELD_INFO
407};
408
409static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_blob_fields_info[] =
410{
411 {STRUCT_FLD(field_name, "space_id"),
412 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
413 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
414 STRUCT_FLD(value, 0),
415 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
416 STRUCT_FLD(old_name, ""),
417 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
418
419 {STRUCT_FLD(field_name, "page_no"),
420 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
421 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
422 STRUCT_FLD(value, 0),
423 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
424 STRUCT_FLD(old_name, ""),
425 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
426
427 {STRUCT_FLD(field_name, "compressed"),
428 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
429 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
430 STRUCT_FLD(value, 0),
431 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
432 STRUCT_FLD(old_name, ""),
433 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
434
435 {STRUCT_FLD(field_name, "part_len"),
436 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
437 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
438 STRUCT_FLD(value, 0),
439 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
440 STRUCT_FLD(old_name, ""),
441 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
442
443 {STRUCT_FLD(field_name, "next_page_no"),
444 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
445 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
446 STRUCT_FLD(value, 0),
447 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
448 STRUCT_FLD(old_name, ""),
449 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
450
451 {STRUCT_FLD(field_name, "lru_position"),
452 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
453 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
454 STRUCT_FLD(value, 0),
455 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
456 STRUCT_FLD(old_name, ""),
457 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
458
459 {STRUCT_FLD(field_name, "fix_count"),
460 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
461 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
462 STRUCT_FLD(value, 0),
463 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
464 STRUCT_FLD(old_name, ""),
465 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
466
467 {STRUCT_FLD(field_name, "flush_type"),
468 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
469 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
470 STRUCT_FLD(value, 0),
471 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
472 STRUCT_FLD(old_name, ""),
473 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
474
475 END_OF_ST_FIELD_INFO
476};
477
478/***********************************************************************
479Fill the dynamic table information_schema.innodb_buffer_pool_pages. */
480static
481int
482i_s_innodb_buffer_pool_pages_fill(
483/*================*/
484 /* out: 0 on success, 1 on failure */
485 THD* thd, /* in: thread */
486 TABLE_LIST* tables, /* in/out: tables to fill */
487 COND* cond) /* in: condition (ignored) */
488{
489 TABLE* table = (TABLE *) tables->table;
490 int status = 0;
491
492 ulint n_chunks, n_blocks;
493
494 buf_chunk_t* chunk;
495
496 DBUG_ENTER("i_s_innodb_buffer_pool_pages_fill");
497
498 /* deny access to non-superusers */
499 if (check_global_access(thd, PROCESS_ACL)) {
500
501 DBUG_RETURN(0);
502 }
503
504 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
505
506 buf_pool_mutex_enter();
507
508 chunk = buf_pool->chunks;
509
510 for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
511 buf_block_t* block = chunk->blocks;
512
513 for (n_blocks = chunk->size; n_blocks--; block++) {
514 const buf_frame_t* frame = block->frame;
515
516 char page_type[64];
517
518 switch(fil_page_get_type(frame))
519 {
520 case FIL_PAGE_INDEX:
521 strcpy(page_type, "index");
522 break;
523 case FIL_PAGE_UNDO_LOG:
524 strcpy(page_type, "undo_log");
525 break;
526 case FIL_PAGE_INODE:
527 strcpy(page_type, "inode");
528 break;
529 case FIL_PAGE_IBUF_FREE_LIST:
530 strcpy(page_type, "ibuf_free_list");
531 break;
532 case FIL_PAGE_TYPE_ALLOCATED:
533 strcpy(page_type, "allocated");
534 break;
535 case FIL_PAGE_IBUF_BITMAP:
536 strcpy(page_type, "bitmap");
537 break;
538 case FIL_PAGE_TYPE_SYS:
539 strcpy(page_type, "sys");
540 break;
541 case FIL_PAGE_TYPE_TRX_SYS:
542 strcpy(page_type, "trx_sys");
543 break;
544 case FIL_PAGE_TYPE_FSP_HDR:
545 strcpy(page_type, "fsp_hdr");
546 break;
547 case FIL_PAGE_TYPE_XDES:
548 strcpy(page_type, "xdes");
549 break;
550 case FIL_PAGE_TYPE_BLOB:
551 strcpy(page_type, "blob");
552 break;
553 case FIL_PAGE_TYPE_ZBLOB:
554 strcpy(page_type, "zblob");
555 break;
556 case FIL_PAGE_TYPE_ZBLOB2:
557 strcpy(page_type, "zblob2");
558 break;
559 default:
560 sprintf(page_type, "unknown (type=%li)", fil_page_get_type(frame));
561 }
562
563 field_store_string(table->field[0], page_type);
564 table->field[1]->store(block->page.space);
565 table->field[2]->store(block->page.offset);
566 table->field[3]->store(0);
567 table->field[4]->store(block->page.buf_fix_count);
568 table->field[5]->store(block->page.flush_type);
569
570 if (schema_table_store_record(thd, table)) {
571 status = 1;
572 break;
573 }
574
575 }
576 }
577
578 buf_pool_mutex_exit();
579
580 DBUG_RETURN(status);
581}
582
583/***********************************************************************
584Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
585static
586int
587i_s_innodb_buffer_pool_pages_index_fill(
588/*================*/
589 /* out: 0 on success, 1 on failure */
590 THD* thd, /* in: thread */
591 TABLE_LIST* tables, /* in/out: tables to fill */
592 COND* cond) /* in: condition (ignored) */
593{
594 TABLE* table = (TABLE *) tables->table;
595 int status = 0;
596
597 ulint n_chunks, n_blocks;
598 dulint index_id;
599
600 buf_chunk_t* chunk;
601
602 DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_fill");
603
604 /* deny access to non-superusers */
605 if (check_global_access(thd, PROCESS_ACL)) {
606
607 DBUG_RETURN(0);
608 }
609
610 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
611
612 buf_pool_mutex_enter();
613
614 chunk = buf_pool->chunks;
615
616 for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
617 buf_block_t* block = chunk->blocks;
618
619 for (n_blocks = chunk->size; n_blocks--; block++) {
620 const buf_frame_t* frame = block->frame;
621
622 if (fil_page_get_type(frame) == FIL_PAGE_INDEX) {
623 index_id = btr_page_get_index_id(frame);
624 table->field[0]->store(ut_conv_dulint_to_longlong(index_id));
625 table->field[1]->store(block->page.space);
626 table->field[2]->store(block->page.offset);
627 table->field[3]->store(page_get_n_recs(frame));
628 table->field[4]->store(page_get_data_size(frame));
629 table->field[5]->store(block->index != NULL); /* is_hashed */
630 table->field[6]->store(block->page.access_time);
631 table->field[7]->store(block->page.newest_modification != 0);
632 table->field[8]->store(block->page.oldest_modification != 0);
633 table->field[9]->store(block->page.old);
634 table->field[10]->store(0);
635 table->field[11]->store(block->page.buf_fix_count);
636 table->field[12]->store(block->page.flush_type);
637
638 if (schema_table_store_record(thd, table)) {
639 status = 1;
640 break;
641 }
642 }
643 }
644 }
645
646 buf_pool_mutex_exit();
647
648 DBUG_RETURN(status);
649}
650
651/***********************************************************************
652Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
653static
654int
655i_s_innodb_buffer_pool_pages_blob_fill(
656/*================*/
657 /* out: 0 on success, 1 on failure */
658 THD* thd, /* in: thread */
659 TABLE_LIST* tables, /* in/out: tables to fill */
660 COND* cond) /* in: condition (ignored) */
661{
662 TABLE* table = (TABLE *) tables->table;
663 int status = 0;
664
665 ulint n_chunks, n_blocks;
666 buf_chunk_t* chunk;
667 page_zip_des_t* block_page_zip;
668
669 ulint part_len;
670 ulint next_page_no;
671
672 DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_fill");
673
674 /* deny access to non-superusers */
675 if (check_global_access(thd, PROCESS_ACL)) {
676
677 DBUG_RETURN(0);
678 }
679
680 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
681
682 buf_pool_mutex_enter();
683
684 chunk = buf_pool->chunks;
685
686 for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
687 buf_block_t* block = chunk->blocks;
688 block_page_zip = buf_block_get_page_zip(block);
689
690 for (n_blocks = chunk->size; n_blocks--; block++) {
691 const buf_frame_t* frame = block->frame;
692
693 if (fil_page_get_type(frame) == FIL_PAGE_TYPE_BLOB) {
694
695 if (UNIV_LIKELY_NULL(block_page_zip)) {
696 part_len = 0; /* hmm, can't figure it out */
697
698 next_page_no = mach_read_from_4(
699 buf_block_get_frame(block)
700 + FIL_PAGE_NEXT);
701 } else {
702 part_len = mach_read_from_4(
703 buf_block_get_frame(block)
704 + FIL_PAGE_DATA
705 + 0 /*BTR_BLOB_HDR_PART_LEN*/);
706
707 next_page_no = mach_read_from_4(
708 buf_block_get_frame(block)
709 + FIL_PAGE_DATA
710 + 4 /*BTR_BLOB_HDR_NEXT_PAGE_NO*/);
711 }
712
713 table->field[0]->store(block->page.space);
714 table->field[1]->store(block->page.offset);
715 table->field[2]->store(block_page_zip != NULL);
716 table->field[3]->store(part_len);
717
718 if(next_page_no == FIL_NULL)
719 {
720 table->field[4]->store(0);
721 } else {
722 table->field[4]->store(block->page.offset);
723 }
724
725 table->field[5]->store(0);
726 table->field[6]->store(block->page.buf_fix_count);
727 table->field[7]->store(block->page.flush_type);
728
729 if (schema_table_store_record(thd, table)) {
730 status = 1;
731 break;
732 }
733
734 }
735 }
736 }
737
738 buf_pool_mutex_exit();
739
740 DBUG_RETURN(status);
741}
742
743/***********************************************************************
744Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
745static
746int
747i_s_innodb_buffer_pool_pages_init(
748/*=========*/
749 /* out: 0 on success */
750 void* p) /* in/out: table schema object */
751{
752 DBUG_ENTER("i_s_innodb_buffer_pool_pages_init");
753 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
754
755 schema->fields_info = i_s_innodb_buffer_pool_pages_fields_info;
756 schema->fill_table = i_s_innodb_buffer_pool_pages_fill;
757
758 DBUG_RETURN(0);
759}
760
761/***********************************************************************
762Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
763static
764int
765i_s_innodb_buffer_pool_pages_index_init(
766/*=========*/
767 /* out: 0 on success */
768 void* p) /* in/out: table schema object */
769{
770 DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_init");
771 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
772
773 schema->fields_info = i_s_innodb_buffer_pool_pages_index_fields_info;
774 schema->fill_table = i_s_innodb_buffer_pool_pages_index_fill;
775
776 DBUG_RETURN(0);
777}
778
779/***********************************************************************
780Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
781static
782int
783i_s_innodb_buffer_pool_pages_blob_init(
784/*=========*/
785 /* out: 0 on success */
786 void* p) /* in/out: table schema object */
787{
788 DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_init");
789 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
790
791 schema->fields_info = i_s_innodb_buffer_pool_pages_blob_fields_info;
792 schema->fill_table = i_s_innodb_buffer_pool_pages_blob_fill;
793
794 DBUG_RETURN(0);
795}
796
797
798UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages =
799{
800 /* the plugin type (a MYSQL_XXX_PLUGIN value) */
801 /* int */
802 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
803
804 /* pointer to type-specific plugin descriptor */
805 /* void* */
806 STRUCT_FLD(info, &i_s_info),
807
808 /* plugin name */
809 /* const char* */
810 STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES"),
811
812 /* plugin author (for SHOW PLUGINS) */
813 /* const char* */
814 STRUCT_FLD(author, "Percona"),
815
816 /* general descriptive text (for SHOW PLUGINS) */
817 /* const char* */
818 STRUCT_FLD(descr, "InnoDB buffer pool pages"),
819
820 /* the plugin license (PLUGIN_LICENSE_XXX) */
821 /* int */
822 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
823
824 /* the function to invoke when plugin is loaded */
825 /* int (*)(void*); */
826 STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_init),
827
828 /* the function to invoke when plugin is unloaded */
829 /* int (*)(void*); */
830 STRUCT_FLD(deinit, i_s_common_deinit),
831
832 /* plugin version (for SHOW PLUGINS) */
833 /* unsigned int */
834 STRUCT_FLD(version, 0x0100 /* 1.0 */),
835
836 /* struct st_mysql_show_var* */
837 STRUCT_FLD(status_vars, NULL),
838
839 /* struct st_mysql_sys_var** */
840 STRUCT_FLD(system_vars, NULL),
841
842 /* reserved for dependency checking */
843 /* void* */
844 STRUCT_FLD(__reserved1, NULL)
845};
846
847UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index =
848{
849 /* the plugin type (a MYSQL_XXX_PLUGIN value) */
850 /* int */
851 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
852
853 /* pointer to type-specific plugin descriptor */
854 /* void* */
855 STRUCT_FLD(info, &i_s_info),
856
857 /* plugin name */
858 /* const char* */
859 STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_INDEX"),
860
861 /* plugin author (for SHOW PLUGINS) */
862 /* const char* */
863 STRUCT_FLD(author, "Percona"),
864
865 /* general descriptive text (for SHOW PLUGINS) */
866 /* const char* */
867 STRUCT_FLD(descr, "InnoDB buffer pool index pages"),
868
869 /* the plugin license (PLUGIN_LICENSE_XXX) */
870 /* int */
871 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
872
873 /* the function to invoke when plugin is loaded */
874 /* int (*)(void*); */
875 STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_index_init),
876
877 /* the function to invoke when plugin is unloaded */
878 /* int (*)(void*); */
879 STRUCT_FLD(deinit, i_s_common_deinit),
880
881 /* plugin version (for SHOW PLUGINS) */
882 /* unsigned int */
883 STRUCT_FLD(version, 0x0100 /* 1.0 */),
884
885 /* struct st_mysql_show_var* */
886 STRUCT_FLD(status_vars, NULL),
887
888 /* struct st_mysql_sys_var** */
889 STRUCT_FLD(system_vars, NULL),
890
891 /* reserved for dependency checking */
892 /* void* */
893 STRUCT_FLD(__reserved1, NULL)
894};
895
896UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob =
897{
898 /* the plugin type (a MYSQL_XXX_PLUGIN value) */
899 /* int */
900 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
901
902 /* pointer to type-specific plugin descriptor */
903 /* void* */
904 STRUCT_FLD(info, &i_s_info),
905
906 /* plugin name */
907 /* const char* */
908 STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_BLOB"),
909
910 /* plugin author (for SHOW PLUGINS) */
911 /* const char* */
912 STRUCT_FLD(author, "Percona"),
913
914 /* general descriptive text (for SHOW PLUGINS) */
915 /* const char* */
916 STRUCT_FLD(descr, "InnoDB buffer pool blob pages"),
917
918 /* the plugin license (PLUGIN_LICENSE_XXX) */
919 /* int */
920 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
921
922 /* the function to invoke when plugin is loaded */
923 /* int (*)(void*); */
924 STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_blob_init),
925
926 /* the function to invoke when plugin is unloaded */
927 /* int (*)(void*); */
928 STRUCT_FLD(deinit, i_s_common_deinit),
929
930 /* plugin version (for SHOW PLUGINS) */
931 /* unsigned int */
932 STRUCT_FLD(version, 0x0100 /* 1.0 */),
933
934 /* struct st_mysql_show_var* */
935 STRUCT_FLD(status_vars, NULL),
936
937 /* struct st_mysql_sys_var** */
938 STRUCT_FLD(system_vars, NULL),
939
940 /* reserved for dependency checking */
941 /* void* */
942 STRUCT_FLD(__reserved1, NULL)
943};
944
945
946>>>>>>> MERGE-SOURCE
224/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */947/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
225static ST_FIELD_INFO innodb_trx_fields_info[] =948static ST_FIELD_INFO innodb_trx_fields_info[] =
226{949{
@@ -1290,6 +2013,8 @@
12902013
1291 DBUG_ENTER("i_s_cmp_fill_low");2014 DBUG_ENTER("i_s_cmp_fill_low");
12922015
2016 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2017
1293 /* deny access to non-superusers */2018 /* deny access to non-superusers */
1294 if (check_global_access(thd, PROCESS_ACL)) {2019 if (check_global_access(thd, PROCESS_ACL)) {
12952020
@@ -1574,6 +2299,8 @@
15742299
1575 DBUG_ENTER("i_s_cmpmem_fill_low");2300 DBUG_ENTER("i_s_cmpmem_fill_low");
15762301
2302 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
2303
1577 /* deny access to non-superusers */2304 /* deny access to non-superusers */
1578 if (check_global_access(thd, PROCESS_ACL)) {2305 if (check_global_access(thd, PROCESS_ACL)) {
15792306
@@ -3819,6 +4546,8 @@
38194546
3820 DBUG_ENTER("i_s_innodb_rseg_fill");4547 DBUG_ENTER("i_s_innodb_rseg_fill");
38214548
4549 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
4550
3822 /* deny access to non-superusers */4551 /* deny access to non-superusers */
3823 if (check_global_access(thd, PROCESS_ACL)) {4552 if (check_global_access(thd, PROCESS_ACL)) {
38244553
@@ -3910,11 +4639,183 @@
39104639
3911 /* reserved for dependency checking */4640 /* reserved for dependency checking */
3912 /* void* */4641 /* void* */
4642<<<<<<< TREE
3913 STRUCT_FLD(__reserved1, NULL),4643 STRUCT_FLD(__reserved1, NULL),
39144644
3915 /* Plugin flags */4645 /* Plugin flags */
3916 /* unsigned long */4646 /* unsigned long */
3917 STRUCT_FLD(flags, 0UL),4647 STRUCT_FLD(flags, 0UL),
4648=======
4649 STRUCT_FLD(__reserved1, NULL)
4650};
4651
4652/***********************************************************************
4653*/
4654static ST_FIELD_INFO i_s_innodb_admin_command_info[] =
4655{
4656 {STRUCT_FLD(field_name, "result_message"),
4657 STRUCT_FLD(field_length, 1024),
4658 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4659 STRUCT_FLD(value, 0),
4660 STRUCT_FLD(field_flags, 0),
4661 STRUCT_FLD(old_name, ""),
4662 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4663
4664 END_OF_ST_FIELD_INFO
4665};
4666
4667#ifndef INNODB_COMPATIBILITY_HOOKS
4668#error InnoDB needs MySQL to be built with #define INNODB_COMPATIBILITY_HOOKS
4669#endif
4670
4671extern "C" {
4672char **thd_query(MYSQL_THD thd);
4673}
4674
4675static
4676int
4677i_s_innodb_admin_command_fill(
4678/*==========================*/
4679 THD* thd,
4680 TABLE_LIST* tables,
4681 COND* cond)
4682{
4683 TABLE* i_s_table = (TABLE *) tables->table;
4684 char** query_str;
4685 char* ptr;
4686 char quote = '\0';
4687 const char* command_head = "XTRA_";
4688
4689 DBUG_ENTER("i_s_innodb_admin_command_fill");
4690
4691 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
4692
4693 /* deny access to non-superusers */
4694 if (check_global_access(thd, PROCESS_ACL)) {
4695 DBUG_RETURN(0);
4696 }
4697
4698 if(thd_sql_command(thd) != SQLCOM_SELECT) {
4699 field_store_string(i_s_table->field[0],
4700 "SELECT command is only accepted.");
4701 goto end_func;
4702 }
4703
4704 query_str = thd_query(thd);
4705 ptr = *query_str;
4706
4707 for (; *ptr; ptr++) {
4708 if (*ptr == quote) {
4709 quote = '\0';
4710 } else if (quote) {
4711 } else if (*ptr == '`' || *ptr == '"') {
4712 quote = *ptr;
4713 } else {
4714 long i;
4715 for (i = 0; command_head[i]; i++) {
4716 if (toupper((int)(unsigned char)(ptr[i]))
4717 != toupper((int)(unsigned char)
4718 (command_head[i]))) {
4719 goto nomatch;
4720 }
4721 }
4722 break;
4723nomatch:
4724 ;
4725 }
4726 }
4727
4728 if (!*ptr) {
4729 field_store_string(i_s_table->field[0],
4730 "No XTRA_* command in the SQL statement."
4731 " Please add /*!XTRA_xxxx*/ to the SQL.");
4732 goto end_func;
4733 }
4734
4735 if (!strncasecmp("XTRA_HELLO", ptr, 10)) {
4736 /* This is example command XTRA_HELLO */
4737
4738 ut_print_timestamp(stderr);
4739 fprintf(stderr, " InnoDB: administration command test for XtraDB"
4740 " 'XTRA_HELLO' was detected.\n");
4741
4742 field_store_string(i_s_table->field[0],
4743 "Hello!");
4744 goto end_func;
4745 }
4746 else if (!strncasecmp("XTRA_LRU_DUMP", ptr, 13)) {
4747 ut_print_timestamp(stderr);
4748 fprintf(stderr, " InnoDB: administration command 'XTRA_LRU_DUMP'"
4749 " was detected.\n");
4750
4751 if (buf_LRU_file_dump()) {
4752 field_store_string(i_s_table->field[0],
4753 "XTRA_LRU_DUMP was succeeded.");
4754 } else {
4755 field_store_string(i_s_table->field[0],
4756 "XTRA_LRU_DUMP was failed.");
4757 }
4758
4759 goto end_func;
4760 }
4761 else if (!strncasecmp("XTRA_LRU_RESTORE", ptr, 16)) {
4762 ut_print_timestamp(stderr);
4763 fprintf(stderr, " InnoDB: administration command 'XTRA_LRU_RESTORE'"
4764 " was detected.\n");
4765
4766 if (buf_LRU_file_restore()) {
4767 field_store_string(i_s_table->field[0],
4768 "XTRA_LRU_RESTORE was succeeded.");
4769 } else {
4770 field_store_string(i_s_table->field[0],
4771 "XTRA_LRU_RESTORE was failed.");
4772 }
4773
4774 goto end_func;
4775 }
4776
4777 field_store_string(i_s_table->field[0],
4778 "Undefined XTRA_* command.");
4779 goto end_func;
4780
4781end_func:
4782 if (schema_table_store_record(thd, i_s_table)) {
4783 DBUG_RETURN(1);
4784 } else {
4785 DBUG_RETURN(0);
4786 }
4787}
4788
4789static
4790int
4791i_s_innodb_admin_command_init(
4792/*==========================*/
4793 void* p)
4794{
4795 DBUG_ENTER("i_s_innodb_admin_command_init");
4796 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
4797
4798 schema->fields_info = i_s_innodb_admin_command_info;
4799 schema->fill_table = i_s_innodb_admin_command_fill;
4800
4801 DBUG_RETURN(0);
4802}
4803
4804UNIV_INTERN struct st_mysql_plugin i_s_innodb_admin_command =
4805{
4806 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
4807 STRUCT_FLD(info, &i_s_info),
4808 STRUCT_FLD(name, "XTRADB_ADMIN_COMMAND"),
4809 STRUCT_FLD(author, "Percona"),
4810 STRUCT_FLD(descr, "XtraDB specific command acceptor"),
4811 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
4812 STRUCT_FLD(init, i_s_innodb_admin_command_init),
4813 STRUCT_FLD(deinit, i_s_common_deinit),
4814 STRUCT_FLD(version, 0x0100 /* 1.0 */),
4815 STRUCT_FLD(status_vars, NULL),
4816 STRUCT_FLD(system_vars, NULL),
4817 STRUCT_FLD(__reserved1, NULL)
4818>>>>>>> MERGE-SOURCE
3918};4819};
39194820
3920/***********************************************************************4821/***********************************************************************
@@ -4308,6 +5209,8 @@
43085209
4309 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);5210 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
43105211
5212 RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
5213
4311 /* deny access to non-superusers */5214 /* deny access to non-superusers */
4312 if (check_global_access(thd, PROCESS_ACL)) {5215 if (check_global_access(thd, PROCESS_ACL)) {
4313 DBUG_RETURN(0);5216 DBUG_RETURN(0);
@@ -4410,6 +5313,7 @@
4410/*==========================*/5313/*==========================*/
4411 void* p)5314 void* p)
4412{5315{
5316<<<<<<< TREE
4413 DBUG_ENTER("i_s_innodb_admin_command_init");5317 DBUG_ENTER("i_s_innodb_admin_command_init");
4414 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;5318 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
44155319
@@ -5389,3 +6293,346 @@
5389 STRUCT_FLD(flags, 0UL),6293 STRUCT_FLD(flags, 0UL),
5390};6294};
53916295
6296=======
6297 DBUG_ENTER("i_s_innodb_sys_stats_init");
6298 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
6299
6300 schema->fields_info = i_s_innodb_sys_stats_info;
6301 schema->fill_table = i_s_innodb_schema_table_fill;
6302
6303 DBUG_RETURN(0);
6304}
6305
6306UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_tables =
6307{
6308 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
6309 STRUCT_FLD(info, &i_s_info),
6310 STRUCT_FLD(name, "INNODB_SYS_TABLES"),
6311 STRUCT_FLD(author, "Percona"),
6312 STRUCT_FLD(descr, "InnoDB SYS_TABLES table"),
6313 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
6314 STRUCT_FLD(init, i_s_innodb_sys_tables_init),
6315 STRUCT_FLD(deinit, i_s_common_deinit),
6316 STRUCT_FLD(version, 0x0100 /* 1.0 */),
6317 STRUCT_FLD(status_vars, NULL),
6318 STRUCT_FLD(system_vars, NULL),
6319 STRUCT_FLD(__reserved1, NULL)
6320};
6321
6322UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_indexes =
6323{
6324 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
6325 STRUCT_FLD(info, &i_s_info),
6326 STRUCT_FLD(name, "INNODB_SYS_INDEXES"),
6327 STRUCT_FLD(author, "Percona"),
6328 STRUCT_FLD(descr, "InnoDB SYS_INDEXES table"),
6329 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
6330 STRUCT_FLD(init, i_s_innodb_sys_indexes_init),
6331 STRUCT_FLD(deinit, i_s_common_deinit),
6332 STRUCT_FLD(version, 0x0100 /* 1.0 */),
6333 STRUCT_FLD(status_vars, NULL),
6334 STRUCT_FLD(system_vars, NULL),
6335 STRUCT_FLD(__reserved1, NULL)
6336};
6337
6338UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_stats =
6339{
6340 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
6341 STRUCT_FLD(info, &i_s_info),
6342 STRUCT_FLD(name, "INNODB_SYS_STATS"),
6343 STRUCT_FLD(author, "Percona"),
6344 STRUCT_FLD(descr, "InnoDB SYS_STATS table"),
6345 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
6346 STRUCT_FLD(init, i_s_innodb_sys_stats_init),
6347 STRUCT_FLD(deinit, i_s_common_deinit),
6348 STRUCT_FLD(version, 0x0100 /* 1.0 */),
6349 STRUCT_FLD(status_vars, NULL),
6350 STRUCT_FLD(system_vars, NULL),
6351 STRUCT_FLD(__reserved1, NULL)
6352};
6353
6354static ST_FIELD_INFO i_s_innodb_changed_pages_info[] =
6355{
6356 {STRUCT_FLD(field_name, "space_id"),
6357 STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
6358 STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
6359 STRUCT_FLD(value, 0),
6360 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
6361 STRUCT_FLD(old_name, ""),
6362 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
6363
6364 {STRUCT_FLD(field_name, "page_id"),
6365 STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
6366 STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
6367 STRUCT_FLD(value, 0),
6368 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
6369 STRUCT_FLD(old_name, ""),
6370 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
6371
6372 {STRUCT_FLD(field_name, "start_lsn"),
6373 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
6374 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
6375 STRUCT_FLD(value, 0),
6376 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
6377 STRUCT_FLD(old_name, ""),
6378 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
6379
6380 {STRUCT_FLD(field_name, "end_lsn"),
6381 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
6382 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
6383 STRUCT_FLD(value, 0),
6384 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
6385 STRUCT_FLD(old_name, ""),
6386 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
6387
6388 END_OF_ST_FIELD_INFO
6389};
6390
6391/***********************************************************************
6392 This function parses condition and gets upper bounds for start and end LSN's
6393 if condition corresponds to certain pattern.
6394
6395 We can't know right position to avoid scanning bitmap files from the beginning
6396 to the lower bound. But we can stop scanning bitmap files if we reach upper bound.
6397
6398 It's expected the most used queries will be like the following:
6399
6400 SELECT * FROM INNODB_CHANGED_PAGES WHERE START_LSN > num1 AND start_lsn < num2;
6401
6402 That's why the pattern is:
6403
6404 pattern: comp | and_comp;
6405 comp: lsn < int_num | lsn <= int_num | int_num > lsn | int_num >= lsn;
6406 lsn: start_lsn | end_lsn;
6407 and_comp: some_expression AND some_expression | some_expression AND and_comp;
6408 some_expression: comp | any_other_expression;
6409
6410 Suppose the condition is start_lsn < 100, this means we have to read all
6411 blocks with start_lsn < 100. Which is equivalent to reading all the blocks
6412 with end_lsn <= 99, or just end_lsn < 100. That's why it's enough to find
6413 maximum lsn value, doesn't matter if this is start or end lsn and compare
6414 it with "start_lsn" field.
6415
6416 Example:
6417
6418 SELECT * FROM INNODB_CHANGED_PAGES
6419 WHERE
6420 start_lsn > 10 AND
6421 end_lsn <= 1111 AND
6422 555 > end_lsn AND
6423 page_id = 100;
6424
6425 max_lsn will be set to 555.
6426*/
6427static
6428void
6429limit_lsn_range_from_condition(
6430/*===========================*/
6431 TABLE* table, /*!<in: table */
6432 COND* cond, /*!<in: condition */
6433 ib_uint64_t* max_lsn) /*!<in/out: maximum LSN
6434 (must be initialized with maximum
6435 available value) */
6436{
6437 if (cond->type() != Item::COND_ITEM &&
6438 cond->type() != Item::FUNC_ITEM)
6439 return;
6440
6441 switch (((Item_func*) cond)->functype())
6442 {
6443 case Item_func::COND_AND_FUNC:
6444 {
6445 List_iterator<Item> li(*((Item_cond*) cond)->
6446 argument_list());
6447 Item *item;
6448 while ((item= li++))
6449 limit_lsn_range_from_condition(table,
6450 item,
6451 max_lsn);
6452 break;
6453 }
6454 case Item_func::LT_FUNC:
6455 case Item_func::LE_FUNC:
6456 case Item_func::GT_FUNC:
6457 case Item_func::GE_FUNC:
6458 {
6459 Item *left;
6460 Item *right;
6461 Item_field *item_field;
6462 ib_uint64_t tmp_result;
6463
6464 /*
6465 a <= b equals to b >= a that's why we just exchange
6466 "left" and "right" in the case of ">" or ">="
6467 function
6468 */
6469 if (((Item_func*) cond)->functype() ==
6470 Item_func::LT_FUNC ||
6471 ((Item_func*) cond)->functype() ==
6472 Item_func::LE_FUNC)
6473 {
6474 left = ((Item_func*) cond)->arguments()[0];
6475 right = ((Item_func*) cond)->arguments()[1];
6476 } else {
6477 left = ((Item_func*) cond)->arguments()[1];
6478 right = ((Item_func*) cond)->arguments()[0];
6479 }
6480
6481 if (!left || !right)
6482 return;
6483 if (left->type() != Item::FIELD_ITEM)
6484 return;
6485 if (right->type() != Item::INT_ITEM)
6486 return;
6487
6488 item_field = (Item_field*)left;
6489
6490 if (/* START_LSN */
6491 table->field[2] != item_field->field &&
6492 /* END_LSN */
6493 table->field[3] != item_field->field)
6494 {
6495 return;
6496 }
6497
6498 /* Check if the current field belongs to our table */
6499 if (table != item_field->field->table)
6500 return;
6501
6502 tmp_result = right->val_int();
6503 if (tmp_result < *max_lsn)
6504 *max_lsn = tmp_result;
6505
6506 break;
6507 }
6508 default:;
6509 }
6510
6511}
6512
6513/***********************************************************************
6514Fill the dynamic table information_schema.innodb_changed_pages.
6515@return 0 on success, 1 on failure */
6516static
6517int
6518i_s_innodb_changed_pages_fill(
6519/*==========================*/
6520 THD* thd, /*!<in: thread */
6521 TABLE_LIST* tables, /*!<in/out: tables to fill */
6522 COND* cond) /*!<in: condition */
6523{
6524 TABLE* table = (TABLE *) tables->table;
6525 log_bitmap_iterator_t i;
6526 ib_uint64_t output_rows_num = 0UL;
6527 ib_uint64_t max_lsn = ~0ULL;
6528
6529 if (!srv_track_changed_pages)
6530 return 0;
6531
6532 if (!log_online_bitmap_iterator_init(&i))
6533 return 1;
6534
6535 if (cond)
6536 limit_lsn_range_from_condition(table, cond, &max_lsn);
6537
6538 while(log_online_bitmap_iterator_next(&i) &&
6539 (!srv_changed_pages_limit ||
6540 output_rows_num < srv_changed_pages_limit) &&
6541 /*
6542 There is no need to compare both start LSN and end LSN fields
6543 with maximum value. It's enough to compare only start LSN.
6544 Example:
6545
6546 max_lsn = 100
6547 \\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1
6548 I------I I-------I I-------------I I----I
6549 ////////////////// | - Query 2
6550 1 2 3 4
6551
6552 Query 1:
6553 SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100
6554 will select 1,2,3 bitmaps
6555 Query 2:
6556 SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100
6557 will select 1,2 bitmaps
6558
6559 The condition start_lsn <= 100 will be false after reading
6560 1,2,3 bitmaps which suits for both cases.
6561 */
6562 LOG_BITMAP_ITERATOR_START_LSN(i) <= max_lsn)
6563 {
6564 if (!LOG_BITMAP_ITERATOR_PAGE_CHANGED(i))
6565 continue;
6566
6567 /* SPACE_ID */
6568 table->field[0]->store(
6569 LOG_BITMAP_ITERATOR_SPACE_ID(i));
6570 /* PAGE_ID */
6571 table->field[1]->store(
6572 LOG_BITMAP_ITERATOR_PAGE_NUM(i));
6573 /* START_LSN */
6574 table->field[2]->store(
6575 LOG_BITMAP_ITERATOR_START_LSN(i));
6576 /* END_LSN */
6577 table->field[3]->store(
6578 LOG_BITMAP_ITERATOR_END_LSN(i));
6579
6580 /*
6581 I_S tables are in-memory tables. If bitmap file is big enough
6582 a lot of memory can be used to store the table. But the size
6583 of used memory can be diminished if we store only data which
6584 corresponds to some conditions (in WHERE sql clause). Here
6585 conditions are checked for the field values stored above.
6586
6587 Conditions are checked twice. The first is here (during table
6588 generation) and the second during query execution. Maybe it
6589 makes sense to use some flag in THD object to avoid double
6590 checking.
6591 */
6592 if (cond && !cond->val_int())
6593 continue;
6594
6595 if (schema_table_store_record(thd, table))
6596 {
6597 log_online_bitmap_iterator_release(&i);
6598 return 1;
6599 }
6600
6601 ++output_rows_num;
6602 }
6603
6604 log_online_bitmap_iterator_release(&i);
6605 return 0;
6606}
6607
6608static
6609int
6610i_s_innodb_changed_pages_init(
6611/*==========================*/
6612 void* p)
6613{
6614 DBUG_ENTER("i_s_innodb_changed_pages_init");
6615 ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
6616
6617 schema->fields_info = i_s_innodb_changed_pages_info;
6618 schema->fill_table = i_s_innodb_changed_pages_fill;
6619
6620 DBUG_RETURN(0);
6621}
6622
6623UNIV_INTERN struct st_mysql_plugin i_s_innodb_changed_pages =
6624{
6625 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
6626 STRUCT_FLD(info, &i_s_info),
6627 STRUCT_FLD(name, "INNODB_CHANGED_PAGES"),
6628 STRUCT_FLD(author, "Percona"),
6629 STRUCT_FLD(descr, "InnoDB CHANGED_PAGES table"),
6630 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
6631 STRUCT_FLD(init, i_s_innodb_changed_pages_init),
6632 STRUCT_FLD(deinit, i_s_common_deinit),
6633 STRUCT_FLD(version, 0x0100 /* 1.0 */),
6634 STRUCT_FLD(status_vars, NULL),
6635 STRUCT_FLD(system_vars, NULL),
6636 STRUCT_FLD(__reserved1, NULL)
6637};
6638>>>>>>> MERGE-SOURCE
53926639
=== modified file 'Percona-Server/storage/innobase/handler/i_s.h'
--- Percona-Server/storage/innobase/handler/i_s.h 2012-06-19 16:19:46 +0000
+++ Percona-Server/storage/innobase/handler/i_s.h 2012-08-15 14:13:50 +0000
@@ -35,6 +35,7 @@
35extern struct st_mysql_plugin i_s_innodb_cmp_reset;35extern struct st_mysql_plugin i_s_innodb_cmp_reset;
36extern struct st_mysql_plugin i_s_innodb_cmpmem;36extern struct st_mysql_plugin i_s_innodb_cmpmem;
37extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;37extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;
38<<<<<<< TREE
38extern struct st_mysql_plugin i_s_innodb_sys_tables;39extern struct st_mysql_plugin i_s_innodb_sys_tables;
39extern struct st_mysql_plugin i_s_innodb_sys_tablestats;40extern struct st_mysql_plugin i_s_innodb_sys_tablestats;
40extern struct st_mysql_plugin i_s_innodb_sys_indexes;41extern struct st_mysql_plugin i_s_innodb_sys_indexes;
@@ -42,14 +43,23 @@
42extern struct st_mysql_plugin i_s_innodb_sys_fields;43extern struct st_mysql_plugin i_s_innodb_sys_fields;
43extern struct st_mysql_plugin i_s_innodb_sys_foreign;44extern struct st_mysql_plugin i_s_innodb_sys_foreign;
44extern struct st_mysql_plugin i_s_innodb_sys_foreign_cols;45extern struct st_mysql_plugin i_s_innodb_sys_foreign_cols;
46=======
47>>>>>>> MERGE-SOURCE
45extern struct st_mysql_plugin i_s_innodb_rseg;48extern struct st_mysql_plugin i_s_innodb_rseg;
46extern struct st_mysql_plugin i_s_innodb_undo_logs;49extern struct st_mysql_plugin i_s_innodb_undo_logs;
47extern struct st_mysql_plugin i_s_innodb_sys_stats;50extern struct st_mysql_plugin i_s_innodb_sys_stats;
48extern struct st_mysql_plugin i_s_innodb_table_stats;51extern struct st_mysql_plugin i_s_innodb_table_stats;
49extern struct st_mysql_plugin i_s_innodb_index_stats;52extern struct st_mysql_plugin i_s_innodb_index_stats;
50extern struct st_mysql_plugin i_s_innodb_admin_command;53extern struct st_mysql_plugin i_s_innodb_admin_command;
54<<<<<<< TREE
51extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages;55extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages;
52extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index;56extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index;
53extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob;57extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob;
58=======
59extern struct st_mysql_plugin i_s_innodb_sys_tables;
60extern struct st_mysql_plugin i_s_innodb_sys_indexes;
61extern struct st_mysql_plugin i_s_innodb_sys_stats;
62extern struct st_mysql_plugin i_s_innodb_changed_pages;
63>>>>>>> MERGE-SOURCE
5464
55#endif /* i_s_h */65#endif /* i_s_h */
5666
=== modified file 'Percona-Server/storage/innobase/include/log0log.h'
--- Percona-Server/storage/innobase/include/log0log.h 2012-08-07 06:10:00 +0000
+++ Percona-Server/storage/innobase/include/log0log.h 2012-08-15 14:13:50 +0000
@@ -962,6 +962,11 @@
962 become signaled */962 become signaled */
963 /* @} */963 /* @} */
964#endif /* UNIV_LOG_ARCHIVE */964#endif /* UNIV_LOG_ARCHIVE */
965 ib_uint64_t tracked_lsn; /*!< log tracking has advanced to this
966 lsn. Field accessed atomically where
967 64-bit atomic ops are supported,
968 protected by the log sys mutex
969 otherwise. */
965};970};
966971
967/** Test if flush order mutex is owned. */972/** Test if flush order mutex is owned. */
968973
=== added file 'Percona-Server/storage/innobase/include/log0online.h'
--- Percona-Server/storage/innobase/include/log0online.h 1970-01-01 00:00:00 +0000
+++ Percona-Server/storage/innobase/include/log0online.h 2012-08-15 14:13:50 +0000
@@ -0,0 +1,111 @@
1/*****************************************************************************
2
3Copyright (c) 2011-2012, Percona Inc. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15Place, Suite 330, Boston, MA 02111-1307 USA
16
17*****************************************************************************/
18
19/**************************************************//**
20@file include/log0online.h
21Online database log parsing for changed page tracking
22*******************************************************/
23
24#ifndef log0online_h
25#define log0online_h
26
27#include "univ.i"
28#include "os0file.h"
29
30/*********************************************************************//**
31Initializes the online log following subsytem. */
32UNIV_INTERN
33void
34log_online_read_init();
35/*===================*/
36
37/*********************************************************************//**
38Shuts down the online log following subsystem. */
39UNIV_INTERN
40void
41log_online_read_shutdown();
42/*=======================*/
43
44/*********************************************************************//**
45Reads and parses the redo log up to last checkpoint LSN to build the changed
46page bitmap which is then written to disk. */
47UNIV_INTERN
48void
49log_online_follow_redo_log();
50/*=========================*/
51
52/** The iterator through all bits of changed pages bitmap blocks */
53struct log_bitmap_iterator_struct
54{
55 char in_name[FN_REFLEN]; /*!< the file name for bitmap
56 input */
57 os_file_t in; /*!< the bitmap input file */
58 ib_uint64_t in_offset; /*!< the next write position in the
59 bitmap output file */
60 ib_uint32_t bit_offset; /*!< bit offset inside of bitmap
61 block*/
62 ib_uint64_t start_lsn; /*!< Start lsn of the block */
63 ib_uint64_t end_lsn; /*!< End lsn of the block */
64 ib_uint32_t space_id; /*!< Block space id */
65 ib_uint32_t first_page_id; /*!< First block page id */
66 ibool changed; /*!< true if current page was changed */
67 byte* page; /*!< Bitmap block */
68};
69
70typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t;
71
72#define LOG_BITMAP_ITERATOR_START_LSN(i) \
73 ((i).start_lsn)
74#define LOG_BITMAP_ITERATOR_END_LSN(i) \
75 ((i).end_lsn)
76#define LOG_BITMAP_ITERATOR_SPACE_ID(i) \
77 ((i).space_id)
78#define LOG_BITMAP_ITERATOR_PAGE_NUM(i) \
79 ((i).first_page_id + (i).bit_offset)
80#define LOG_BITMAP_ITERATOR_PAGE_CHANGED(i) \
81 ((i).changed)
82
83/*********************************************************************//**
84Initializes log bitmap iterator.
85@return TRUE if the iterator is initialized OK, FALSE otherwise. */
86UNIV_INTERN
87ibool
88log_online_bitmap_iterator_init(
89/*============================*/
90 log_bitmap_iterator_t *i); /*!<in/out: iterator */
91
92/*********************************************************************//**
93Releases log bitmap iterator. */
94UNIV_INTERN
95void
96log_online_bitmap_iterator_release(
97/*===============================*/
98 log_bitmap_iterator_t *i); /*!<in/out: iterator */
99
100/*********************************************************************//**
101Iterates through bits of saved bitmap blocks.
102Sequentially reads blocks from bitmap file(s) and interates through
103their bits. Ignores blocks with wrong checksum.
104@return TRUE if iteration is successful, FALSE if all bits are iterated. */
105UNIV_INTERN
106ibool
107log_online_bitmap_iterator_next(
108/*============================*/
109 log_bitmap_iterator_t *i); /*!<in/out: iterator */
110
111#endif
0112
=== modified file 'Percona-Server/storage/innobase/include/log0recv.h'
--- Percona-Server/storage/innobase/include/log0recv.h 2012-05-10 07:49:14 +0000
+++ Percona-Server/storage/innobase/include/log0recv.h 2012-08-15 14:13:50 +0000
@@ -32,6 +32,28 @@
32#include "hash0hash.h"32#include "hash0hash.h"
33#include "log0log.h"33#include "log0log.h"
3434
35/******************************************************//**
36Checks the 4-byte checksum to the trailer checksum field of a log
37block. We also accept a log block in the old format before
38InnoDB-3.23.52 where the checksum field contains the log block number.
39@return TRUE if ok, or if the log block may be in the format of InnoDB
40version predating 3.23.52 */
41UNIV_INTERN
42ibool
43log_block_checksum_is_ok_or_old_format(
44/*===================================*/
45 const byte* block); /*!< in: pointer to a log block */
46
47/*******************************************************//**
48Calculates the new value for lsn when more data is added to the log. */
49UNIV_INTERN
50ib_uint64_t
51recv_calc_lsn_on_data_add(
52/*======================*/
53 ib_uint64_t lsn, /*!< in: old lsn */
54 ib_uint64_t len); /*!< in: this many bytes of data is
55 added, log block headers not included */
56
35#ifdef UNIV_HOTBACKUP57#ifdef UNIV_HOTBACKUP
36extern ibool recv_replay_file_ops;58extern ibool recv_replay_file_ops;
3759
@@ -182,6 +204,21 @@
182void204void
183recv_recovery_rollback_active(void);205recv_recovery_rollback_active(void);
184/*===============================*/206/*===============================*/
207
208/*******************************************************************//**
209Tries to parse a single log record and returns its length.
210@return length of the record, or 0 if the record was not complete */
211UNIV_INTERN
212ulint
213recv_parse_log_rec(
214/*===============*/
215 byte* ptr, /*!< in: pointer to a buffer */
216 byte* end_ptr,/*!< in: pointer to the buffer end */
217 byte* type, /*!< out: type */
218 ulint* space, /*!< out: space id */
219 ulint* page_no,/*!< out: page number */
220 byte** body); /*!< out: log record body start */
221
185/*******************************************************//**222/*******************************************************//**
186Scans log from a buffer and stores new log data to the parsing buffer.223Scans log from a buffer and stores new log data to the parsing buffer.
187Parses and hashes the log records if new data found. Unless224Parses and hashes the log records if new data found. Unless
188225
=== modified file 'Percona-Server/storage/innobase/include/os0file.h'
--- Percona-Server/storage/innobase/include/os0file.h 2012-08-07 06:10:00 +0000
+++ Percona-Server/storage/innobase/include/os0file.h 2012-08-15 14:13:50 +0000
@@ -867,7 +867,18 @@
867/*============*/867/*============*/
868 FILE* file); /*!< in: file to be truncated */868 FILE* file); /*!< in: file to be truncated */
869/***********************************************************************//**869/***********************************************************************//**
870<<<<<<< TREE
870NOTE! Use the corresponding macro os_file_flush(), not directly this function!871NOTE! Use the corresponding macro os_file_flush(), not directly this function!
872=======
873Truncates a file at the specified position.
874@return TRUE if success */
875UNIV_INTERN
876ibool
877os_file_set_eof_at(
878 os_file_t file, /*!< in: handle to a file */
879 ib_uint64_t new_len);/*!< in: new file length */
880/***********************************************************************//**
881>>>>>>> MERGE-SOURCE
871Flushes the write buffers of a given file to the disk.882Flushes the write buffers of a given file to the disk.
872@return TRUE if success */883@return TRUE if success */
873UNIV_INTERN884UNIV_INTERN
874885
=== modified file 'Percona-Server/storage/innobase/include/os0sync.h'
--- Percona-Server/storage/innobase/include/os0sync.h 2012-05-10 07:49:14 +0000
+++ Percona-Server/storage/innobase/include/os0sync.h 2012-08-15 14:13:50 +0000
@@ -265,7 +265,11 @@
265265
266#if defined(HAVE_IB_GCC_ATOMIC_BUILTINS)266#if defined(HAVE_IB_GCC_ATOMIC_BUILTINS)
267267
268#define HAVE_ATOMIC_BUILTINS268# define HAVE_ATOMIC_BUILTINS
269
270# ifdef HAVE_IB_GCC_ATOMIC_BUILTINS_64
271# define HAVE_ATOMIC_BUILTINS_64
272# endif
269273
270/**********************************************************//**274/**********************************************************//**
271Returns true if swapped, ptr is pointer to target, old_val is value to275Returns true if swapped, ptr is pointer to target, old_val is value to
@@ -304,6 +308,9 @@
304# define os_atomic_increment_ulint(ptr, amount) \308# define os_atomic_increment_ulint(ptr, amount) \
305 os_atomic_increment(ptr, amount)309 os_atomic_increment(ptr, amount)
306310
311# define os_atomic_increment_uint64(ptr, amount) \
312 os_atomic_increment(ptr, amount)
313
307/**********************************************************//**314/**********************************************************//**
308Returns the old value of *ptr, atomically sets *ptr to new_val */315Returns the old value of *ptr, atomically sets *ptr to new_val */
309316
@@ -312,12 +319,13 @@
312319
313#elif defined(HAVE_IB_SOLARIS_ATOMICS)320#elif defined(HAVE_IB_SOLARIS_ATOMICS)
314321
315#define HAVE_ATOMIC_BUILTINS322# define HAVE_ATOMIC_BUILTINS
323# define HAVE_ATOMIC_BUILTINS_64
316324
317/* If not compiling with GCC or GCC doesn't support the atomic325/* If not compiling with GCC or GCC doesn't support the atomic
318intrinsics and running on Solaris >= 10 use Solaris atomics */326intrinsics and running on Solaris >= 10 use Solaris atomics */
319327
320#include <atomic.h>328# include <atomic.h>
321329
322/**********************************************************//**330/**********************************************************//**
323Returns true if swapped, ptr is pointer to target, old_val is value to331Returns true if swapped, ptr is pointer to target, old_val is value to
@@ -357,6 +365,9 @@
357# define os_atomic_increment_ulint(ptr, amount) \365# define os_atomic_increment_ulint(ptr, amount) \
358 atomic_add_long_nv(ptr, amount)366 atomic_add_long_nv(ptr, amount)
359367
368# define os_atomic_increment_uint64(ptr, amount) \
369 atomic_add_64_nv(ptr, amount)
370
360/**********************************************************//**371/**********************************************************//**
361Returns the old value of *ptr, atomically sets *ptr to new_val */372Returns the old value of *ptr, atomically sets *ptr to new_val */
362373
@@ -365,7 +376,11 @@
365376
366#elif defined(HAVE_WINDOWS_ATOMICS)377#elif defined(HAVE_WINDOWS_ATOMICS)
367378
368#define HAVE_ATOMIC_BUILTINS379# define HAVE_ATOMIC_BUILTINS
380
381# ifndef _WIN32
382# define HAVE_ATOMIC_BUILTINS_64
383# endif
369384
370/* On Windows, use Windows atomics / interlocked */385/* On Windows, use Windows atomics / interlocked */
371# ifdef _WIN64386# ifdef _WIN64
@@ -403,6 +418,11 @@
403# define os_atomic_increment_ulint(ptr, amount) \418# define os_atomic_increment_ulint(ptr, amount) \
404 ((ulint) (win_xchg_and_add(ptr, amount) + amount))419 ((ulint) (win_xchg_and_add(ptr, amount) + amount))
405420
421# define os_atomic_increment_uint64(ptr, amount) \
422 ((ib_uint64_t) (InterlockedExchangeAdd64( \
423 (ib_int64_t*) ptr, \
424 (ib_int64_t) amount) + amount))
425
406/**********************************************************//**426/**********************************************************//**
407Returns the old value of *ptr, atomically sets *ptr to new_val.427Returns the old value of *ptr, atomically sets *ptr to new_val.
408InterlockedExchange() operates on LONG, and the LONG will be428InterlockedExchange() operates on LONG, and the LONG will be
409429
=== modified file 'Percona-Server/storage/innobase/include/srv0srv.h'
--- Percona-Server/storage/innobase/include/srv0srv.h 2012-08-07 06:10:00 +0000
+++ Percona-Server/storage/innobase/include/srv0srv.h 2012-08-15 14:13:50 +0000
@@ -66,6 +66,14 @@
66/* The error monitor thread waits on this event. */66/* The error monitor thread waits on this event. */
67extern os_event_t srv_error_event;67extern os_event_t srv_error_event;
6868
69/* This event is set on checkpoint completion to wake the redo log parser
70thread */
71extern os_event_t srv_checkpoint_completed_event;
72
73/* This event is set on the online redo log following thread exit to signal
74that the (slow) shutdown may proceed */
75extern os_event_t srv_redo_log_thread_finished_event;
76
69/* If the last data file is auto-extended, we add this many pages to it77/* If the last data file is auto-extended, we add this many pages to it
70at a time */78at a time */
71#define SRV_AUTO_EXTEND_INCREMENT \79#define SRV_AUTO_EXTEND_INCREMENT \
@@ -133,6 +141,16 @@
133141
134extern ibool srv_recovery_stats;142extern ibool srv_recovery_stats;
135143
144<<<<<<< TREE
145=======
146extern ulint srv_use_purge_thread;
147
148extern my_bool srv_track_changed_pages;
149
150extern
151ulonglong srv_changed_pages_limit;
152
153>>>>>>> MERGE-SOURCE
136extern ibool srv_auto_extend_last_data_file;154extern ibool srv_auto_extend_last_data_file;
137extern ulint srv_last_file_size_max;155extern ulint srv_last_file_size_max;
138extern char** srv_log_group_home_dirs;156extern char** srv_log_group_home_dirs;
@@ -694,6 +712,15 @@
694 void* arg); /*!< in: a dummy parameter required by712 void* arg); /*!< in: a dummy parameter required by
695 os_thread_create */713 os_thread_create */
696/******************************************************************//**714/******************************************************************//**
715A thread which follows the redo log and outputs the changed page bitmap.
716@return a dummy value */
717UNIV_INTERN
718os_thread_ret_t
719srv_redo_log_follow_thread(
720/*=======================*/
721 void* arg); /*!< in: a dummy parameter required by
722 os_thread_create */
723/******************************************************************//**
697Outputs to a file the output of the InnoDB Monitor.724Outputs to a file the output of the InnoDB Monitor.
698@return FALSE if not all information printed725@return FALSE if not all information printed
699due to failure to obtain necessary mutex */726due to failure to obtain necessary mutex */
700727
=== added file 'Percona-Server/storage/innobase/include/ut0rbt.h.OTHER'
--- Percona-Server/storage/innobase/include/ut0rbt.h.OTHER 1970-01-01 00:00:00 +0000
+++ Percona-Server/storage/innobase/include/ut0rbt.h.OTHER 2012-08-15 14:13:50 +0000
@@ -0,0 +1,332 @@
1/*****************************************************************************
2Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
3
4This program is free software; you can redistribute it and/or modify it under
5the terms of the GNU General Public License as published by the Free Software
6Foundation; version 2 of the License.
7
8This program is distributed in the hope that it will be useful, but WITHOUT
9ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
11
12You should have received a copy of the GNU General Public License along with
13this program; if not, write to the Free Software Foundation, Inc., 59 Temple
14Place, Suite 330, Boston, MA 02111-1307 USA
15
16*****************************************************************************/
17
18/*******************************************************************//**
19@file include/ut0rbt.h
20Red-Black tree implementation.
21
22Created 2007-03-20 Sunny Bains
23************************************************************************/
24
25#ifndef INNOBASE_UT0RBT_H
26#define INNOBASE_UT0RBT_H
27
28#if !defined(IB_RBT_TESTING)
29#include "univ.i"
30#include "ut0mem.h"
31#else
32#include <stdio.h>
33#include <stdlib.h>
34#include <string.h>
35#include <assert.h>
36
37#define ut_malloc malloc
38#define ut_free free
39#define ulint unsigned long
40#define ut_a(c) assert(c)
41#define ut_error assert(0)
42#define ibool unsigned int
43#define TRUE 1
44#define FALSE 0
45#endif
46
47/* Red black tree typedefs */
48typedef struct ib_rbt_struct ib_rbt_t;
49typedef struct ib_rbt_node_struct ib_rbt_node_t;
50/* FIXME: Iterator is a better name than _bound_ */
51typedef struct ib_rbt_bound_struct ib_rbt_bound_t;
52typedef void (*ib_rbt_print_node)(const ib_rbt_node_t* node);
53typedef int (*ib_rbt_compare)(const void* p1, const void* p2);
54
55/* Red black tree color types */
56enum ib_rbt_color_enum {
57 IB_RBT_RED,
58 IB_RBT_BLACK
59};
60
61typedef enum ib_rbt_color_enum ib_rbt_color_t;
62
63/* Red black tree node */
64struct ib_rbt_node_struct {
65 ib_rbt_color_t color; /* color of this node */
66
67 ib_rbt_node_t* left; /* points left child */
68 ib_rbt_node_t* right; /* points right child */
69 ib_rbt_node_t* parent; /* points parent node */
70
71 char value[1]; /* Data value */
72};
73
74/* Red black tree instance.*/
75struct ib_rbt_struct {
76 ib_rbt_node_t* nil; /* Black colored node that is
77 used as a sentinel. This is
78 pre-allocated too.*/
79
80 ib_rbt_node_t* root; /* Root of the tree, this is
81 pre-allocated and the first
82 data node is the left child.*/
83
84 ulint n_nodes; /* Total number of data nodes */
85
86 ib_rbt_compare compare; /* Fn. to use for comparison */
87 ulint sizeof_value; /* Sizeof the item in bytes */
88};
89
90/* The result of searching for a key in the tree, this is useful for
91a speedy lookup and insert if key doesn't exist.*/
92struct ib_rbt_bound_struct {
93 const ib_rbt_node_t*
94 last; /* Last node visited */
95
96 int result; /* Result of comparing with
97 the last non-nil node that
98 was visited */
99};
100
101/* Size in elements (t is an rb tree instance) */
102#define rbt_size(t) (t->n_nodes)
103
104/* Check whether the rb tree is empty (t is an rb tree instance) */
105#define rbt_empty(t) (rbt_size(t) == 0)
106
107/* Get data value (t is the data type, n is an rb tree node instance) */
108#define rbt_value(t, n) ((t*) &n->value[0])
109
110/* Compare a key with the node value (t is tree, k is key, n is node)*/
111#define rbt_compare(t, k, n) (t->compare(k, n->value))
112
113/* Node size. FIXME: name might clash, but currently it does not, so for easier
114maintenance do not rename it for now. */
115#define SIZEOF_NODE(t) ((sizeof(ib_rbt_node_t) + t->sizeof_value) - 1)
116
117/****************************************************************//**
118Free an instance of a red black tree */
119UNIV_INTERN
120void
121rbt_free(
122/*=====*/
123 ib_rbt_t* tree); /*!< in: rb tree to free */
124/****************************************************************//**
125Create an instance of a red black tree
126@return rb tree instance */
127UNIV_INTERN
128ib_rbt_t*
129rbt_create(
130/*=======*/
131 size_t sizeof_value, /*!< in: size in bytes */
132 ib_rbt_compare compare); /*!< in: comparator */
133/****************************************************************//**
134Delete a node from the red black tree, identified by key.
135@return TRUE if success FALSE if not found */
136UNIV_INTERN
137ibool
138rbt_delete(
139/*=======*/
140 ib_rbt_t* tree, /*!< in: rb tree */
141 const void* key); /*!< in: key to delete */
142/****************************************************************//**
143Remove a node from the rb tree, the node is not free'd, that is the
144callers responsibility.
145@return the deleted node with the const. */
146UNIV_INTERN
147ib_rbt_node_t*
148rbt_remove_node(
149/*============*/
150 ib_rbt_t* tree, /*!< in: rb tree */
151 const ib_rbt_node_t*
152 node); /*!< in: node to delete, this
153 is a fudge and declared const
154 because the caller has access
155 only to const nodes.*/
156/****************************************************************//**
157Find a matching node in the rb tree.
158@return node if found else return NULL */
159UNIV_INTERN
160const ib_rbt_node_t*
161rbt_lookup(
162/*=======*/
163 const ib_rbt_t* tree, /*!< in: rb tree to search */
164 const void* key); /*!< in: key to lookup */
165/****************************************************************//**
166Generic insert of a value in the rb tree.
167@return inserted node */
168UNIV_INTERN
169const ib_rbt_node_t*
170rbt_insert(
171/*=======*/
172 ib_rbt_t* tree, /*!< in: rb tree */
173 const void* key, /*!< in: key for ordering */
174 const void* value); /*!< in: data that will be
175 copied to the node.*/
176/****************************************************************//**
177Add a new node to the tree, useful for data that is pre-sorted.
178@return appended node */
179UNIV_INTERN
180const ib_rbt_node_t*
181rbt_add_node(
182/*=========*/
183 ib_rbt_t* tree, /*!< in: rb tree */
184 ib_rbt_bound_t* parent, /*!< in: parent */
185 const void* value); /*!< in: this value is copied
186 to the node */
187/****************************************************************//**
188Add a new caller-provided node to tree at the specified position.
189The node must have its key fields initialized correctly.
190@return added node */
191UNIV_INTERN
192const ib_rbt_node_t*
193rbt_add_preallocated_node(
194/*======================*/
195 ib_rbt_t* tree, /*!< in: rb tree */
196 ib_rbt_bound_t* parent, /*!< in: parent */
197 ib_rbt_node_t* node); /*!< in: node */
198
199/****************************************************************//**
200Return the left most data node in the tree
201@return left most node */
202UNIV_INTERN
203const ib_rbt_node_t*
204rbt_first(
205/*======*/
206 const ib_rbt_t* tree); /*!< in: rb tree */
207/****************************************************************//**
208Return the right most data node in the tree
209@return right most node */
210UNIV_INTERN
211const ib_rbt_node_t*
212rbt_last(
213/*=====*/
214 const ib_rbt_t* tree); /*!< in: rb tree */
215/****************************************************************//**
216Return the next node from current.
217@return successor node to current that is passed in. */
218UNIV_INTERN
219const ib_rbt_node_t*
220rbt_next(
221/*=====*/
222 const ib_rbt_t* tree, /*!< in: rb tree */
223 const ib_rbt_node_t* /*!< in: current node */
224 current);
225/****************************************************************//**
226Return the prev node from current.
227@return precedessor node to current that is passed in */
228UNIV_INTERN
229const ib_rbt_node_t*
230rbt_prev(
231/*=====*/
232 const ib_rbt_t* tree, /*!< in: rb tree */
233 const ib_rbt_node_t* /*!< in: current node */
234 current);
235/****************************************************************//**
236Find the node that has the lowest key that is >= key.
237@return node that satisfies the lower bound constraint or NULL */
238UNIV_INTERN
239const ib_rbt_node_t*
240rbt_lower_bound(
241/*============*/
242 const ib_rbt_t* tree, /*!< in: rb tree */
243 const void* key); /*!< in: key to search */
244/****************************************************************//**
245Find the node that has the greatest key that is <= key.
246@return node that satisifies the upper bound constraint or NULL */
247UNIV_INTERN
248const ib_rbt_node_t*
249rbt_upper_bound(
250/*============*/
251 const ib_rbt_t* tree, /*!< in: rb tree */
252 const void* key); /*!< in: key to search */
253/****************************************************************//**
254Search for the key, a node will be retuned in parent.last, whether it
255was found or not. If not found then parent.last will contain the
256parent node for the possibly new key otherwise the matching node.
257@return result of last comparison */
258UNIV_INTERN
259int
260rbt_search(
261/*=======*/
262 const ib_rbt_t* tree, /*!< in: rb tree */
263 ib_rbt_bound_t* parent, /*!< in: search bounds */
264 const void* key); /*!< in: key to search */
265/****************************************************************//**
266Search for the key, a node will be retuned in parent.last, whether it
267was found or not. If not found then parent.last will contain the
268parent node for the possibly new key otherwise the matching node.
269@return result of last comparison */
270UNIV_INTERN
271int
272rbt_search_cmp(
273/*===========*/
274 const ib_rbt_t* tree, /*!< in: rb tree */
275 ib_rbt_bound_t* parent, /*!< in: search bounds */
276 const void* key, /*!< in: key to search */
277 ib_rbt_compare compare); /*!< in: comparator */
278/****************************************************************//**
279Clear the tree, deletes (and free's) all the nodes. */
280UNIV_INTERN
281void
282rbt_clear(
283/*======*/
284 ib_rbt_t* tree); /*!< in: rb tree */
285/****************************************************************//**
286Clear the tree without deleting and freeing its nodes. */
287UNIV_INTERN
288void
289rbt_reset(
290/*======*/
291 ib_rbt_t* tree); /*!< in: rb tree */
292/****************************************************************//**
293Merge the node from dst into src. Return the number of nodes merged.
294@return no. of recs merged */
295UNIV_INTERN
296ulint
297rbt_merge_uniq(
298/*===========*/
299 ib_rbt_t* dst, /*!< in: dst rb tree */
300 const ib_rbt_t* src); /*!< in: src rb tree */
301/****************************************************************//**
302Merge the node from dst into src. Return the number of nodes merged.
303Delete the nodes from src after copying node to dst. As a side effect
304the duplicates will be left untouched in the src, since we don't support
305duplicates (yet). NOTE: src and dst must be similar, the function doesn't
306check for this condition (yet).
307@return no. of recs merged */
308UNIV_INTERN
309ulint
310rbt_merge_uniq_destructive(
311/*=======================*/
312 ib_rbt_t* dst, /*!< in: dst rb tree */
313 ib_rbt_t* src); /*!< in: src rb tree */
314/****************************************************************//**
315Verify the integrity of the RB tree. For debugging. 0 failure else height
316of tree (in count of black nodes).
317@return TRUE if OK FALSE if tree invalid. */
318UNIV_INTERN
319ibool
320rbt_validate(
321/*=========*/
322 const ib_rbt_t* tree); /*!< in: tree to validate */
323/****************************************************************//**
324Iterate over the tree in depth first order. */
325UNIV_INTERN
326void
327rbt_print(
328/*======*/
329 const ib_rbt_t* tree, /*!< in: tree to traverse */
330 ib_rbt_print_node print); /*!< in: print function */
331
332#endif /* INNOBASE_UT0RBT_H */
0333
=== modified file 'Percona-Server/storage/innobase/log/log0log.c'
--- Percona-Server/storage/innobase/log/log0log.c 2012-05-10 07:49:14 +0000
+++ Percona-Server/storage/innobase/log/log0log.c 2012-08-15 14:13:50 +0000
@@ -214,6 +214,54 @@
214 return(lsn);214 return(lsn);
215}215}
216216
217/****************************************************************//**
218Safely reads the log_sys->tracked_lsn value. Uses atomic operations
219if available, otherwise this field is protected with the log system
220mutex. The writer counterpart function is log_set_tracked_lsn() in
221log0online.c.
222
223@return log_sys->tracked_lsn value. */
224UNIV_INLINE
225ib_uint64_t
226log_get_tracked_lsn()
227{
228#ifdef HAVE_ATOMIC_BUILTINS_64
229 return os_atomic_increment_uint64(&log_sys->tracked_lsn, 0);
230#else
231 ut_ad(mutex_own(&(log_sys->mutex)));
232 return log_sys->tracked_lsn;
233#endif
234}
235
236/****************************************************************//**
237Checks if the log groups have a big enough margin of free space in
238so that a new log entry can be written without overwriting log data
239that is not read by the changed page bitmap thread.
240@return TRUE if there is not enough free space. */
241static
242ibool
243log_check_tracking_margin(
244 ulint lsn_advance) /*!< in: an upper limit on how much log data we
245 plan to write. If zero, the margin will be
246 checked for the already-written log. */
247{
248 ib_uint64_t tracked_lsn;
249 ulint tracked_lsn_age;
250
251 if (!srv_track_changed_pages) {
252 return FALSE;
253 }
254
255 ut_ad(mutex_own(&(log_sys->mutex)));
256
257 tracked_lsn = log_get_tracked_lsn();
258 tracked_lsn_age = log_sys->lsn - tracked_lsn;
259
260 /* The overwrite would happen when log_sys->log_group_capacity is
261 exceeded, but we use max_checkpoint_age for an extra safety margin. */
262 return tracked_lsn_age + lsn_advance > log_sys->max_checkpoint_age;
263}
264
217/************************************************************//**265/************************************************************//**
218Opens the log for log_write_low. The log must be closed with log_close and266Opens the log for log_write_low. The log must be closed with log_close and
219released with log_release.267released with log_release.
@@ -230,9 +278,7 @@
230 ulint archived_lsn_age;278 ulint archived_lsn_age;
231 ulint dummy;279 ulint dummy;
232#endif /* UNIV_LOG_ARCHIVE */280#endif /* UNIV_LOG_ARCHIVE */
233#ifdef UNIV_DEBUG
234 ulint count = 0;281 ulint count = 0;
235#endif /* UNIV_DEBUG */
236282
237 ut_a(len < log->buf_size / 2);283 ut_a(len < log->buf_size / 2);
238loop:284loop:
@@ -260,6 +306,19 @@
260 goto loop;306 goto loop;
261 }307 }
262308
309 if (log_check_tracking_margin(len_upper_limit) && (++count < 50)) {
310
311 /* This log write would violate the untracked LSN free space
312 margin. Limit this to 50 retries as there might be situations
313 where we have no choice but to proceed anyway, i.e. if the log
314 is about to be overflown, log tracking or not. */
315 mutex_exit(&(log->mutex));
316
317 os_thread_sleep(10000);
318
319 goto loop;
320 }
321
263#ifdef UNIV_LOG_ARCHIVE322#ifdef UNIV_LOG_ARCHIVE
264 if (log->archiving_state != LOG_ARCH_OFF) {323 if (log->archiving_state != LOG_ARCH_OFF) {
265324
@@ -398,6 +457,8 @@
398 ulint first_rec_group;457 ulint first_rec_group;
399 ib_uint64_t oldest_lsn;458 ib_uint64_t oldest_lsn;
400 ib_uint64_t lsn;459 ib_uint64_t lsn;
460 ib_uint64_t tracked_lsn;
461 ulint tracked_lsn_age;
401 log_t* log = log_sys;462 log_t* log = log_sys;
402 ib_uint64_t checkpoint_age;463 ib_uint64_t checkpoint_age;
403464
@@ -424,6 +485,19 @@
424 log->check_flush_or_checkpoint = TRUE;485 log->check_flush_or_checkpoint = TRUE;
425 }486 }
426487
488 if (srv_track_changed_pages) {
489
490 tracked_lsn = log_get_tracked_lsn();
491 tracked_lsn_age = lsn - tracked_lsn;
492
493 if (tracked_lsn_age >= log->log_group_capacity) {
494
495 fprintf(stderr, " InnoDB: Error: the age of the "
496 "oldest untracked record exceeds the log "
497 "group capacity!\n");
498 }
499 }
500
427 checkpoint_age = lsn - log->last_checkpoint_lsn;501 checkpoint_age = lsn - log->last_checkpoint_lsn;
428502
429 if (checkpoint_age >= log->log_group_capacity) {503 if (checkpoint_age >= log->log_group_capacity) {
@@ -891,6 +965,8 @@
891 log_sys->archiving_on = os_event_create(NULL);965 log_sys->archiving_on = os_event_create(NULL);
892#endif /* UNIV_LOG_ARCHIVE */966#endif /* UNIV_LOG_ARCHIVE */
893967
968 log_sys->tracked_lsn = 0;
969
894 /*----------------------------*/970 /*----------------------------*/
895971
896 log_block_init(log_sys->buf, log_sys->lsn);972 log_block_init(log_sys->buf, log_sys->lsn);
@@ -1740,6 +1816,12 @@
1740 }1816 }
17411817
1742 mutex_exit(&(log_sys->mutex));1818 mutex_exit(&(log_sys->mutex));
1819
1820 /* Wake the redo log watching thread to parse the log up to this
1821 checkpoint. */
1822 if (srv_track_changed_pages) {
1823 os_event_set(srv_checkpoint_completed_event);
1824 }
1743}1825}
17441826
1745/*******************************************************************//**1827/*******************************************************************//**
@@ -3086,6 +3168,15 @@
30863168
3087 log_checkpoint_margin();3169 log_checkpoint_margin();
30883170
3171 mutex_enter(&(log_sys->mutex));
3172 if (log_check_tracking_margin(0)) {
3173
3174 mutex_exit(&(log_sys->mutex));
3175 os_thread_sleep(10000);
3176 goto loop;
3177 }
3178 mutex_exit(&(log_sys->mutex));
3179
3089#ifdef UNIV_LOG_ARCHIVE3180#ifdef UNIV_LOG_ARCHIVE
3090 log_archive_margin();3181 log_archive_margin();
3091#endif /* UNIV_LOG_ARCHIVE */3182#endif /* UNIV_LOG_ARCHIVE */
@@ -3113,12 +3204,18 @@
3113logs_empty_and_mark_files_at_shutdown(void)3204logs_empty_and_mark_files_at_shutdown(void)
3114/*=======================================*/3205/*=======================================*/
3115{3206{
3207<<<<<<< TREE
3116 ib_uint64_t lsn;3208 ib_uint64_t lsn;
3117 ulint arch_log_no;3209 ulint arch_log_no;
3118 ibool server_busy;3210 ibool server_busy;
3119 ulint count = 0;3211 ulint count = 0;
3120 ulint pending_io;3212 ulint pending_io;
3121 ulint active_thd;3213 ulint active_thd;
3214=======
3215 ib_uint64_t lsn;
3216 ib_uint64_t tracked_lsn;
3217 ulint arch_log_no;
3218>>>>>>> MERGE-SOURCE
31223219
3123 if (srv_print_verbose_log) {3220 if (srv_print_verbose_log) {
3124 ut_print_timestamp(stderr);3221 ut_print_timestamp(stderr);
@@ -3308,9 +3405,12 @@
33083405
3309 mutex_enter(&log_sys->mutex);3406 mutex_enter(&log_sys->mutex);
33103407
3408 tracked_lsn = log_get_tracked_lsn();
3409
3311 lsn = log_sys->lsn;3410 lsn = log_sys->lsn;
33123411
3313 if (lsn != log_sys->last_checkpoint_lsn3412 if (lsn != log_sys->last_checkpoint_lsn
3413 || (srv_track_changed_pages && (tracked_lsn != log_sys->last_checkpoint_lsn))
3314#ifdef UNIV_LOG_ARCHIVE3414#ifdef UNIV_LOG_ARCHIVE
3315 || (srv_log_archive_on3415 || (srv_log_archive_on
3316 && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE)3416 && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE)
@@ -3368,6 +3468,11 @@
33683468
3369 srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE;3469 srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE;
33703470
3471 /* Signal the log following thread to quit */
3472 if (srv_track_changed_pages) {
3473 os_event_set(srv_checkpoint_completed_event);
3474 }
3475
3371 /* Make some checks that the server really is quiet */3476 /* Make some checks that the server really is quiet */
3372 ut_a(srv_get_active_thread_type() == ULINT_UNDEFINED);3477 ut_a(srv_get_active_thread_type() == ULINT_UNDEFINED);
33733478
@@ -3388,6 +3493,10 @@
33883493
3389 fil_flush_file_spaces(FIL_TABLESPACE);3494 fil_flush_file_spaces(FIL_TABLESPACE);
33903495
3496 if (srv_track_changed_pages) {
3497 os_event_wait(srv_redo_log_thread_finished_event);
3498 }
3499
3391 fil_close_all_files();3500 fil_close_all_files();
33923501
3393 /* Make some checks that the server really is quiet */3502 /* Make some checks that the server really is quiet */
@@ -3514,6 +3623,18 @@
3514 ((log_sys->n_log_ios - log_sys->n_log_ios_old)3623 ((log_sys->n_log_ios - log_sys->n_log_ios_old)
3515 / time_elapsed));3624 / time_elapsed));
35163625
3626 if (srv_track_changed_pages) {
3627
3628 /* The maximum tracked LSN age is equal to the maximum
3629 checkpoint age */
3630 fprintf(file,
3631 "Log tracking enabled\n"
3632 "Log tracked up to %llu\n"
3633 "Max tracked LSN age %lu\n",
3634 log_get_tracked_lsn(),
3635 log_sys->max_checkpoint_age);
3636 }
3637
3517 log_sys->n_log_ios_old = log_sys->n_log_ios;3638 log_sys->n_log_ios_old = log_sys->n_log_ios;
3518 log_sys->last_printout_time = current_time;3639 log_sys->last_printout_time = current_time;
35193640
35203641
=== added file 'Percona-Server/storage/innobase/log/log0online.c'
--- Percona-Server/storage/innobase/log/log0online.c 1970-01-01 00:00:00 +0000
+++ Percona-Server/storage/innobase/log/log0online.c 2012-08-15 14:13:50 +0000
@@ -0,0 +1,1083 @@
1/*****************************************************************************
2
3Copyright (c) 2011-2012 Percona Inc. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15Place, Suite 330, Boston, MA 02111-1307 USA
16
17*****************************************************************************/
18
19/**************************************************//**
20@file log/log0online.c
21Online database log parsing for changed page tracking
22
23*******************************************************/
24
25#include "log0online.h"
26
27#include "my_dbug.h"
28
29#include "log0recv.h"
30#include "mach0data.h"
31#include "mtr0log.h"
32#include "srv0srv.h"
33#include "srv0start.h"
34#include "trx0sys.h"
35#include "ut0rbt.h"
36
37enum { FOLLOW_SCAN_SIZE = 4 * (UNIV_PAGE_SIZE_MAX) };
38
39/** Log parsing and bitmap output data structure */
40struct log_bitmap_struct {
41 byte read_buf[FOLLOW_SCAN_SIZE];
42 /*!< log read buffer */
43 byte parse_buf[RECV_PARSING_BUF_SIZE];
44 /*!< log parse buffer */
45 byte* parse_buf_end; /*!< parse buffer position where the
46 next read log data should be copied to.
47 If the previous log records were fully
48 parsed, it points to the start,
49 otherwise points immediatelly past the
50 end of the incomplete log record. */
51 char* out_name; /*!< the file name for bitmap output */
52 os_file_t out; /*!< the bitmap output file */
53 ib_uint64_t out_offset; /*!< the next write position in the
54 bitmap output file */
55 ib_uint64_t start_lsn; /*!< the LSN of the next unparsed
56 record and the start of the next LSN
57 interval to be parsed. */
58 ib_uint64_t end_lsn; /*!< the end of the LSN interval to be
59 parsed, equal to the next checkpoint
60 LSN at the time of parse */
61 ib_uint64_t next_parse_lsn; /*!< the LSN of the next unparsed
62 record in the current parse */
63 ib_rbt_t* modified_pages; /*!< the current modified page set,
64 organized as the RB-tree with the keys
65 of (space, 4KB-block-start-page-id)
66 pairs */
67 ib_rbt_node_t* page_free_list; /*!< Singly-linked list of freed nodes
68 of modified_pages tree for later
69 reuse. Nodes are linked through
70 ib_rbt_node_t.left as this field has
71 both the correct type and the tree does
72 not mind its overwrite during
73 rbt_next() tree traversal. */
74};
75
76/* The log parsing and bitmap output struct instance */
77static struct log_bitmap_struct* log_bmp_sys;
78
79/* File name stem for modified page bitmaps */
80static const char* modified_page_stem = "ib_modified_log.";
81
82/* On server startup with empty database srv_start_lsn == 0, in
83which case the first LSN of actual log records will be this. */
84#define MIN_TRACKED_LSN ((LOG_START_LSN) + (LOG_BLOCK_HDR_SIZE))
85
86/* Tests if num bit of bitmap is set */
87#define IS_BIT_SET(bitmap, num) \
88 (*((bitmap) + ((num) >> 3)) & (1UL << ((num) & 7UL)))
89
90/** The bitmap file block size in bytes. All writes will be multiples of this.
91 */
92enum {
93 MODIFIED_PAGE_BLOCK_SIZE = 4096
94};
95
96
97/** Offsets in a file bitmap block */
98enum {
99 MODIFIED_PAGE_IS_LAST_BLOCK = 0,/* 1 if last block in the current
100 write, 0 otherwise. */
101 MODIFIED_PAGE_START_LSN = 4, /* The starting tracked LSN of this and
102 other blocks in the same write */
103 MODIFIED_PAGE_END_LSN = 12, /* The ending tracked LSN of this and
104 other blocks in the same write */
105 MODIFIED_PAGE_SPACE_ID = 20, /* The space ID of tracked pages in
106 this block */
107 MODIFIED_PAGE_1ST_PAGE_ID = 24, /* The page ID of the first tracked
108 page in this block */
109 MODIFIED_PAGE_BLOCK_UNUSED_1 = 28,/* Unused in order to align the start
110 of bitmap at 8 byte boundary */
111 MODIFIED_PAGE_BLOCK_BITMAP = 32,/* Start of the bitmap itself */
112 MODIFIED_PAGE_BLOCK_UNUSED_2 = MODIFIED_PAGE_BLOCK_SIZE - 8,
113 /* Unused in order to align the end of
114 bitmap at 8 byte boundary */
115 MODIFIED_PAGE_BLOCK_CHECKSUM = MODIFIED_PAGE_BLOCK_SIZE - 4
116 /* The checksum of the current block */
117};
118
119/** Length of the bitmap data in a block */
120enum { MODIFIED_PAGE_BLOCK_BITMAP_LEN
121 = MODIFIED_PAGE_BLOCK_UNUSED_2 - MODIFIED_PAGE_BLOCK_BITMAP };
122
123
124/****************************************************************//**
125Provide a comparisson function for the RB-tree tree (space,
126block_start_page) pairs. Actual implementation does not matter as
127long as the ordering is full.
128@return -1 if p1 < p2, 0 if p1 == p2, 1 if p1 > p2
129*/
130static
131int
132log_online_compare_bmp_keys(
133/*========================*/
134 const void* p1, /*!<in: 1st key to compare */
135 const void* p2) /*!<in: 2nd key to compare */
136{
137 const byte *k1 = (const byte *)p1;
138 const byte *k2 = (const byte *)p2;
139
140 ulint k1_space = mach_read_from_4(k1 + MODIFIED_PAGE_SPACE_ID);
141 ulint k2_space = mach_read_from_4(k2 + MODIFIED_PAGE_SPACE_ID);
142 if (k1_space == k2_space) {
143 ulint k1_start_page
144 = mach_read_from_4(k1 + MODIFIED_PAGE_1ST_PAGE_ID);
145 ulint k2_start_page
146 = mach_read_from_4(k2 + MODIFIED_PAGE_1ST_PAGE_ID);
147 return k1_start_page < k2_start_page
148 ? -1 : k1_start_page > k2_start_page ? 1 : 0;
149 }
150 return k1_space < k2_space ? -1 : 1;
151}
152
153/****************************************************************//**
154Set a bit for tracked page in the bitmap. Expand the bitmap tree as
155necessary. */
156static
157void
158log_online_set_page_bit(
159/*====================*/
160 ulint space, /*!<in: log record space id */
161 ulint page_no)/*!<in: log record page id */
162{
163 ulint block_start_page;
164 ulint block_pos;
165 uint bit_pos;
166 ib_rbt_bound_t tree_search_pos;
167 byte search_page[MODIFIED_PAGE_BLOCK_SIZE];
168 byte *page_ptr;
169
170 ut_a(space != ULINT_UNDEFINED);
171 ut_a(page_no != ULINT_UNDEFINED);
172
173 block_start_page = page_no / (8 * MODIFIED_PAGE_BLOCK_BITMAP_LEN)
174 * MODIFIED_PAGE_BLOCK_BITMAP_LEN;
175 block_pos = block_start_page ? (page_no % block_start_page / 8)
176 : (page_no / 8);
177 bit_pos = page_no % 8;
178
179 mach_write_to_4(search_page + MODIFIED_PAGE_SPACE_ID, space);
180 mach_write_to_4(search_page + MODIFIED_PAGE_1ST_PAGE_ID,
181 block_start_page);
182
183 if (!rbt_search(log_bmp_sys->modified_pages, &tree_search_pos,
184 search_page)) {
185 page_ptr = rbt_value(byte, tree_search_pos.last);
186 }
187 else {
188 ib_rbt_node_t *new_node;
189
190 if (log_bmp_sys->page_free_list) {
191 new_node = log_bmp_sys->page_free_list;
192 log_bmp_sys->page_free_list = new_node->left;
193 }
194 else {
195 new_node = ut_malloc(SIZEOF_NODE(
196 log_bmp_sys->modified_pages));
197 }
198 memset(new_node, 0, SIZEOF_NODE(log_bmp_sys->modified_pages));
199
200 page_ptr = rbt_value(byte, new_node);
201 mach_write_to_4(page_ptr + MODIFIED_PAGE_SPACE_ID, space);
202 mach_write_to_4(page_ptr + MODIFIED_PAGE_1ST_PAGE_ID,
203 block_start_page);
204
205 rbt_add_preallocated_node(log_bmp_sys->modified_pages,
206 &tree_search_pos, new_node);
207 }
208 page_ptr[MODIFIED_PAGE_BLOCK_BITMAP + block_pos] |= (1U << bit_pos);
209}
210
211/****************************************************************//**
212Calculate a bitmap block checksum. Algorithm borrowed from
213log_block_calc_checksum.
214@return checksum */
215UNIV_INLINE
216ulint
217log_online_calc_checksum(
218/*=====================*/
219 const byte* block) /*!<in: bitmap block */
220{
221 ulint sum;
222 ulint sh;
223 ulint i;
224
225 sum = 1;
226 sh = 0;
227
228 for (i = 0; i < MODIFIED_PAGE_BLOCK_CHECKSUM; i++) {
229
230 ulint b = block[i];
231 sum &= 0x7FFFFFFFUL;
232 sum += b;
233 sum += b << sh;
234 sh++;
235 if (sh > 24) {
236 sh = 0;
237 }
238 }
239
240 return sum;
241}
242
243/****************************************************************//**
244Get the last tracked fully LSN from the bitmap file by reading
245backwards untile a correct end page is found. Detects incomplete
246writes and corrupted data. Sets the start output position for the
247written bitmap data.
248@return the last fully tracked LSN */
249static
250ib_uint64_t
251log_online_read_last_tracked_lsn()
252/*==============================*/
253{
254 byte page[MODIFIED_PAGE_BLOCK_SIZE];
255 ib_uint64_t read_offset = log_bmp_sys->out_offset;
256 /* Initialize these to nonequal values so that file size == 0 case with
257 zero loop repetitions is handled correctly */
258 ulint checksum = 0;
259 ulint actual_checksum = !checksum;
260 ibool is_last_page = FALSE;
261 ib_uint64_t result;
262
263 ut_ad(log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE == 0);
264
265 while (checksum != actual_checksum && read_offset > 0 && !is_last_page)
266 {
267
268 ulint offset_low, offset_high;
269 ibool success;
270
271 read_offset -= MODIFIED_PAGE_BLOCK_SIZE;
272 offset_high = (ulint)(read_offset >> 32);
273 offset_low = (ulint)(read_offset & 0xFFFFFFFF);
274
275 success = os_file_read(log_bmp_sys->out, page, offset_low,
276 offset_high, MODIFIED_PAGE_BLOCK_SIZE);
277 if (!success) {
278
279 /* The following call prints an error message */
280 os_file_get_last_error(TRUE);
281 /* Here and below assume that bitmap file names do not
282 contain apostrophes, thus no need for
283 ut_print_filename(). */
284 fprintf(stderr, "InnoDB: Warning: failed reading "
285 "changed page bitmap file \'%s\'\n",
286 log_bmp_sys->out_name);
287 return MIN_TRACKED_LSN;
288 }
289
290 is_last_page
291 = mach_read_from_4(page + MODIFIED_PAGE_IS_LAST_BLOCK);
292 checksum = mach_read_from_4(page
293 + MODIFIED_PAGE_BLOCK_CHECKSUM);
294 actual_checksum = log_online_calc_checksum(page);
295 if (checksum != actual_checksum) {
296
297 fprintf(stderr, "InnoDB: Warning: corruption "
298 "detected in \'%s\' at offset %llu\n",
299 log_bmp_sys->out_name, read_offset);
300 }
301
302 };
303
304 if (UNIV_LIKELY(checksum == actual_checksum && is_last_page)) {
305
306 log_bmp_sys->out_offset = read_offset
307 + MODIFIED_PAGE_BLOCK_SIZE;
308 result = mach_read_ull(page + MODIFIED_PAGE_END_LSN);
309 }
310 else {
311 log_bmp_sys->out_offset = read_offset;
312 result = 0;
313 }
314
315 /* Truncate the output file to discard the corrupted bitmap data, if
316 any */
317 if (!os_file_set_eof_at(log_bmp_sys->out,
318 log_bmp_sys->out_offset)) {
319 fprintf(stderr, "InnoDB: Warning: failed truncating "
320 "changed page bitmap file \'%s\' to %llu bytes\n",
321 log_bmp_sys->out_name, log_bmp_sys->out_offset);
322 result = 0;
323 }
324 return result;
325}
326
327/****************************************************************//**
328Safely write the log_sys->tracked_lsn value. Uses atomic operations
329if available, otherwise this field is protected with the log system
330mutex. The reader counterpart function is log_get_tracked_lsn() in
331log0log.c. */
332UNIV_INLINE
333void
334log_set_tracked_lsn(
335/*================*/
336 ib_uint64_t tracked_lsn) /*!<in: new value */
337{
338#ifdef HAVE_ATOMIC_BUILTINS_64
339 /* Single writer, no data race here */
340 ib_uint64_t old_value
341 = os_atomic_increment_uint64(&log_sys->tracked_lsn, 0);
342 os_atomic_increment_uint64(&log_sys->tracked_lsn,
343 tracked_lsn - old_value);
344#else
345 mutex_enter(&log_sys->mutex);
346 log_sys->tracked_lsn = tracked_lsn;
347 mutex_exit(&log_sys->mutex);
348#endif
349}
350
351/****************************************************************//**
352Diagnose a gap in tracked LSN range on server startup due to crash or
353very fast shutdown and try to close it by tracking the data
354immediatelly, if possible. */
355static
356void
357log_online_track_missing_on_startup(
358/*================================*/
359 ib_uint64_t last_tracked_lsn, /*!<in: last tracked LSN read
360 from the bitmap file */
361 ib_uint64_t tracking_start_lsn) /*!<in: last checkpoint LSN of
362 the current server startup */
363{
364 ut_ad(last_tracked_lsn != tracking_start_lsn);
365
366 fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' is %llu, but "
367 "last checkpoint LSN is %llu. This might be due to a server "
368 "crash or a very fast shutdown. ", log_bmp_sys->out_name,
369 last_tracked_lsn, tracking_start_lsn);
370
371 /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
372 bitmap file, handle this too. */
373 last_tracked_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN);
374
375 /* See if we can fully recover the missing interval */
376 if (log_sys->lsn - last_tracked_lsn < log_sys->log_group_capacity) {
377
378 fprintf(stderr,
379 "Reading the log to advance the last tracked LSN.\n");
380
381 log_bmp_sys->start_lsn = last_tracked_lsn;
382 log_set_tracked_lsn(log_bmp_sys->start_lsn);
383 log_online_follow_redo_log();
384 ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn);
385
386 fprintf(stderr,
387 "InnoDB: continuing tracking changed pages from LSN "
388 "%llu\n", log_bmp_sys->end_lsn);
389 }
390 else {
391 fprintf(stderr,
392 "The age of last tracked LSN exceeds log capacity, "
393 "tracking-based incremental backups will work only "
394 "from the higher LSN!\n");
395
396 log_bmp_sys->end_lsn = log_bmp_sys->start_lsn
397 = tracking_start_lsn;
398 log_set_tracked_lsn(log_bmp_sys->start_lsn);
399
400 fprintf(stderr,
401 "InnoDB: starting tracking changed pages from LSN "
402 "%llu\n", log_bmp_sys->end_lsn);
403 }
404}
405
406/*********************************************************************//**
407Initialize the online log following subsytem. */
408UNIV_INTERN
409void
410log_online_read_init()
411/*==================*/
412{
413 char buf[FN_REFLEN];
414 ibool success;
415 ib_uint64_t tracking_start_lsn
416 = ut_max(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
417
418 /* Assert (could be compile-time assert) that bitmap data start and end
419 in a bitmap block is 8-byte aligned */
420 ut_a(MODIFIED_PAGE_BLOCK_BITMAP % 8 == 0);
421 ut_a(MODIFIED_PAGE_BLOCK_BITMAP_LEN % 8 == 0);
422
423 log_bmp_sys = ut_malloc(sizeof(*log_bmp_sys));
424
425 ut_snprintf(buf, FN_REFLEN, "%s%s%d", srv_data_home,
426 modified_page_stem, 1);
427 log_bmp_sys->out_name = ut_malloc(strlen(buf) + 1);
428 ut_strcpy(log_bmp_sys->out_name, buf);
429
430 log_bmp_sys->modified_pages = rbt_create(MODIFIED_PAGE_BLOCK_SIZE,
431 log_online_compare_bmp_keys);
432 log_bmp_sys->page_free_list = NULL;
433
434 log_bmp_sys->out
435 = os_file_create_simple_no_error_handling
436 (log_bmp_sys->out_name, OS_FILE_OPEN, OS_FILE_READ_WRITE,
437 &success);
438
439 if (!success) {
440
441 /* New file, tracking from scratch */
442 log_bmp_sys->out
443 = os_file_create_simple_no_error_handling
444 (log_bmp_sys->out_name, OS_FILE_CREATE,
445 OS_FILE_READ_WRITE, &success);
446 if (!success) {
447
448 /* The following call prints an error message */
449 os_file_get_last_error(TRUE);
450 fprintf(stderr,
451 "InnoDB: Error: Cannot create \'%s\'\n",
452 log_bmp_sys->out_name);
453 exit(1);
454 }
455
456 log_bmp_sys->out_offset = 0;
457 }
458 else {
459
460 /* Old file, read last tracked LSN and continue from there */
461 ulint size_low;
462 ulint size_high;
463 ib_uint64_t last_tracked_lsn;
464
465 success = os_file_get_size(log_bmp_sys->out, &size_low,
466 &size_high);
467 ut_a(success);
468
469 log_bmp_sys->out_offset
470 = ((ib_uint64_t)size_high << 32) | size_low;
471
472 if (log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE != 0) {
473
474 fprintf(stderr,
475 "InnoDB: Warning: truncated block detected "
476 "in \'%s\' at offset %llu\n",
477 log_bmp_sys->out_name,
478 log_bmp_sys->out_offset);
479 log_bmp_sys->out_offset -=
480 log_bmp_sys->out_offset
481 % MODIFIED_PAGE_BLOCK_SIZE;
482 }
483
484 last_tracked_lsn = log_online_read_last_tracked_lsn();
485
486 if (last_tracked_lsn < tracking_start_lsn) {
487
488 log_online_track_missing_on_startup(last_tracked_lsn,
489 tracking_start_lsn);
490 return;
491 }
492
493 if (last_tracked_lsn > tracking_start_lsn) {
494
495 fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' "
496 "is %llu, but last checkpoint LSN is %llu. "
497 "The tracking-based incremental backups will "
498 "work only from the latter LSN!\n",
499 log_bmp_sys->out_name, last_tracked_lsn,
500 tracking_start_lsn);
501 }
502
503 }
504
505 fprintf(stderr, "InnoDB: starting tracking changed pages from "
506 "LSN %llu\n", tracking_start_lsn);
507 log_bmp_sys->start_lsn = tracking_start_lsn;
508 log_set_tracked_lsn(tracking_start_lsn);
509}
510
511/*********************************************************************//**
512Shut down the online log following subsystem. */
513UNIV_INTERN
514void
515log_online_read_shutdown()
516/*======================*/
517{
518 ib_rbt_node_t *free_list_node = log_bmp_sys->page_free_list;
519
520 os_file_close(log_bmp_sys->out);
521
522 rbt_free(log_bmp_sys->modified_pages);
523
524 while (free_list_node) {
525 ib_rbt_node_t *next = free_list_node->left;
526 ut_free(free_list_node);
527 free_list_node = next;
528 }
529
530 ut_free(log_bmp_sys->out_name);
531 ut_free(log_bmp_sys);
532}
533
534/*********************************************************************//**
535For the given minilog record type determine if the record has (space; page)
536associated with it.
537@return TRUE if the record has (space; page) in it */
538static
539ibool
540log_online_rec_has_page(
541/*====================*/
542 byte type) /*!<in: the minilog record type */
543{
544 return type != MLOG_MULTI_REC_END && type != MLOG_DUMMY_RECORD;
545}
546
547/*********************************************************************//**
548Check if a page field for a given log record type actually contains a page
549id. It does not for file operations and MLOG_LSN.
550@return TRUE if page field contains actual page id, FALSE otherwise */
551static
552ibool
553log_online_rec_page_means_page(
554/*===========================*/
555 byte type) /*!<in: log record type */
556{
557 return log_online_rec_has_page(type)
558#ifdef UNIV_LOG_LSN_DEBUG
559 && type != MLOG_LSN
560#endif
561 && type != MLOG_FILE_CREATE
562 && type != MLOG_FILE_RENAME
563 && type != MLOG_FILE_DELETE
564 && type != MLOG_FILE_CREATE2;
565}
566
567/*********************************************************************//**
568Parse the log data in the parse buffer for the (space, page) pairs and add
569them to the modified page set as necessary. Removes the fully-parsed records
570from the buffer. If an incomplete record is found, moves it to the end of the
571buffer. */
572static
573void
574log_online_parse_redo_log()
575/*=======================*/
576{
577 byte *ptr = log_bmp_sys->parse_buf;
578 byte *end = log_bmp_sys->parse_buf_end;
579
580 ulint len = 0;
581
582 while (ptr != end
583 && log_bmp_sys->next_parse_lsn < log_bmp_sys->end_lsn) {
584
585 byte type;
586 ulint space;
587 ulint page_no;
588 byte* body;
589
590 /* recv_sys is not initialized, so on corrupt log we will
591 SIGSEGV. But the log of a live database should not be
592 corrupt. */
593 len = recv_parse_log_rec(ptr, end, &type, &space, &page_no,
594 &body);
595 if (len > 0) {
596
597 if (log_online_rec_page_means_page(type)
598 && (space != TRX_DOUBLEWRITE_SPACE)) {
599
600 ut_a(len >= 3);
601 log_online_set_page_bit(space, page_no);
602 }
603
604 ptr += len;
605 ut_ad(ptr <= end);
606 log_bmp_sys->next_parse_lsn
607 = recv_calc_lsn_on_data_add
608 (log_bmp_sys->next_parse_lsn, len);
609 }
610 else {
611
612 /* Incomplete log record. Shift it to the
613 beginning of the parse buffer and leave it to be
614 completed on the next read. */
615 ut_memmove(log_bmp_sys->parse_buf, ptr, end - ptr);
616 log_bmp_sys->parse_buf_end
617 = log_bmp_sys->parse_buf + (end - ptr);
618 ptr = end;
619 }
620 }
621
622 if (len > 0) {
623
624 log_bmp_sys->parse_buf_end = log_bmp_sys->parse_buf;
625 }
626}
627
628/*********************************************************************//**
629Check the log block checksum.
630@return TRUE if the log block checksum is OK, FALSE otherwise. */
631static
632ibool
633log_online_is_valid_log_seg(
634/*========================*/
635 const byte* log_block) /*!< in: read log data */
636{
637 ibool checksum_is_ok
638 = log_block_checksum_is_ok_or_old_format(log_block);
639
640 if (!checksum_is_ok) {
641
642 fprintf(stderr,
643 "InnoDB Error: log block checksum mismatch"
644 "expected %lu, calculated checksum %lu\n",
645 (ulong) log_block_get_checksum(log_block),
646 (ulong) log_block_calc_checksum(log_block));
647 }
648
649 return checksum_is_ok;
650}
651
652/*********************************************************************//**
653Copy new log data to the parse buffer while skipping log block header,
654trailer and already parsed data. */
655static
656void
657log_online_add_to_parse_buf(
658/*========================*/
659 const byte* log_block, /*!< in: read log data */
660 ulint data_len, /*!< in: length of read log data */
661 ulint skip_len) /*!< in: how much of log data to
662 skip */
663{
664 ulint start_offset = skip_len ? skip_len : LOG_BLOCK_HDR_SIZE;
665 ulint end_offset
666 = (data_len == OS_FILE_LOG_BLOCK_SIZE)
667 ? data_len - LOG_BLOCK_TRL_SIZE
668 : data_len;
669 ulint actual_data_len = (end_offset >= start_offset)
670 ? end_offset - start_offset : 0;
671
672 ut_memcpy(log_bmp_sys->parse_buf_end, log_block + start_offset,
673 actual_data_len);
674
675 log_bmp_sys->parse_buf_end += actual_data_len;
676
677 ut_a(log_bmp_sys->parse_buf_end - log_bmp_sys->parse_buf
678 <= RECV_PARSING_BUF_SIZE);
679}
680
681/*********************************************************************//**
682Parse the log block: first copies the read log data to the parse buffer while
683skipping log block header, trailer and already parsed data. Then it actually
684parses the log to add to the modified page bitmap. */
685static
686void
687log_online_parse_redo_log_block(
688/*============================*/
689 const byte* log_block, /*!< in: read log data */
690 ulint skip_already_parsed_len) /*!< in: how many bytes of
691 log data should be skipped as
692 they were parsed before */
693{
694 ulint block_data_len;
695
696 block_data_len = log_block_get_data_len(log_block);
697
698 ut_ad(block_data_len % OS_FILE_LOG_BLOCK_SIZE == 0
699 || block_data_len < OS_FILE_LOG_BLOCK_SIZE);
700
701 log_online_add_to_parse_buf(log_block, block_data_len,
702 skip_already_parsed_len);
703 log_online_parse_redo_log();
704}
705
706/*********************************************************************//**
707Read and parse one redo log chunk and updates the modified page bitmap. */
708static
709void
710log_online_follow_log_seg(
711/*======================*/
712 log_group_t* group, /*!< in: the log group to use */
713 ib_uint64_t block_start_lsn, /*!< in: the LSN to read from */
714 ib_uint64_t block_end_lsn) /*!< in: the LSN to read to */
715{
716 /* Pointer to the current OS_FILE_LOG_BLOCK-sized chunk of the read log
717 data to parse */
718 byte* log_block = log_bmp_sys->read_buf;
719 byte* log_block_end = log_bmp_sys->read_buf
720 + (block_end_lsn - block_start_lsn);
721
722 mutex_enter(&log_sys->mutex);
723 log_group_read_log_seg(LOG_RECOVER, log_bmp_sys->read_buf,
724 group, block_start_lsn, block_end_lsn);
725 mutex_exit(&log_sys->mutex);
726
727 while (log_block < log_block_end
728 && log_bmp_sys->next_parse_lsn < log_bmp_sys->end_lsn) {
729
730 /* How many bytes of log data should we skip in the current log
731 block. Skipping is necessary because we round down the next
732 parse LSN thus it is possible to read the already-processed log
733 data many times */
734 ulint skip_already_parsed_len = 0;
735
736 if (!log_online_is_valid_log_seg(log_block)) {
737 break;
738 }
739
740 if ((block_start_lsn <= log_bmp_sys->next_parse_lsn)
741 && (block_start_lsn + OS_FILE_LOG_BLOCK_SIZE
742 > log_bmp_sys->next_parse_lsn)) {
743
744 /* The next parse LSN is inside the current block, skip
745 data preceding it. */
746 skip_already_parsed_len
747 = log_bmp_sys->next_parse_lsn
748 - block_start_lsn;
749 }
750 else {
751
752 /* If the next parse LSN is not inside the current
753 block, then the only option is that we have processed
754 ahead already. */
755 ut_a(block_start_lsn > log_bmp_sys->next_parse_lsn);
756 }
757
758 /* TODO: merge the copying to the parse buf code with
759 skip_already_len calculations */
760 log_online_parse_redo_log_block(log_block,
761 skip_already_parsed_len);
762
763 log_block += OS_FILE_LOG_BLOCK_SIZE;
764 block_start_lsn += OS_FILE_LOG_BLOCK_SIZE;
765 }
766
767 return;
768}
769
770/*********************************************************************//**
771Read and parse the redo log in a given group in FOLLOW_SCAN_SIZE-sized
772chunks and updates the modified page bitmap. */
773static
774void
775log_online_follow_log_group(
776/*========================*/
777 log_group_t* group, /*!< in: the log group to use */
778 ib_uint64_t contiguous_lsn) /*!< in: the LSN of log block start
779 containing the log_parse_start_lsn */
780{
781 ib_uint64_t block_start_lsn = contiguous_lsn;
782 ib_uint64_t block_end_lsn;
783
784 log_bmp_sys->next_parse_lsn = log_bmp_sys->start_lsn;
785 log_bmp_sys->parse_buf_end = log_bmp_sys->parse_buf;
786
787 do {
788 block_end_lsn = block_start_lsn + FOLLOW_SCAN_SIZE;
789
790 log_online_follow_log_seg(group, block_start_lsn,
791 block_end_lsn);
792
793 /* Next parse LSN can become higher than the last read LSN
794 only in the case when the read LSN falls right on the block
795 boundary, in which case next parse lsn is bumped to the actual
796 data LSN on the next (not yet read) block. This assert is
797 slightly conservative. */
798 ut_a(log_bmp_sys->next_parse_lsn
799 <= block_end_lsn + LOG_BLOCK_HDR_SIZE
800 + LOG_BLOCK_TRL_SIZE);
801
802 block_start_lsn = block_end_lsn;
803 } while (block_end_lsn < log_bmp_sys->end_lsn);
804
805 /* Assert that the last read log record is a full one */
806 ut_a(log_bmp_sys->parse_buf_end == log_bmp_sys->parse_buf);
807}
808
809/*********************************************************************//**
810Write, flush one bitmap block to disk and advance the output position if
811successful. */
812static
813void
814log_online_write_bitmap_page(
815/*=========================*/
816 const byte *block) /*!< in: block to write */
817{
818 ibool success;
819
820 success = os_file_write(log_bmp_sys->out_name,log_bmp_sys->out,
821 block,
822 (ulint)(log_bmp_sys->out_offset & 0xFFFFFFFF),
823 (ulint)(log_bmp_sys->out_offset << 32),
824 MODIFIED_PAGE_BLOCK_SIZE);
825 if (UNIV_UNLIKELY(!success)) {
826
827 /* The following call prints an error message */
828 os_file_get_last_error(TRUE);
829 fprintf(stderr, "InnoDB: Error: failed writing changed page "
830 "bitmap file \'%s\'\n", log_bmp_sys->out_name);
831 return;
832 }
833
834 success = os_file_flush(log_bmp_sys->out, FALSE);
835 if (UNIV_UNLIKELY(!success)) {
836
837 /* The following call prints an error message */
838 os_file_get_last_error(TRUE);
839 fprintf(stderr, "InnoDB: Error: failed flushing "
840 "changed page bitmap file \'%s\'\n",
841 log_bmp_sys->out_name);
842 return;
843 }
844
845 log_bmp_sys->out_offset += MODIFIED_PAGE_BLOCK_SIZE;
846}
847
848/*********************************************************************//**
849Append the current changed page bitmap to the bitmap file. Clears the
850bitmap tree and recycles its nodes to the free list. */
851static
852void
853log_online_write_bitmap()
854/*=====================*/
855{
856 ib_rbt_node_t *bmp_tree_node;
857 const ib_rbt_node_t *last_bmp_tree_node;
858
859 bmp_tree_node = (ib_rbt_node_t *)
860 rbt_first(log_bmp_sys->modified_pages);
861 last_bmp_tree_node = rbt_last(log_bmp_sys->modified_pages);
862
863 while (bmp_tree_node) {
864
865 byte *page = rbt_value(byte, bmp_tree_node);
866
867 if (bmp_tree_node == last_bmp_tree_node) {
868 mach_write_to_4(page + MODIFIED_PAGE_IS_LAST_BLOCK, 1);
869 }
870
871 mach_write_ull(page + MODIFIED_PAGE_START_LSN,
872 log_bmp_sys->start_lsn);
873 mach_write_ull(page + MODIFIED_PAGE_END_LSN,
874 log_bmp_sys->end_lsn);
875 mach_write_to_4(page + MODIFIED_PAGE_BLOCK_CHECKSUM,
876 log_online_calc_checksum(page));
877
878 log_online_write_bitmap_page(page);
879
880 bmp_tree_node->left = log_bmp_sys->page_free_list;
881 log_bmp_sys->page_free_list = bmp_tree_node;
882
883 bmp_tree_node = (ib_rbt_node_t*)
884 rbt_next(log_bmp_sys->modified_pages, bmp_tree_node);
885 }
886
887 rbt_reset(log_bmp_sys->modified_pages);
888}
889
890/*********************************************************************//**
891Read and parse the redo log up to last checkpoint LSN to build the changed
892page bitmap which is then written to disk. */
893UNIV_INTERN
894void
895log_online_follow_redo_log()
896/*========================*/
897{
898 ib_uint64_t contiguous_start_lsn;
899 log_group_t* group;
900
901 /* Grab the LSN of the last checkpoint, we will parse up to it */
902 mutex_enter(&(log_sys->mutex));
903 log_bmp_sys->end_lsn = log_sys->last_checkpoint_lsn;
904 mutex_exit(&(log_sys->mutex));
905
906 if (log_bmp_sys->end_lsn == log_bmp_sys->start_lsn) {
907 return;
908 }
909
910 group = UT_LIST_GET_FIRST(log_sys->log_groups);
911 ut_a(group);
912
913 contiguous_start_lsn = ut_uint64_align_down(log_bmp_sys->start_lsn,
914 OS_FILE_LOG_BLOCK_SIZE);
915
916 while (group) {
917 log_online_follow_log_group(group, contiguous_start_lsn);
918 group = UT_LIST_GET_NEXT(log_groups, group);
919 }
920
921 /* A crash injection site that ensures last checkpoint LSN > last
922 tracked LSN, so that LSN tracking for this interval is tested. */
923 DBUG_EXECUTE_IF("crash_before_bitmap_write", DBUG_SUICIDE(););
924
925 log_online_write_bitmap();
926 log_bmp_sys->start_lsn = log_bmp_sys->end_lsn;
927 log_set_tracked_lsn(log_bmp_sys->start_lsn);
928}
929
930/*********************************************************************//**
931Initializes log bitmap iterator.
932@return TRUE if the iterator is initialized OK, FALSE otherwise. */
933UNIV_INTERN
934ibool
935log_online_bitmap_iterator_init(
936/*============================*/
937 log_bitmap_iterator_t *i) /*!<in/out: iterator */
938{
939 ibool success;
940
941 ut_a(i);
942 ut_snprintf(i->in_name, FN_REFLEN, "%s%s%d", srv_data_home,
943 modified_page_stem, 1);
944 i->in_offset = 0;
945 /*
946 Set up bit offset out of the reasonable limit
947 to intiate reading block from file in
948 log_online_bitmap_iterator_next()
949 */
950 i->bit_offset = MODIFIED_PAGE_BLOCK_BITMAP_LEN;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches