1
/******************************************************
2
InnoDB INFORMATION SCHEMA tables interface to MySQL.
6
Created July 18, 2007 Vasil Dimov
7
*******************************************************/
9
#include <mysql_priv.h>
10
#include <mysqld_error.h>
14
#include <myisampack.h>
15
#include <mysys_err.h>
18
#include <mysql/plugin.h>
22
#include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */
23
#include "buf0buddy.h" /* for i_s_cmpmem */
24
#include "buf0buf.h" /* for buf_pool and PAGE_ZIP_MIN_SIZE */
25
#include "ha_prototypes.h" /* for innobase_convert_name() */
26
#include "srv0start.h" /* for srv_was_started */
28
#include "handler0vars.h"
30
static const char plugin_author[] = "Innobase Oy";
37
#define RETURN_IF_INNODB_NOT_STARTED(plugin_name) \
39
if (!srv_was_started) { \
40
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, \
41
ER_CANT_FIND_SYSTEM_REC, \
42
"InnoDB: SELECTing from " \
43
"INFORMATION_SCHEMA.%s but " \
44
"the InnoDB storage engine " \
45
"is not installed", plugin_name); \
50
#if !defined __STRICT_ANSI__ && defined __GNUC__ && (__GNUC__) > 2 && !defined __INTEL_COMPILER
51
#define STRUCT_FLD(name, value) name: value
53
#define STRUCT_FLD(name, value) value
56
static const ST_FIELD_INFO END_OF_ST_FIELD_INFO =
57
{STRUCT_FLD(field_name, NULL),
58
STRUCT_FLD(field_length, 0),
59
STRUCT_FLD(field_type, MYSQL_TYPE_NULL),
61
STRUCT_FLD(field_flags, 0),
62
STRUCT_FLD(old_name, ""),
63
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)};
66
Use the following types mapping:
68
C type ST_FIELD_INFO::field_type
69
---------------------------------
70
long MYSQL_TYPE_LONGLONG
71
(field_length=MY_INT64_NUM_DECIMAL_DIGITS)
73
long unsigned MYSQL_TYPE_LONGLONG
74
(field_length=MY_INT64_NUM_DECIMAL_DIGITS, field_flags=MY_I_S_UNSIGNED)
76
char* MYSQL_TYPE_STRING
79
float MYSQL_TYPE_FLOAT
80
(field_length=0 is ignored)
82
void* MYSQL_TYPE_LONGLONG
83
(field_length=MY_INT64_NUM_DECIMAL_DIGITS, field_flags=MY_I_S_UNSIGNED)
85
boolean (if else) MYSQL_TYPE_LONG
88
time_t MYSQL_TYPE_DATETIME
89
(field_length=0 ignored)
90
---------------------------------
93
/* XXX these are defined in mysql_priv.h inside #ifdef MYSQL_SERVER */
94
bool schema_table_store_record(THD *thd, TABLE *table);
95
void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);
96
bool check_global_access(THD *thd, ulong want_access);
98
/***********************************************************************
99
Common function to fill any of the dynamic tables:
100
INFORMATION_SCHEMA.innodb_trx
101
INFORMATION_SCHEMA.innodb_locks
102
INFORMATION_SCHEMA.innodb_lock_waits */
105
trx_i_s_common_fill_table(
106
/*======================*/
107
/* out: 0 on success */
108
THD* thd, /* in: thread */
109
TABLE_LIST* tables, /* in/out: tables to fill */
110
COND* cond); /* in: condition (not used) */
112
/***********************************************************************
113
Unbind a dynamic INFORMATION_SCHEMA table. */
118
/* out: 0 on success */
119
void* p); /* in/out: table schema object */
121
/***********************************************************************
122
Auxiliary function to store time_t value in MYSQL_TYPE_DATETIME
128
/* out: 0 on success */
129
Field* field, /* in/out: target field for storage */
130
time_t time) /* in: value to store */
136
/* use this if you are sure that `variables' and `time_zone'
137
are always initialized */
138
thd->variables.time_zone->gmt_sec_to_TIME(
139
&my_time, (my_time_t) time);
141
localtime_r(&time, &tm_time);
142
localtime_to_TIME(&my_time, &tm_time);
143
my_time.time_type = MYSQL_TIMESTAMP_DATETIME;
146
return(field->store_time(&my_time, MYSQL_TIMESTAMP_DATETIME));
149
/***********************************************************************
150
Auxiliary function to store char* value in MYSQL_TYPE_STRING field. */
155
/* out: 0 on success */
156
Field* field, /* in/out: target field for storage */
157
const char* str) /* in: NUL-terminated utf-8 string,
164
ret = field->store(str, strlen(str),
165
system_charset_info);
166
field->set_notnull();
169
ret = 0; /* success */
176
/***********************************************************************
177
Auxiliary function to store ulint value in MYSQL_TYPE_LONGLONG field.
178
If the value is ULINT_UNDEFINED then the field it set to NULL. */
183
/* out: 0 on success */
184
Field* field, /* in/out: target field for storage */
185
ulint n) /* in: value to store */
189
if (n != ULINT_UNDEFINED) {
191
ret = field->store(n);
192
field->set_notnull();
195
ret = 0; /* success */
202
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
203
static ST_FIELD_INFO innodb_trx_fields_info[] =
206
{STRUCT_FLD(field_name, "trx_id"),
207
STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
208
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
209
STRUCT_FLD(value, 0),
210
STRUCT_FLD(field_flags, 0),
211
STRUCT_FLD(old_name, ""),
212
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
214
#define IDX_TRX_STATE 1
215
{STRUCT_FLD(field_name, "trx_state"),
216
STRUCT_FLD(field_length, TRX_QUE_STATE_STR_MAX_LEN + 1),
217
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
218
STRUCT_FLD(value, 0),
219
STRUCT_FLD(field_flags, 0),
220
STRUCT_FLD(old_name, ""),
221
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
223
#define IDX_TRX_STARTED 2
224
{STRUCT_FLD(field_name, "trx_started"),
225
STRUCT_FLD(field_length, 0),
226
STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
227
STRUCT_FLD(value, 0),
228
STRUCT_FLD(field_flags, 0),
229
STRUCT_FLD(old_name, ""),
230
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
232
#define IDX_TRX_REQUESTED_LOCK_ID 3
233
{STRUCT_FLD(field_name, "trx_requested_lock_id"),
234
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
235
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
236
STRUCT_FLD(value, 0),
237
STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
238
STRUCT_FLD(old_name, ""),
239
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
241
#define IDX_TRX_WAIT_STARTED 4
242
{STRUCT_FLD(field_name, "trx_wait_started"),
243
STRUCT_FLD(field_length, 0),
244
STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
245
STRUCT_FLD(value, 0),
246
STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
247
STRUCT_FLD(old_name, ""),
248
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
250
#define IDX_TRX_WEIGHT 5
251
{STRUCT_FLD(field_name, "trx_weight"),
252
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
253
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
254
STRUCT_FLD(value, 0),
255
STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
256
STRUCT_FLD(old_name, ""),
257
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
259
#define IDX_TRX_MYSQL_THREAD_ID 6
260
{STRUCT_FLD(field_name, "trx_mysql_thread_id"),
261
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
262
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
263
STRUCT_FLD(value, 0),
264
STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
265
STRUCT_FLD(old_name, ""),
266
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
268
#define IDX_TRX_QUERY 7
269
{STRUCT_FLD(field_name, "trx_query"),
270
STRUCT_FLD(field_length, TRX_I_S_TRX_QUERY_MAX_LEN),
271
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
272
STRUCT_FLD(value, 0),
273
STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
274
STRUCT_FLD(old_name, ""),
275
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
280
/***********************************************************************
281
Read data from cache buffer and fill the INFORMATION_SCHEMA.innodb_trx
285
fill_innodb_trx_from_cache(
286
/*=======================*/
287
/* out: 0 on success */
288
trx_i_s_cache_t* cache, /* in: cache to read from */
289
THD* thd, /* in: used to call
290
schema_table_store_record() */
291
TABLE* table) /* in/out: fill this table */
295
char lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
298
DBUG_ENTER("fill_innodb_trx_from_cache");
300
fields = table->field;
302
rows_num = trx_i_s_cache_get_rows_used(cache,
305
for (i = 0; i < rows_num; i++) {
308
char trx_id[TRX_ID_MAX_LEN + 1];
310
row = (i_s_trx_row_t*)
311
trx_i_s_cache_get_nth_row(
312
cache, I_S_INNODB_TRX, i);
315
ut_snprintf(trx_id, sizeof(trx_id), TRX_ID_FMT, row->trx_id);
316
OK(field_store_string(fields[IDX_TRX_ID], trx_id));
319
OK(field_store_string(fields[IDX_TRX_STATE],
323
OK(field_store_time_t(fields[IDX_TRX_STARTED],
324
(time_t) row->trx_started));
326
/* trx_requested_lock_id */
327
/* trx_wait_started */
328
if (row->trx_wait_started != 0) {
330
OK(field_store_string(
331
fields[IDX_TRX_REQUESTED_LOCK_ID],
332
trx_i_s_create_lock_id(
333
row->requested_lock_row,
334
lock_id, sizeof(lock_id))));
335
/* field_store_string() sets it no notnull */
337
OK(field_store_time_t(
338
fields[IDX_TRX_WAIT_STARTED],
339
(time_t) row->trx_wait_started));
340
fields[IDX_TRX_WAIT_STARTED]->set_notnull();
343
fields[IDX_TRX_REQUESTED_LOCK_ID]->set_null();
344
fields[IDX_TRX_WAIT_STARTED]->set_null();
348
OK(fields[IDX_TRX_WEIGHT]->store((longlong) row->trx_weight,
351
/* trx_mysql_thread_id */
352
OK(fields[IDX_TRX_MYSQL_THREAD_ID]->store(
353
row->trx_mysql_thread_id));
356
OK(field_store_string(fields[IDX_TRX_QUERY],
359
OK(schema_table_store_record(thd, table));
365
/***********************************************************************
366
Bind the dynamic table INFORMATION_SCHEMA.innodb_trx */
371
/* out: 0 on success */
372
void* p) /* in/out: table schema object */
374
ST_SCHEMA_TABLE* schema;
376
DBUG_ENTER("innodb_trx_init");
378
schema = (ST_SCHEMA_TABLE*) p;
380
schema->fields_info = innodb_trx_fields_info;
381
schema->fill_table = trx_i_s_common_fill_table;
386
static struct st_mysql_information_schema i_s_info =
388
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
391
UNIV_INTERN struct st_mysql_plugin i_s_innodb_trx =
393
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
395
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
397
/* pointer to type-specific plugin descriptor */
399
STRUCT_FLD(info, &i_s_info),
403
STRUCT_FLD(name, "INNODB_TRX"),
405
/* plugin author (for SHOW PLUGINS) */
407
STRUCT_FLD(author, plugin_author),
409
/* general descriptive text (for SHOW PLUGINS) */
411
STRUCT_FLD(descr, "InnoDB transactions"),
413
/* the plugin license (PLUGIN_LICENSE_XXX) */
415
STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
417
/* the function to invoke when plugin is loaded */
418
/* int (*)(void*); */
419
STRUCT_FLD(init, innodb_trx_init),
421
/* the function to invoke when plugin is unloaded */
422
/* int (*)(void*); */
423
STRUCT_FLD(deinit, i_s_common_deinit),
425
/* plugin version (for SHOW PLUGINS) */
427
STRUCT_FLD(version, INNODB_VERSION_SHORT),
429
/* struct st_mysql_show_var* */
430
STRUCT_FLD(status_vars, NULL),
432
/* struct st_mysql_sys_var** */
433
STRUCT_FLD(system_vars, NULL),
435
/* reserved for dependency checking */
437
STRUCT_FLD(__reserved1, NULL)
440
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
441
static ST_FIELD_INFO innodb_locks_fields_info[] =
443
#define IDX_LOCK_ID 0
444
{STRUCT_FLD(field_name, "lock_id"),
445
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
446
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
447
STRUCT_FLD(value, 0),
448
STRUCT_FLD(field_flags, 0),
449
STRUCT_FLD(old_name, ""),
450
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
452
#define IDX_LOCK_TRX_ID 1
453
{STRUCT_FLD(field_name, "lock_trx_id"),
454
STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
455
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
456
STRUCT_FLD(value, 0),
457
STRUCT_FLD(field_flags, 0),
458
STRUCT_FLD(old_name, ""),
459
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
461
#define IDX_LOCK_MODE 2
462
{STRUCT_FLD(field_name, "lock_mode"),
463
/* S[,GAP] X[,GAP] IS[,GAP] IX[,GAP] AUTO_INC UNKNOWN */
464
STRUCT_FLD(field_length, 32),
465
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
466
STRUCT_FLD(value, 0),
467
STRUCT_FLD(field_flags, 0),
468
STRUCT_FLD(old_name, ""),
469
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
471
#define IDX_LOCK_TYPE 3
472
{STRUCT_FLD(field_name, "lock_type"),
473
STRUCT_FLD(field_length, 32 /* RECORD|TABLE|UNKNOWN */),
474
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
475
STRUCT_FLD(value, 0),
476
STRUCT_FLD(field_flags, 0),
477
STRUCT_FLD(old_name, ""),
478
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
480
#define IDX_LOCK_TABLE 4
481
{STRUCT_FLD(field_name, "lock_table"),
482
STRUCT_FLD(field_length, 1024),
483
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
484
STRUCT_FLD(value, 0),
485
STRUCT_FLD(field_flags, 0),
486
STRUCT_FLD(old_name, ""),
487
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
489
#define IDX_LOCK_INDEX 5
490
{STRUCT_FLD(field_name, "lock_index"),
491
STRUCT_FLD(field_length, 1024),
492
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
493
STRUCT_FLD(value, 0),
494
STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
495
STRUCT_FLD(old_name, ""),
496
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
498
#define IDX_LOCK_SPACE 6
499
{STRUCT_FLD(field_name, "lock_space"),
500
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
501
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
502
STRUCT_FLD(value, 0),
503
STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
504
STRUCT_FLD(old_name, ""),
505
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
507
#define IDX_LOCK_PAGE 7
508
{STRUCT_FLD(field_name, "lock_page"),
509
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
510
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
511
STRUCT_FLD(value, 0),
512
STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
513
STRUCT_FLD(old_name, ""),
514
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
516
#define IDX_LOCK_REC 8
517
{STRUCT_FLD(field_name, "lock_rec"),
518
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
519
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
520
STRUCT_FLD(value, 0),
521
STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
522
STRUCT_FLD(old_name, ""),
523
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
525
#define IDX_LOCK_DATA 9
526
{STRUCT_FLD(field_name, "lock_data"),
527
STRUCT_FLD(field_length, TRX_I_S_LOCK_DATA_MAX_LEN),
528
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
529
STRUCT_FLD(value, 0),
530
STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
531
STRUCT_FLD(old_name, ""),
532
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
537
/***********************************************************************
538
Read data from cache buffer and fill the INFORMATION_SCHEMA.innodb_locks
542
fill_innodb_locks_from_cache(
543
/*=========================*/
544
/* out: 0 on success */
545
trx_i_s_cache_t* cache, /* in: cache to read from */
546
THD* thd, /* in: MySQL client connection */
547
TABLE* table) /* in/out: fill this table */
551
char lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
554
DBUG_ENTER("fill_innodb_locks_from_cache");
556
fields = table->field;
558
rows_num = trx_i_s_cache_get_rows_used(cache,
561
for (i = 0; i < rows_num; i++) {
563
i_s_locks_row_t* row;
565
/* note that the decoded database or table name is
566
never expected to be longer than NAME_LEN;
567
NAME_LEN for database name
568
2 for surrounding quotes around database name
569
NAME_LEN for table name
570
2 for surrounding quotes around table name
571
1 for the separating dot (.)
572
9 for the #mysql50# prefix */
573
char buf[2 * NAME_LEN + 14];
576
char lock_trx_id[TRX_ID_MAX_LEN + 1];
578
row = (i_s_locks_row_t*)
579
trx_i_s_cache_get_nth_row(
580
cache, I_S_INNODB_LOCKS, i);
583
trx_i_s_create_lock_id(row, lock_id, sizeof(lock_id));
584
OK(field_store_string(fields[IDX_LOCK_ID],
588
ut_snprintf(lock_trx_id, sizeof(lock_trx_id),
589
TRX_ID_FMT, row->lock_trx_id);
590
OK(field_store_string(fields[IDX_LOCK_TRX_ID], lock_trx_id));
593
OK(field_store_string(fields[IDX_LOCK_MODE],
597
OK(field_store_string(fields[IDX_LOCK_TYPE],
601
bufend = innobase_convert_name(buf, sizeof(buf),
603
strlen(row->lock_table),
605
OK(fields[IDX_LOCK_TABLE]->store(buf, bufend - buf,
606
system_charset_info));
609
if (row->lock_index != NULL) {
611
bufend = innobase_convert_name(buf, sizeof(buf),
613
strlen(row->lock_index),
615
OK(fields[IDX_LOCK_INDEX]->store(buf, bufend - buf,
616
system_charset_info));
617
fields[IDX_LOCK_INDEX]->set_notnull();
620
fields[IDX_LOCK_INDEX]->set_null();
624
OK(field_store_ulint(fields[IDX_LOCK_SPACE],
628
OK(field_store_ulint(fields[IDX_LOCK_PAGE],
632
OK(field_store_ulint(fields[IDX_LOCK_REC],
636
OK(field_store_string(fields[IDX_LOCK_DATA],
639
OK(schema_table_store_record(thd, table));
645
/***********************************************************************
646
Bind the dynamic table INFORMATION_SCHEMA.innodb_locks */
651
/* out: 0 on success */
652
void* p) /* in/out: table schema object */
654
ST_SCHEMA_TABLE* schema;
656
DBUG_ENTER("innodb_locks_init");
658
schema = (ST_SCHEMA_TABLE*) p;
660
schema->fields_info = innodb_locks_fields_info;
661
schema->fill_table = trx_i_s_common_fill_table;
666
UNIV_INTERN struct st_mysql_plugin i_s_innodb_locks =
668
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
670
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
672
/* pointer to type-specific plugin descriptor */
674
STRUCT_FLD(info, &i_s_info),
678
STRUCT_FLD(name, "INNODB_LOCKS"),
680
/* plugin author (for SHOW PLUGINS) */
682
STRUCT_FLD(author, plugin_author),
684
/* general descriptive text (for SHOW PLUGINS) */
686
STRUCT_FLD(descr, "InnoDB conflicting locks"),
688
/* the plugin license (PLUGIN_LICENSE_XXX) */
690
STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
692
/* the function to invoke when plugin is loaded */
693
/* int (*)(void*); */
694
STRUCT_FLD(init, innodb_locks_init),
696
/* the function to invoke when plugin is unloaded */
697
/* int (*)(void*); */
698
STRUCT_FLD(deinit, i_s_common_deinit),
700
/* plugin version (for SHOW PLUGINS) */
702
STRUCT_FLD(version, INNODB_VERSION_SHORT),
704
/* struct st_mysql_show_var* */
705
STRUCT_FLD(status_vars, NULL),
707
/* struct st_mysql_sys_var** */
708
STRUCT_FLD(system_vars, NULL),
710
/* reserved for dependency checking */
712
STRUCT_FLD(__reserved1, NULL)
715
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
716
static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
718
#define IDX_REQUESTING_TRX_ID 0
719
{STRUCT_FLD(field_name, "requesting_trx_id"),
720
STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
721
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
722
STRUCT_FLD(value, 0),
723
STRUCT_FLD(field_flags, 0),
724
STRUCT_FLD(old_name, ""),
725
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
727
#define IDX_REQUESTED_LOCK_ID 1
728
{STRUCT_FLD(field_name, "requested_lock_id"),
729
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
730
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
731
STRUCT_FLD(value, 0),
732
STRUCT_FLD(field_flags, 0),
733
STRUCT_FLD(old_name, ""),
734
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
736
#define IDX_BLOCKING_TRX_ID 2
737
{STRUCT_FLD(field_name, "blocking_trx_id"),
738
STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
739
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
740
STRUCT_FLD(value, 0),
741
STRUCT_FLD(field_flags, 0),
742
STRUCT_FLD(old_name, ""),
743
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
745
#define IDX_BLOCKING_LOCK_ID 3
746
{STRUCT_FLD(field_name, "blocking_lock_id"),
747
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
748
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
749
STRUCT_FLD(value, 0),
750
STRUCT_FLD(field_flags, 0),
751
STRUCT_FLD(old_name, ""),
752
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
757
/***********************************************************************
758
Read data from cache buffer and fill the
759
INFORMATION_SCHEMA.innodb_lock_waits table with it. */
762
fill_innodb_lock_waits_from_cache(
763
/*==============================*/
764
/* out: 0 on success */
765
trx_i_s_cache_t* cache, /* in: cache to read from */
766
THD* thd, /* in: used to call
767
schema_table_store_record() */
768
TABLE* table) /* in/out: fill this table */
772
char requested_lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
773
char blocking_lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
776
DBUG_ENTER("fill_innodb_lock_waits_from_cache");
778
fields = table->field;
780
rows_num = trx_i_s_cache_get_rows_used(cache,
781
I_S_INNODB_LOCK_WAITS);
783
for (i = 0; i < rows_num; i++) {
785
i_s_lock_waits_row_t* row;
787
char requesting_trx_id[TRX_ID_MAX_LEN + 1];
788
char blocking_trx_id[TRX_ID_MAX_LEN + 1];
790
row = (i_s_lock_waits_row_t*)
791
trx_i_s_cache_get_nth_row(
792
cache, I_S_INNODB_LOCK_WAITS, i);
794
/* requesting_trx_id */
795
ut_snprintf(requesting_trx_id, sizeof(requesting_trx_id),
796
TRX_ID_FMT, row->requested_lock_row->lock_trx_id);
797
OK(field_store_string(fields[IDX_REQUESTING_TRX_ID],
800
/* requested_lock_id */
801
OK(field_store_string(
802
fields[IDX_REQUESTED_LOCK_ID],
803
trx_i_s_create_lock_id(
804
row->requested_lock_row,
806
sizeof(requested_lock_id))));
808
/* blocking_trx_id */
809
ut_snprintf(blocking_trx_id, sizeof(blocking_trx_id),
810
TRX_ID_FMT, row->blocking_lock_row->lock_trx_id);
811
OK(field_store_string(fields[IDX_BLOCKING_TRX_ID],
814
/* blocking_lock_id */
815
OK(field_store_string(
816
fields[IDX_BLOCKING_LOCK_ID],
817
trx_i_s_create_lock_id(
818
row->blocking_lock_row,
820
sizeof(blocking_lock_id))));
822
OK(schema_table_store_record(thd, table));
828
/***********************************************************************
829
Bind the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
832
innodb_lock_waits_init(
833
/*===================*/
834
/* out: 0 on success */
835
void* p) /* in/out: table schema object */
837
ST_SCHEMA_TABLE* schema;
839
DBUG_ENTER("innodb_lock_waits_init");
841
schema = (ST_SCHEMA_TABLE*) p;
843
schema->fields_info = innodb_lock_waits_fields_info;
844
schema->fill_table = trx_i_s_common_fill_table;
849
UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits =
851
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
853
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
855
/* pointer to type-specific plugin descriptor */
857
STRUCT_FLD(info, &i_s_info),
861
STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
863
/* plugin author (for SHOW PLUGINS) */
865
STRUCT_FLD(author, "Innobase Oy"),
867
/* general descriptive text (for SHOW PLUGINS) */
869
STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
871
/* the plugin license (PLUGIN_LICENSE_XXX) */
873
STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
875
/* the function to invoke when plugin is loaded */
876
/* int (*)(void*); */
877
STRUCT_FLD(init, innodb_lock_waits_init),
879
/* the function to invoke when plugin is unloaded */
880
/* int (*)(void*); */
881
STRUCT_FLD(deinit, i_s_common_deinit),
883
/* plugin version (for SHOW PLUGINS) */
885
STRUCT_FLD(version, INNODB_VERSION_SHORT),
887
/* struct st_mysql_show_var* */
888
STRUCT_FLD(status_vars, NULL),
890
/* struct st_mysql_sys_var** */
891
STRUCT_FLD(system_vars, NULL),
893
/* reserved for dependency checking */
895
STRUCT_FLD(__reserved1, NULL)
898
/***********************************************************************
899
Common function to fill any of the dynamic tables:
900
INFORMATION_SCHEMA.innodb_trx
901
INFORMATION_SCHEMA.innodb_locks
902
INFORMATION_SCHEMA.innodb_lock_waits */
905
trx_i_s_common_fill_table(
906
/*======================*/
907
/* out: 0 on success */
908
THD* thd, /* in: thread */
909
TABLE_LIST* tables, /* in/out: tables to fill */
910
COND* cond) /* in: condition (not used) */
912
const char* table_name;
914
trx_i_s_cache_t* cache;
916
DBUG_ENTER("trx_i_s_common_fill_table");
918
/* deny access to non-superusers */
919
if (check_global_access(thd, PROCESS_ACL)) {
924
/* minimize the number of places where global variables are
926
cache = trx_i_s_cache;
928
/* which table we have to fill? */
929
table_name = tables->schema_table_name;
930
/* or table_name = tables->schema_table->table_name; */
932
RETURN_IF_INNODB_NOT_STARTED(table_name);
934
/* update the cache */
935
trx_i_s_cache_start_write(cache);
936
trx_i_s_possibly_fetch_data_into_cache(cache);
937
trx_i_s_cache_end_write(cache);
939
if (trx_i_s_cache_is_truncated(cache)) {
941
/* XXX show warning to user if possible */
942
fprintf(stderr, "Warning: data in %s truncated due to "
943
"memory limit of %d bytes\n", table_name,
949
trx_i_s_cache_start_read(cache);
951
if (innobase_strcasecmp(table_name, "innodb_trx") == 0) {
953
if (fill_innodb_trx_from_cache(
954
cache, thd, tables->table) != 0) {
959
} else if (innobase_strcasecmp(table_name, "innodb_locks") == 0) {
961
if (fill_innodb_locks_from_cache(
962
cache, thd, tables->table) != 0) {
967
} else if (innobase_strcasecmp(table_name, "innodb_lock_waits") == 0) {
969
if (fill_innodb_lock_waits_from_cache(
970
cache, thd, tables->table) != 0) {
977
/* huh! what happened!? */
979
"InnoDB: trx_i_s_common_fill_table() was "
980
"called to fill unknown table: %s.\n"
981
"This function only knows how to fill "
982
"innodb_trx, innodb_locks and "
983
"innodb_lock_waits tables.\n", table_name);
988
trx_i_s_cache_end_read(cache);
993
/* if this function returns something else than 0 then a
994
deadlock occurs between the mysqld server and mysql client,
995
see http://bugs.mysql.com/29900 ; when that bug is resolved
996
we can enable the DBUG_RETURN(ret) above */
1001
/* Fields of the dynamic table information_schema.innodb_cmp. */
1002
static ST_FIELD_INFO i_s_cmp_fields_info[] =
1004
{STRUCT_FLD(field_name, "page_size"),
1005
STRUCT_FLD(field_length, 5),
1006
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1007
STRUCT_FLD(value, 0),
1008
STRUCT_FLD(field_flags, 0),
1009
STRUCT_FLD(old_name, "Compressed Page Size"),
1010
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1012
{STRUCT_FLD(field_name, "compress_ops"),
1013
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1014
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1015
STRUCT_FLD(value, 0),
1016
STRUCT_FLD(field_flags, 0),
1017
STRUCT_FLD(old_name, "Total Number of Compressions"),
1018
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1020
{STRUCT_FLD(field_name, "compress_ops_ok"),
1021
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1022
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1023
STRUCT_FLD(value, 0),
1024
STRUCT_FLD(field_flags, 0),
1025
STRUCT_FLD(old_name, "Total Number of"
1026
" Successful Compressions"),
1027
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1029
{STRUCT_FLD(field_name, "compress_time"),
1030
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1031
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1032
STRUCT_FLD(value, 0),
1033
STRUCT_FLD(field_flags, 0),
1034
STRUCT_FLD(old_name, "Total Duration of Compressions,"
1036
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1038
{STRUCT_FLD(field_name, "uncompress_ops"),
1039
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1040
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1041
STRUCT_FLD(value, 0),
1042
STRUCT_FLD(field_flags, 0),
1043
STRUCT_FLD(old_name, "Total Number of Decompressions"),
1044
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1046
{STRUCT_FLD(field_name, "uncompress_time"),
1047
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1048
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1049
STRUCT_FLD(value, 0),
1050
STRUCT_FLD(field_flags, 0),
1051
STRUCT_FLD(old_name, "Total Duration of Decompressions,"
1053
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1055
END_OF_ST_FIELD_INFO
1059
/***********************************************************************
1060
Fill the dynamic table information_schema.innodb_cmp or
1061
innodb_cmp_reset. */
1066
/* out: 0 on success, 1 on failure */
1067
THD* thd, /* in: thread */
1068
TABLE_LIST* tables, /* in/out: tables to fill */
1069
COND* cond, /* in: condition (ignored) */
1070
ibool reset) /* in: TRUE=reset cumulated counts */
1072
TABLE* table = (TABLE *) tables->table;
1075
DBUG_ENTER("i_s_cmp_fill_low");
1077
/* deny access to non-superusers */
1078
if (check_global_access(thd, PROCESS_ACL)) {
1083
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
1085
for (uint i = 0; i < PAGE_ZIP_NUM_SSIZE - 1; i++) {
1086
page_zip_stat_t* zip_stat = &page_zip_stat[i];
1088
table->field[0]->store(PAGE_ZIP_MIN_SIZE << i);
1090
/* The cumulated counts are not protected by any
1091
mutex. Thus, some operation in page0zip.c could
1092
increment a counter between the time we read it and
1093
clear it. We could introduce mutex protection, but it
1094
could cause a measureable performance hit in
1096
table->field[1]->store(zip_stat->compressed);
1097
table->field[2]->store(zip_stat->compressed_ok);
1098
table->field[3]->store(
1099
(ulong) (zip_stat->compressed_usec / 1000000));
1100
table->field[4]->store(zip_stat->decompressed);
1101
table->field[5]->store(
1102
(ulong) (zip_stat->decompressed_usec / 1000000));
1105
memset(zip_stat, 0, sizeof *zip_stat);
1108
if (schema_table_store_record(thd, table)) {
1114
DBUG_RETURN(status);
1117
/***********************************************************************
1118
Fill the dynamic table information_schema.innodb_cmp. */
1123
/* out: 0 on success, 1 on failure */
1124
THD* thd, /* in: thread */
1125
TABLE_LIST* tables, /* in/out: tables to fill */
1126
COND* cond) /* in: condition (ignored) */
1128
return(i_s_cmp_fill_low(thd, tables, cond, FALSE));
1131
/***********************************************************************
1132
Fill the dynamic table information_schema.innodb_cmp_reset. */
1137
/* out: 0 on success, 1 on failure */
1138
THD* thd, /* in: thread */
1139
TABLE_LIST* tables, /* in/out: tables to fill */
1140
COND* cond) /* in: condition (ignored) */
1142
return(i_s_cmp_fill_low(thd, tables, cond, TRUE));
1145
/***********************************************************************
1146
Bind the dynamic table information_schema.innodb_cmp. */
1151
/* out: 0 on success */
1152
void* p) /* in/out: table schema object */
1154
DBUG_ENTER("i_s_cmp_init");
1155
ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
1157
schema->fields_info = i_s_cmp_fields_info;
1158
schema->fill_table = i_s_cmp_fill;
1163
/***********************************************************************
1164
Bind the dynamic table information_schema.innodb_cmp_reset. */
1169
/* out: 0 on success */
1170
void* p) /* in/out: table schema object */
1172
DBUG_ENTER("i_s_cmp_reset_init");
1173
ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
1175
schema->fields_info = i_s_cmp_fields_info;
1176
schema->fill_table = i_s_cmp_reset_fill;
1181
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp =
1183
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
1185
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
1187
/* pointer to type-specific plugin descriptor */
1189
STRUCT_FLD(info, &i_s_info),
1193
STRUCT_FLD(name, "INNODB_CMP"),
1195
/* plugin author (for SHOW PLUGINS) */
1197
STRUCT_FLD(author, plugin_author),
1199
/* general descriptive text (for SHOW PLUGINS) */
1201
STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
1203
/* the plugin license (PLUGIN_LICENSE_XXX) */
1205
STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
1207
/* the function to invoke when plugin is loaded */
1208
/* int (*)(void*); */
1209
STRUCT_FLD(init, i_s_cmp_init),
1211
/* the function to invoke when plugin is unloaded */
1212
/* int (*)(void*); */
1213
STRUCT_FLD(deinit, i_s_common_deinit),
1215
/* plugin version (for SHOW PLUGINS) */
1217
STRUCT_FLD(version, INNODB_VERSION_SHORT),
1219
/* struct st_mysql_show_var* */
1220
STRUCT_FLD(status_vars, NULL),
1222
/* struct st_mysql_sys_var** */
1223
STRUCT_FLD(system_vars, NULL),
1225
/* reserved for dependency checking */
1227
STRUCT_FLD(__reserved1, NULL)
1230
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
1232
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
1234
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
1236
/* pointer to type-specific plugin descriptor */
1238
STRUCT_FLD(info, &i_s_info),
1242
STRUCT_FLD(name, "INNODB_CMP_RESET"),
1244
/* plugin author (for SHOW PLUGINS) */
1246
STRUCT_FLD(author, plugin_author),
1248
/* general descriptive text (for SHOW PLUGINS) */
1250
STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
1251
" reset cumulated counts"),
1253
/* the plugin license (PLUGIN_LICENSE_XXX) */
1255
STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
1257
/* the function to invoke when plugin is loaded */
1258
/* int (*)(void*); */
1259
STRUCT_FLD(init, i_s_cmp_reset_init),
1261
/* the function to invoke when plugin is unloaded */
1262
/* int (*)(void*); */
1263
STRUCT_FLD(deinit, i_s_common_deinit),
1265
/* plugin version (for SHOW PLUGINS) */
1267
STRUCT_FLD(version, INNODB_VERSION_SHORT),
1269
/* struct st_mysql_show_var* */
1270
STRUCT_FLD(status_vars, NULL),
1272
/* struct st_mysql_sys_var** */
1273
STRUCT_FLD(system_vars, NULL),
1275
/* reserved for dependency checking */
1277
STRUCT_FLD(__reserved1, NULL)
1280
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
1281
static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
1283
{STRUCT_FLD(field_name, "page_size"),
1284
STRUCT_FLD(field_length, 5),
1285
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1286
STRUCT_FLD(value, 0),
1287
STRUCT_FLD(field_flags, 0),
1288
STRUCT_FLD(old_name, "Buddy Block Size"),
1289
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1291
{STRUCT_FLD(field_name, "pages_used"),
1292
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1293
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1294
STRUCT_FLD(value, 0),
1295
STRUCT_FLD(field_flags, 0),
1296
STRUCT_FLD(old_name, "Currently in Use"),
1297
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1299
{STRUCT_FLD(field_name, "pages_free"),
1300
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1301
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1302
STRUCT_FLD(value, 0),
1303
STRUCT_FLD(field_flags, 0),
1304
STRUCT_FLD(old_name, "Currently Available"),
1305
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1307
{STRUCT_FLD(field_name, "relocation_ops"),
1308
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
1309
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
1310
STRUCT_FLD(value, 0),
1311
STRUCT_FLD(field_flags, 0),
1312
STRUCT_FLD(old_name, "Total Number of Relocations"),
1313
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1315
{STRUCT_FLD(field_name, "relocation_time"),
1316
STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
1317
STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
1318
STRUCT_FLD(value, 0),
1319
STRUCT_FLD(field_flags, 0),
1320
STRUCT_FLD(old_name, "Total Duration of Relocations,"
1322
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
1324
END_OF_ST_FIELD_INFO
1327
/***********************************************************************
1328
Fill the dynamic table information_schema.innodb_cmpmem or
1329
innodb_cmpmem_reset. */
1332
i_s_cmpmem_fill_low(
1333
/*================*/
1334
/* out: 0 on success, 1 on failure */
1335
THD* thd, /* in: thread */
1336
TABLE_LIST* tables, /* in/out: tables to fill */
1337
COND* cond, /* in: condition (ignored) */
1338
ibool reset) /* in: TRUE=reset cumulated counts */
1340
TABLE* table = (TABLE *) tables->table;
1343
DBUG_ENTER("i_s_cmpmem_fill_low");
1345
/* deny access to non-superusers */
1346
if (check_global_access(thd, PROCESS_ACL)) {
1351
RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
1353
buf_pool_mutex_enter();
1355
for (uint x = 0; x <= BUF_BUDDY_SIZES; x++) {
1356
buf_buddy_stat_t* buddy_stat = &buf_buddy_stat[x];
1358
table->field[0]->store(BUF_BUDDY_LOW << x);
1359
table->field[1]->store(buddy_stat->used);
1360
table->field[2]->store(UNIV_LIKELY(x < BUF_BUDDY_SIZES)
1361
? UT_LIST_GET_LEN(buf_pool->zip_free[x])
1363
table->field[3]->store((longlong) buddy_stat->relocated, true);
1364
table->field[4]->store(
1365
(ulong) (buddy_stat->relocated_usec / 1000000));
1368
/* This is protected by buf_pool_mutex. */
1369
buddy_stat->relocated = 0;
1370
buddy_stat->relocated_usec = 0;
1373
if (schema_table_store_record(thd, table)) {
1379
buf_pool_mutex_exit();
1380
DBUG_RETURN(status);
1383
/***********************************************************************
1384
Fill the dynamic table information_schema.innodb_cmpmem. */
1389
/* out: 0 on success, 1 on failure */
1390
THD* thd, /* in: thread */
1391
TABLE_LIST* tables, /* in/out: tables to fill */
1392
COND* cond) /* in: condition (ignored) */
1394
return(i_s_cmpmem_fill_low(thd, tables, cond, FALSE));
1397
/***********************************************************************
1398
Fill the dynamic table information_schema.innodb_cmpmem_reset. */
1401
i_s_cmpmem_reset_fill(
1402
/*==================*/
1403
/* out: 0 on success, 1 on failure */
1404
THD* thd, /* in: thread */
1405
TABLE_LIST* tables, /* in/out: tables to fill */
1406
COND* cond) /* in: condition (ignored) */
1408
return(i_s_cmpmem_fill_low(thd, tables, cond, TRUE));
1411
/***********************************************************************
1412
Bind the dynamic table information_schema.innodb_cmpmem. */
1417
/* out: 0 on success */
1418
void* p) /* in/out: table schema object */
1420
DBUG_ENTER("i_s_cmpmem_init");
1421
ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
1423
schema->fields_info = i_s_cmpmem_fields_info;
1424
schema->fill_table = i_s_cmpmem_fill;
1429
/***********************************************************************
1430
Bind the dynamic table information_schema.innodb_cmpmem_reset. */
1433
i_s_cmpmem_reset_init(
1434
/*==================*/
1435
/* out: 0 on success */
1436
void* p) /* in/out: table schema object */
1438
DBUG_ENTER("i_s_cmpmem_reset_init");
1439
ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
1441
schema->fields_info = i_s_cmpmem_fields_info;
1442
schema->fill_table = i_s_cmpmem_reset_fill;
1447
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem =
1449
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
1451
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
1453
/* pointer to type-specific plugin descriptor */
1455
STRUCT_FLD(info, &i_s_info),
1459
STRUCT_FLD(name, "INNODB_CMPMEM"),
1461
/* plugin author (for SHOW PLUGINS) */
1463
STRUCT_FLD(author, plugin_author),
1465
/* general descriptive text (for SHOW PLUGINS) */
1467
STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
1469
/* the plugin license (PLUGIN_LICENSE_XXX) */
1471
STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
1473
/* the function to invoke when plugin is loaded */
1474
/* int (*)(void*); */
1475
STRUCT_FLD(init, i_s_cmpmem_init),
1477
/* the function to invoke when plugin is unloaded */
1478
/* int (*)(void*); */
1479
STRUCT_FLD(deinit, i_s_common_deinit),
1481
/* plugin version (for SHOW PLUGINS) */
1483
STRUCT_FLD(version, INNODB_VERSION_SHORT),
1485
/* struct st_mysql_show_var* */
1486
STRUCT_FLD(status_vars, NULL),
1488
/* struct st_mysql_sys_var** */
1489
STRUCT_FLD(system_vars, NULL),
1491
/* reserved for dependency checking */
1493
STRUCT_FLD(__reserved1, NULL)
1496
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
1498
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
1500
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
1502
/* pointer to type-specific plugin descriptor */
1504
STRUCT_FLD(info, &i_s_info),
1508
STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
1510
/* plugin author (for SHOW PLUGINS) */
1512
STRUCT_FLD(author, plugin_author),
1514
/* general descriptive text (for SHOW PLUGINS) */
1516
STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
1517
" reset cumulated counts"),
1519
/* the plugin license (PLUGIN_LICENSE_XXX) */
1521
STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
1523
/* the function to invoke when plugin is loaded */
1524
/* int (*)(void*); */
1525
STRUCT_FLD(init, i_s_cmpmem_reset_init),
1527
/* the function to invoke when plugin is unloaded */
1528
/* int (*)(void*); */
1529
STRUCT_FLD(deinit, i_s_common_deinit),
1531
/* plugin version (for SHOW PLUGINS) */
1533
STRUCT_FLD(version, INNODB_VERSION_SHORT),
1535
/* struct st_mysql_show_var* */
1536
STRUCT_FLD(status_vars, NULL),
1538
/* struct st_mysql_sys_var** */
1539
STRUCT_FLD(system_vars, NULL),
1541
/* reserved for dependency checking */
1543
STRUCT_FLD(__reserved1, NULL)
1546
/***********************************************************************
1547
Unbind a dynamic INFORMATION_SCHEMA table. */
1552
/* out: 0 on success */
1553
void* p) /* in/out: table schema object */
1555
DBUG_ENTER("i_s_common_deinit");