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