1 # name : innodb_buffer_pool_pages_i_s.patch
2 # introduced : 11 or before
3 # maintainer : Yasufumi
6 # Any small change to this file in the main branch
7 # should be done or reviewed by the maintainer!
8 --- a/storage/innobase/buf/buf0buf.c
9 +++ b/storage/innobase/buf/buf0buf.c
10 @@ -4163,6 +4163,36 @@
11 mutex_exit(block_mutex);
14 +/********************************************************************//**
20 + buf_pool_t* buf_pool,
23 + ulint n_chunks, offset;
26 + ut_a(n_block < buf_pool->curr_size);
28 + chunk = buf_pool->chunks;
31 + for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
32 + if (offset < chunk->size) {
33 + return(&chunk->blocks[offset]);
36 + offset -= chunk->size;
44 /*********************************************************************//**
45 Asserts that all file pages in the buffer are in a replaceable state.
47 --- a/storage/innobase/handler/ha_innodb.cc
48 +++ b/storage/innobase/handler/ha_innodb.cc
49 @@ -12338,6 +12338,9 @@
51 i_s_innodb_table_stats,
52 i_s_innodb_index_stats,
53 +i_s_innodb_buffer_pool_pages,
54 +i_s_innodb_buffer_pool_pages_index,
55 +i_s_innodb_buffer_pool_pages_blob,
56 i_s_innodb_admin_command
57 mysql_declare_plugin_end;
59 --- a/storage/innobase/handler/i_s.cc
60 +++ b/storage/innobase/handler/i_s.cc
62 #include "trx0sys.h" /* for trx_sys */
63 #include "dict0dict.h" /* for dict_sys */
64 #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
65 +#include "btr0btr.h" /* for btr_page_get_index_id */
69 @@ -4411,3 +4412,713 @@
70 STRUCT_FLD(__reserved1, NULL),
71 STRUCT_FLD(flags, 0UL)
74 +/***********************************************************************
76 +static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_fields_info[] =
78 + {STRUCT_FLD(field_name, "page_type"),
79 + STRUCT_FLD(field_length, 64),
80 + STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
81 + STRUCT_FLD(value, 0),
82 + STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
83 + STRUCT_FLD(old_name, ""),
84 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
86 + {STRUCT_FLD(field_name, "space_id"),
87 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
88 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
89 + STRUCT_FLD(value, 0),
90 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
91 + STRUCT_FLD(old_name, ""),
92 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
94 + {STRUCT_FLD(field_name, "page_no"),
95 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
96 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
97 + STRUCT_FLD(value, 0),
98 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
99 + STRUCT_FLD(old_name, ""),
100 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
102 + {STRUCT_FLD(field_name, "lru_position"),
103 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
104 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
105 + STRUCT_FLD(value, 0),
106 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
107 + STRUCT_FLD(old_name, ""),
108 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
110 + {STRUCT_FLD(field_name, "fix_count"),
111 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
112 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
113 + STRUCT_FLD(value, 0),
114 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
115 + STRUCT_FLD(old_name, ""),
116 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
118 + {STRUCT_FLD(field_name, "flush_type"),
119 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
120 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
121 + STRUCT_FLD(value, 0),
122 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
123 + STRUCT_FLD(old_name, ""),
124 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
126 + END_OF_ST_FIELD_INFO
129 +static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_index_fields_info[] =
131 + {STRUCT_FLD(field_name, "index_id"),
132 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
133 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
134 + STRUCT_FLD(value, 0),
135 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
136 + STRUCT_FLD(old_name, ""),
137 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
139 + {STRUCT_FLD(field_name, "space_id"),
140 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
141 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
142 + STRUCT_FLD(value, 0),
143 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
144 + STRUCT_FLD(old_name, ""),
145 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
147 + {STRUCT_FLD(field_name, "page_no"),
148 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
149 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
150 + STRUCT_FLD(value, 0),
151 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
152 + STRUCT_FLD(old_name, ""),
153 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
155 + {STRUCT_FLD(field_name, "n_recs"),
156 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
157 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
158 + STRUCT_FLD(value, 0),
159 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
160 + STRUCT_FLD(old_name, ""),
161 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
163 + {STRUCT_FLD(field_name, "data_size"),
164 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
165 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
166 + STRUCT_FLD(value, 0),
167 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
168 + STRUCT_FLD(old_name, ""),
169 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
171 + {STRUCT_FLD(field_name, "hashed"),
172 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
173 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
174 + STRUCT_FLD(value, 0),
175 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
176 + STRUCT_FLD(old_name, ""),
177 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
179 + {STRUCT_FLD(field_name, "access_time"),
180 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
181 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
182 + STRUCT_FLD(value, 0),
183 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
184 + STRUCT_FLD(old_name, ""),
185 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
187 + {STRUCT_FLD(field_name, "modified"),
188 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
189 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
190 + STRUCT_FLD(value, 0),
191 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
192 + STRUCT_FLD(old_name, ""),
193 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
195 + {STRUCT_FLD(field_name, "dirty"),
196 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
197 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
198 + STRUCT_FLD(value, 0),
199 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
200 + STRUCT_FLD(old_name, ""),
201 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
203 + {STRUCT_FLD(field_name, "old"),
204 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
205 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
206 + STRUCT_FLD(value, 0),
207 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
208 + STRUCT_FLD(old_name, ""),
209 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
211 + {STRUCT_FLD(field_name, "lru_position"),
212 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
213 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
214 + STRUCT_FLD(value, 0),
215 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
216 + STRUCT_FLD(old_name, ""),
217 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
219 + {STRUCT_FLD(field_name, "fix_count"),
220 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
221 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
222 + STRUCT_FLD(value, 0),
223 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
224 + STRUCT_FLD(old_name, ""),
225 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
227 + {STRUCT_FLD(field_name, "flush_type"),
228 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
229 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
230 + STRUCT_FLD(value, 0),
231 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
232 + STRUCT_FLD(old_name, ""),
233 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
235 + END_OF_ST_FIELD_INFO
238 +static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_blob_fields_info[] =
240 + {STRUCT_FLD(field_name, "space_id"),
241 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
242 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
243 + STRUCT_FLD(value, 0),
244 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
245 + STRUCT_FLD(old_name, ""),
246 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
248 + {STRUCT_FLD(field_name, "page_no"),
249 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
250 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
251 + STRUCT_FLD(value, 0),
252 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
253 + STRUCT_FLD(old_name, ""),
254 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
256 + {STRUCT_FLD(field_name, "compressed"),
257 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
258 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
259 + STRUCT_FLD(value, 0),
260 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
261 + STRUCT_FLD(old_name, ""),
262 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
264 + {STRUCT_FLD(field_name, "part_len"),
265 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
266 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
267 + STRUCT_FLD(value, 0),
268 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
269 + STRUCT_FLD(old_name, ""),
270 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
272 + {STRUCT_FLD(field_name, "next_page_no"),
273 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
274 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
275 + STRUCT_FLD(value, 0),
276 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
277 + STRUCT_FLD(old_name, ""),
278 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
280 + {STRUCT_FLD(field_name, "lru_position"),
281 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
282 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
283 + STRUCT_FLD(value, 0),
284 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
285 + STRUCT_FLD(old_name, ""),
286 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
288 + {STRUCT_FLD(field_name, "fix_count"),
289 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
290 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
291 + STRUCT_FLD(value, 0),
292 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
293 + STRUCT_FLD(old_name, ""),
294 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
296 + {STRUCT_FLD(field_name, "flush_type"),
297 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
298 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
299 + STRUCT_FLD(value, 0),
300 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
301 + STRUCT_FLD(old_name, ""),
302 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
304 + END_OF_ST_FIELD_INFO
307 +/***********************************************************************
308 +Fill the dynamic table information_schema.innodb_buffer_pool_pages. */
311 +i_s_innodb_buffer_pool_pages_fill(
312 +/*================*/
313 + /* out: 0 on success, 1 on failure */
314 + THD* thd, /* in: thread */
315 + TABLE_LIST* tables, /* in/out: tables to fill */
316 + COND* cond) /* in: condition (ignored) */
318 + TABLE* table = (TABLE *) tables->table;
322 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_fill");
324 + /* deny access to non-superusers */
325 + if (check_global_access(thd, PROCESS_ACL)) {
330 + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
332 + for (i = 0; i < srv_buf_pool_instances; i++) {
334 + buf_pool_t* buf_pool;
336 + buf_pool = buf_pool_from_array(i);
338 + buf_pool_mutex_enter(buf_pool);
340 + for (n_block = 0; n_block < buf_pool->curr_size; n_block++) {
341 + buf_block_t* block = buf_page_from_array(buf_pool, n_block);
342 + const buf_frame_t* frame = block->frame;
344 + char page_type[64];
346 + switch(fil_page_get_type(frame))
348 + case FIL_PAGE_INDEX:
349 + strcpy(page_type, "index");
351 + case FIL_PAGE_UNDO_LOG:
352 + strcpy(page_type, "undo_log");
354 + case FIL_PAGE_INODE:
355 + strcpy(page_type, "inode");
357 + case FIL_PAGE_IBUF_FREE_LIST:
358 + strcpy(page_type, "ibuf_free_list");
360 + case FIL_PAGE_TYPE_ALLOCATED:
361 + strcpy(page_type, "allocated");
363 + case FIL_PAGE_IBUF_BITMAP:
364 + strcpy(page_type, "bitmap");
366 + case FIL_PAGE_TYPE_SYS:
367 + strcpy(page_type, "sys");
369 + case FIL_PAGE_TYPE_TRX_SYS:
370 + strcpy(page_type, "trx_sys");
372 + case FIL_PAGE_TYPE_FSP_HDR:
373 + strcpy(page_type, "fsp_hdr");
375 + case FIL_PAGE_TYPE_XDES:
376 + strcpy(page_type, "xdes");
378 + case FIL_PAGE_TYPE_BLOB:
379 + strcpy(page_type, "blob");
381 + case FIL_PAGE_TYPE_ZBLOB:
382 + strcpy(page_type, "zblob");
384 + case FIL_PAGE_TYPE_ZBLOB2:
385 + strcpy(page_type, "zblob2");
388 + sprintf(page_type, "unknown (type=%li)", fil_page_get_type(frame));
391 + field_store_string(table->field[0], page_type);
392 + table->field[1]->store(block->page.space);
393 + table->field[2]->store(block->page.offset);
394 + table->field[3]->store(0);
395 + table->field[4]->store(block->page.buf_fix_count);
396 + table->field[5]->store(block->page.flush_type);
398 + if (schema_table_store_record(thd, table)) {
405 + buf_pool_mutex_exit(buf_pool);
408 + DBUG_RETURN(status);
411 +/***********************************************************************
412 +Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
415 +i_s_innodb_buffer_pool_pages_index_fill(
416 +/*================*/
417 + /* out: 0 on success, 1 on failure */
418 + THD* thd, /* in: thread */
419 + TABLE_LIST* tables, /* in/out: tables to fill */
420 + COND* cond) /* in: condition (ignored) */
422 + TABLE* table = (TABLE *) tables->table;
425 + index_id_t index_id;
427 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_fill");
429 + /* deny access to non-superusers */
430 + if (check_global_access(thd, PROCESS_ACL)) {
435 + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
437 + for (i = 0; i < srv_buf_pool_instances; i++) {
439 + buf_pool_t* buf_pool;
441 + buf_pool = buf_pool_from_array(i);
443 + buf_pool_mutex_enter(buf_pool);
445 + for (n_block = 0; n_block < buf_pool->curr_size; n_block++) {
446 + buf_block_t* block = buf_page_from_array(buf_pool, n_block);
447 + const buf_frame_t* frame = block->frame;
449 + if (fil_page_get_type(frame) == FIL_PAGE_INDEX) {
450 + index_id = btr_page_get_index_id(frame);
451 + table->field[0]->store(index_id);
452 + table->field[1]->store(block->page.space);
453 + table->field[2]->store(block->page.offset);
454 + table->field[3]->store(page_get_n_recs(frame));
455 + table->field[4]->store(page_get_data_size(frame));
456 + table->field[5]->store(block->index != NULL);
457 + table->field[6]->store(block->page.access_time);
458 + table->field[7]->store(block->page.newest_modification != 0);
459 + table->field[8]->store(block->page.oldest_modification != 0);
460 + table->field[9]->store(block->page.old);
461 + table->field[10]->store(0);
462 + table->field[11]->store(block->page.buf_fix_count);
463 + table->field[12]->store(block->page.flush_type);
465 + if (schema_table_store_record(thd, table)) {
472 + buf_pool_mutex_exit(buf_pool);
475 + DBUG_RETURN(status);
478 +/***********************************************************************
479 +Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
482 +i_s_innodb_buffer_pool_pages_blob_fill(
483 +/*================*/
484 + /* out: 0 on success, 1 on failure */
485 + THD* thd, /* in: thread */
486 + TABLE_LIST* tables, /* in/out: tables to fill */
487 + COND* cond) /* in: condition (ignored) */
489 + TABLE* table = (TABLE *) tables->table;
494 + ulint next_page_no;
496 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_fill");
498 + /* deny access to non-superusers */
499 + if (check_global_access(thd, PROCESS_ACL)) {
504 + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
506 + for (i = 0; i < srv_buf_pool_instances; i++) {
508 + buf_pool_t* buf_pool;
510 + buf_pool = buf_pool_from_array(i);
512 + buf_pool_mutex_enter(buf_pool);
514 + for (n_block = 0; n_block < buf_pool->curr_size; n_block++) {
515 + buf_block_t* block = buf_page_from_array(buf_pool, n_block);
516 + page_zip_des_t* block_page_zip = buf_block_get_page_zip(block);
517 + const buf_frame_t* frame = block->frame;
519 + if (fil_page_get_type(frame) == FIL_PAGE_TYPE_BLOB) {
521 + if (UNIV_LIKELY_NULL(block_page_zip)) {
522 + part_len = 0; /* hmm, can't figure it out */
524 + next_page_no = mach_read_from_4(
525 + buf_block_get_frame(block)
528 + part_len = mach_read_from_4(
529 + buf_block_get_frame(block)
531 + + 0 /*BTR_BLOB_HDR_PART_LEN*/);
533 + next_page_no = mach_read_from_4(
534 + buf_block_get_frame(block)
536 + + 4 /*BTR_BLOB_HDR_NEXT_PAGE_NO*/);
539 + table->field[0]->store(block->page.space);
540 + table->field[1]->store(block->page.offset);
541 + table->field[2]->store(block_page_zip != NULL);
542 + table->field[3]->store(part_len);
544 + if(next_page_no == FIL_NULL)
546 + table->field[4]->store(0);
548 + table->field[4]->store(block->page.offset);
551 + table->field[5]->store(0);
552 + table->field[6]->store(block->page.buf_fix_count);
553 + table->field[7]->store(block->page.flush_type);
555 + if (schema_table_store_record(thd, table)) {
563 + buf_pool_mutex_exit(buf_pool);
566 + DBUG_RETURN(status);
569 +/***********************************************************************
570 +Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
573 +i_s_innodb_buffer_pool_pages_init(
575 + /* out: 0 on success */
576 + void* p) /* in/out: table schema object */
578 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_init");
579 + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
581 + schema->fields_info = i_s_innodb_buffer_pool_pages_fields_info;
582 + schema->fill_table = i_s_innodb_buffer_pool_pages_fill;
587 +/***********************************************************************
588 +Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
591 +i_s_innodb_buffer_pool_pages_index_init(
593 + /* out: 0 on success */
594 + void* p) /* in/out: table schema object */
596 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_init");
597 + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
599 + schema->fields_info = i_s_innodb_buffer_pool_pages_index_fields_info;
600 + schema->fill_table = i_s_innodb_buffer_pool_pages_index_fill;
605 +/***********************************************************************
606 +Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
609 +i_s_innodb_buffer_pool_pages_blob_init(
611 + /* out: 0 on success */
612 + void* p) /* in/out: table schema object */
614 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_init");
615 + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
617 + schema->fields_info = i_s_innodb_buffer_pool_pages_blob_fields_info;
618 + schema->fill_table = i_s_innodb_buffer_pool_pages_blob_fill;
624 +UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages =
626 + /* the plugin type (a MYSQL_XXX_PLUGIN value) */
628 + STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
630 + /* pointer to type-specific plugin descriptor */
632 + STRUCT_FLD(info, &i_s_info),
636 + STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES"),
638 + /* plugin author (for SHOW PLUGINS) */
640 + STRUCT_FLD(author, "Percona"),
642 + /* general descriptive text (for SHOW PLUGINS) */
644 + STRUCT_FLD(descr, "InnoDB buffer pool pages"),
646 + /* the plugin license (PLUGIN_LICENSE_XXX) */
648 + STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
650 + /* the function to invoke when plugin is loaded */
651 + /* int (*)(void*); */
652 + STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_init),
654 + /* the function to invoke when plugin is unloaded */
655 + /* int (*)(void*); */
656 + STRUCT_FLD(deinit, i_s_common_deinit),
658 + /* plugin version (for SHOW PLUGINS) */
660 + STRUCT_FLD(version, 0x0100 /* 1.0 */),
662 + /* struct st_mysql_show_var* */
663 + STRUCT_FLD(status_vars, NULL),
665 + /* struct st_mysql_sys_var** */
666 + STRUCT_FLD(system_vars, NULL),
668 + /* reserved for dependency checking */
670 + STRUCT_FLD(__reserved1, NULL),
672 + /* flags for plugin */
673 + /* unsigned long */
674 + STRUCT_FLD(flags, 0UL)
677 +UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index =
679 + /* the plugin type (a MYSQL_XXX_PLUGIN value) */
681 + STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
683 + /* pointer to type-specific plugin descriptor */
685 + STRUCT_FLD(info, &i_s_info),
689 + STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_INDEX"),
691 + /* plugin author (for SHOW PLUGINS) */
693 + STRUCT_FLD(author, "Percona"),
695 + /* general descriptive text (for SHOW PLUGINS) */
697 + STRUCT_FLD(descr, "InnoDB buffer pool index pages"),
699 + /* the plugin license (PLUGIN_LICENSE_XXX) */
701 + STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
703 + /* the function to invoke when plugin is loaded */
704 + /* int (*)(void*); */
705 + STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_index_init),
707 + /* the function to invoke when plugin is unloaded */
708 + /* int (*)(void*); */
709 + STRUCT_FLD(deinit, i_s_common_deinit),
711 + /* plugin version (for SHOW PLUGINS) */
713 + STRUCT_FLD(version, 0x0100 /* 1.0 */),
715 + /* struct st_mysql_show_var* */
716 + STRUCT_FLD(status_vars, NULL),
718 + /* struct st_mysql_sys_var** */
719 + STRUCT_FLD(system_vars, NULL),
721 + /* reserved for dependency checking */
723 + STRUCT_FLD(__reserved1, NULL),
725 + /* flags for plugin */
726 + /* unsigned long */
727 + STRUCT_FLD(flags, 0UL)
730 +UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob =
732 + /* the plugin type (a MYSQL_XXX_PLUGIN value) */
734 + STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
736 + /* pointer to type-specific plugin descriptor */
738 + STRUCT_FLD(info, &i_s_info),
742 + STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_BLOB"),
744 + /* plugin author (for SHOW PLUGINS) */
746 + STRUCT_FLD(author, "Percona"),
748 + /* general descriptive text (for SHOW PLUGINS) */
750 + STRUCT_FLD(descr, "InnoDB buffer pool blob pages"),
752 + /* the plugin license (PLUGIN_LICENSE_XXX) */
754 + STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
756 + /* the function to invoke when plugin is loaded */
757 + /* int (*)(void*); */
758 + STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_blob_init),
760 + /* the function to invoke when plugin is unloaded */
761 + /* int (*)(void*); */
762 + STRUCT_FLD(deinit, i_s_common_deinit),
764 + /* plugin version (for SHOW PLUGINS) */
766 + STRUCT_FLD(version, 0x0100 /* 1.0 */),
768 + /* struct st_mysql_show_var* */
769 + STRUCT_FLD(status_vars, NULL),
771 + /* struct st_mysql_sys_var** */
772 + STRUCT_FLD(system_vars, NULL),
774 + /* reserved for dependency checking */
776 + STRUCT_FLD(__reserved1, NULL),
778 + /* flags for plugin */
779 + /* unsigned long */
780 + STRUCT_FLD(flags, 0UL)
783 --- a/storage/innobase/handler/i_s.h
784 +++ b/storage/innobase/handler/i_s.h
786 extern struct st_mysql_plugin i_s_innodb_table_stats;
787 extern struct st_mysql_plugin i_s_innodb_index_stats;
788 extern struct st_mysql_plugin i_s_innodb_admin_command;
789 +extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages;
790 +extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index;
791 +extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob;
794 --- a/storage/innobase/include/buf0buf.h
795 +++ b/storage/innobase/include/buf0buf.h
796 @@ -1181,6 +1181,14 @@
798 const buf_pool_t* buf_pool) /*!< in: buffer pool */
799 __attribute__((nonnull, const));
800 +/********************************************************************//**
804 +buf_page_from_array(
805 +/*================*/
806 + buf_pool_t* buf_pool,
808 /******************************************************************//**
809 Returns the buffer pool instance given a page instance