1
diff -ruN a/storage/innodb_plugin/Makefile.am b/storage/innodb_plugin/Makefile.am
2
--- a/storage/innodb_plugin/Makefile.am 2010-04-06 23:07:11.000000000 +0900
3
+++ b/storage/innodb_plugin/Makefile.am 2010-04-29 15:22:39.000000000 +0900
8
+ handler/innodb_patch_info.h \
11
EXTRA_LIBRARIES= libinnobase.a
12
diff -ruN a/storage/innodb_plugin/Makefile.in b/storage/innodb_plugin/Makefile.in
13
--- a/storage/innodb_plugin/Makefile.in 2010-04-06 23:12:58.000000000 +0900
14
+++ b/storage/innodb_plugin/Makefile.in 2010-04-29 15:22:39.000000000 +0900
19
+ handler/innodb_patch_info.h \
22
EXTRA_LIBRARIES = libinnobase.a
23
diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
24
--- a/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-06 23:07:12.000000000 +0900
25
+++ b/storage/innodb_plugin/handler/ha_innodb.cc 2010-04-29 15:22:39.000000000 +0900
26
@@ -10814,7 +10814,8 @@
30
-i_s_innodb_cmpmem_reset
31
+i_s_innodb_cmpmem_reset,
33
mysql_declare_plugin_end;
35
/** @brief Initialize the default value of innodb_commit_concurrency.
36
diff -ruN a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
37
--- a/storage/innodb_plugin/handler/i_s.cc 2010-04-06 23:07:12.000000000 +0900
38
+++ b/storage/innodb_plugin/handler/i_s.cc 2010-04-29 15:22:39.000000000 +0900
40
#include <mysys_err.h>
43
+#include "innodb_patch_info.h"
44
#include <mysql/plugin.h>
51
+/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_patches */
52
+static ST_FIELD_INFO innodb_patches_fields_info[] =
54
+#define IDX_PATCH_NAME 0
55
+ {STRUCT_FLD(field_name, "name"),
56
+ STRUCT_FLD(field_length, 255),
57
+ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
58
+ STRUCT_FLD(value, 0),
59
+ STRUCT_FLD(field_flags, 0),
60
+ STRUCT_FLD(old_name, ""),
61
+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
63
+#define IDX_PATCH_DESCR 1
64
+ {STRUCT_FLD(field_name, "description"),
65
+ STRUCT_FLD(field_length, 255),
66
+ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
67
+ STRUCT_FLD(value, 0),
68
+ STRUCT_FLD(field_flags, 0),
69
+ STRUCT_FLD(old_name, ""),
70
+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
72
+#define IDX_PATCH_COMMENT 2
73
+ {STRUCT_FLD(field_name, "comment"),
74
+ STRUCT_FLD(field_length, 100),
75
+ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
76
+ STRUCT_FLD(value, 0),
77
+ STRUCT_FLD(field_flags, 0),
78
+ STRUCT_FLD(old_name, ""),
79
+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
81
+#define IDX_PATCH_LINK 3
82
+ {STRUCT_FLD(field_name, "link"),
83
+ STRUCT_FLD(field_length, 255),
84
+ STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
85
+ STRUCT_FLD(value, 0),
86
+ STRUCT_FLD(field_flags, 0),
87
+ STRUCT_FLD(old_name, ""),
88
+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
90
+ END_OF_ST_FIELD_INFO
93
+static struct st_mysql_information_schema i_s_info =
95
+ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
98
+/***********************************************************************
99
+Fill the dynamic table information_schema.innodb_patches */
102
+innodb_patches_fill(
104
+ /* out: 0 on success, 1 on failure */
105
+ THD* thd, /* in: thread */
106
+ TABLE_LIST* tables, /* in/out: tables to fill */
107
+ COND* cond) /* in: condition (ignored) */
109
+ TABLE* table = (TABLE *) tables->table;
115
+ DBUG_ENTER("innodb_patches_fill");
116
+ fields = table->field;
118
+ /* deny access to non-superusers */
119
+ if (check_global_access(thd, PROCESS_ACL)) {
124
+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
126
+ for (i = 0; innodb_enhancements[i].file; i++) {
128
+ field_store_string(fields[0],innodb_enhancements[i].file);
129
+ field_store_string(fields[1],innodb_enhancements[i].name);
130
+ field_store_string(fields[2],innodb_enhancements[i].comment);
131
+ field_store_string(fields[3],innodb_enhancements[i].link);
133
+ if (schema_table_store_record(thd, table)) {
141
+ DBUG_RETURN(status);
144
+/***********************************************************************
145
+Bind the dynamic table information_schema.innodb_patches. */
148
+innodb_patches_init(
150
+ /* out: 0 on success */
151
+ void* p) /* in/out: table schema object */
153
+ DBUG_ENTER("innodb_patches_init");
154
+ ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
156
+ schema->fields_info = innodb_patches_fields_info;
157
+ schema->fill_table = innodb_patches_fill;
163
+UNIV_INTERN struct st_mysql_plugin i_s_innodb_patches =
165
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
167
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
169
+ /* pointer to type-specific plugin descriptor */
171
+ STRUCT_FLD(info, &i_s_info),
175
+ STRUCT_FLD(name, "XTRADB_ENHANCEMENTS"),
177
+ /* plugin author (for SHOW PLUGINS) */
179
+ STRUCT_FLD(author, "Percona"),
181
+ /* general descriptive text (for SHOW PLUGINS) */
183
+ STRUCT_FLD(descr, "Enhancements applied to InnoDB plugin"),
185
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
187
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
189
+ /* the function to invoke when plugin is loaded */
190
+ /* int (*)(void*); */
191
+ STRUCT_FLD(init, innodb_patches_init),
193
+ /* the function to invoke when plugin is unloaded */
194
+ /* int (*)(void*); */
195
+ STRUCT_FLD(deinit, i_s_common_deinit),
197
+ /* plugin version (for SHOW PLUGINS) */
199
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
201
+ /* struct st_mysql_show_var* */
202
+ STRUCT_FLD(status_vars, NULL),
204
+ /* struct st_mysql_sys_var** */
205
+ STRUCT_FLD(system_vars, NULL),
207
+ /* reserved for dependency checking */
209
+ STRUCT_FLD(__reserved1, NULL)
213
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
214
static ST_FIELD_INFO innodb_trx_fields_info[] =
220
-static struct st_mysql_information_schema i_s_info =
222
- MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
225
UNIV_INTERN struct st_mysql_plugin i_s_innodb_trx =
227
diff -ruN a/storage/innodb_plugin/handler/i_s.h b/storage/innodb_plugin/handler/i_s.h
228
--- a/storage/innodb_plugin/handler/i_s.h 2010-04-06 23:07:12.000000000 +0900
229
+++ b/storage/innodb_plugin/handler/i_s.h 2010-04-29 15:22:39.000000000 +0900
231
extern struct st_mysql_plugin i_s_innodb_cmp_reset;
232
extern struct st_mysql_plugin i_s_innodb_cmpmem;
233
extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;
234
+extern struct st_mysql_plugin i_s_innodb_patches;
237
diff -ruN a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
238
--- /dev/null 1970-01-01 09:00:00.000000000 +0900
239
+++ b/storage/innodb_plugin/handler/innodb_patch_info.h 2010-04-29 15:22:39.000000000 +0900
241
+/* Copyright (C) 2002-2006 MySQL AB
243
+ This program is free software; you can redistribute it and/or modify
244
+ it under the terms of the GNU General Public License as published by
245
+ the Free Software Foundation; version 2 of the License.
247
+ This program is distributed in the hope that it will be useful,
248
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
249
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
250
+ GNU General Public License for more details.
252
+ You should have received a copy of the GNU General Public License
253
+ along with this program; if not, write to the Free Software
254
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
256
+#ifdef USE_PRAGMA_INTERFACE
257
+#pragma interface /* gcc class implementation */
260
+struct innodb_enhancement {
263
+ const char *comment;
265
+}innodb_enhancements[] = {
266
+{"xtradb_show_enhancements","I_S.XTRADB_ENHANCEMENTS","","http://www.percona.com/docs/wiki/percona-xtradb"},
267
+{NULL, NULL, NULL, NULL}