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 diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
9 --- a/storage/innobase/buf/buf0buf.c 2010-12-04 20:20:44.595483291 +0900
10 +++ b/storage/innobase/buf/buf0buf.c 2010-12-06 19:28:04.055227506 +0900
11 @@ -4515,6 +4515,36 @@
12 mutex_exit(block_mutex);
15 +/********************************************************************//**
21 + buf_pool_t* buf_pool,
24 + ulint n_chunks, offset;
27 + ut_a(n_block < buf_pool->curr_size);
29 + chunk = buf_pool->chunks;
32 + for (n_chunks = buf_pool->n_chunks; n_chunks--; chunk++) {
33 + if (offset < chunk->size) {
34 + return(&chunk->blocks[offset]);
37 + offset -= chunk->size;
45 /*********************************************************************//**
46 Asserts that all file pages in the buffer are in a replaceable state.
48 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
49 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 20:20:44.614551139 +0900
50 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-06 19:23:47.622195800 +0900
51 @@ -12042,6 +12042,9 @@
53 i_s_innodb_table_stats,
54 i_s_innodb_index_stats,
55 +i_s_innodb_buffer_pool_pages,
56 +i_s_innodb_buffer_pool_pages_index,
57 +i_s_innodb_buffer_pool_pages_blob,
58 i_s_innodb_admin_command
59 mysql_declare_plugin_end;
61 diff -ruN a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
62 --- a/storage/innobase/handler/i_s.cc 2010-12-04 19:46:39.786513783 +0900
63 +++ b/storage/innobase/handler/i_s.cc 2010-12-06 19:28:52.270226921 +0900
65 #include "trx0sys.h" /* for trx_sys */
66 #include "dict0dict.h" /* for dict_sys */
67 #include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
68 +#include "btr0btr.h" /* for btr_page_get_index_id */
71 static const char plugin_author[] = "Innobase Oy";
72 @@ -4328,3 +4329,701 @@
73 STRUCT_FLD(system_vars, NULL),
74 STRUCT_FLD(__reserved1, NULL)
77 +/***********************************************************************
79 +static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_fields_info[] =
81 + {STRUCT_FLD(field_name, "page_type"),
82 + STRUCT_FLD(field_length, 64),
83 + STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
84 + STRUCT_FLD(value, 0),
85 + STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
86 + STRUCT_FLD(old_name, ""),
87 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
89 + {STRUCT_FLD(field_name, "space_id"),
90 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
91 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
92 + STRUCT_FLD(value, 0),
93 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
94 + STRUCT_FLD(old_name, ""),
95 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
97 + {STRUCT_FLD(field_name, "page_no"),
98 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
99 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
100 + STRUCT_FLD(value, 0),
101 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
102 + STRUCT_FLD(old_name, ""),
103 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
105 + {STRUCT_FLD(field_name, "lru_position"),
106 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
107 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
108 + STRUCT_FLD(value, 0),
109 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
110 + STRUCT_FLD(old_name, ""),
111 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
113 + {STRUCT_FLD(field_name, "fix_count"),
114 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
115 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
116 + STRUCT_FLD(value, 0),
117 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
118 + STRUCT_FLD(old_name, ""),
119 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
121 + {STRUCT_FLD(field_name, "flush_type"),
122 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
123 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
124 + STRUCT_FLD(value, 0),
125 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
126 + STRUCT_FLD(old_name, ""),
127 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
129 + END_OF_ST_FIELD_INFO
132 +static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_index_fields_info[] =
134 + {STRUCT_FLD(field_name, "index_id"),
135 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
136 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
137 + STRUCT_FLD(value, 0),
138 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
139 + STRUCT_FLD(old_name, ""),
140 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
142 + {STRUCT_FLD(field_name, "space_id"),
143 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
144 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
145 + STRUCT_FLD(value, 0),
146 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
147 + STRUCT_FLD(old_name, ""),
148 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
150 + {STRUCT_FLD(field_name, "page_no"),
151 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
152 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
153 + STRUCT_FLD(value, 0),
154 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
155 + STRUCT_FLD(old_name, ""),
156 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
158 + {STRUCT_FLD(field_name, "n_recs"),
159 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
160 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
161 + STRUCT_FLD(value, 0),
162 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
163 + STRUCT_FLD(old_name, ""),
164 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
166 + {STRUCT_FLD(field_name, "data_size"),
167 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
168 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
169 + STRUCT_FLD(value, 0),
170 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
171 + STRUCT_FLD(old_name, ""),
172 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
174 + {STRUCT_FLD(field_name, "hashed"),
175 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
176 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
177 + STRUCT_FLD(value, 0),
178 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
179 + STRUCT_FLD(old_name, ""),
180 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
182 + {STRUCT_FLD(field_name, "access_time"),
183 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
184 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
185 + STRUCT_FLD(value, 0),
186 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
187 + STRUCT_FLD(old_name, ""),
188 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
190 + {STRUCT_FLD(field_name, "modified"),
191 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
192 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
193 + STRUCT_FLD(value, 0),
194 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
195 + STRUCT_FLD(old_name, ""),
196 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
198 + {STRUCT_FLD(field_name, "dirty"),
199 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
200 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
201 + STRUCT_FLD(value, 0),
202 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
203 + STRUCT_FLD(old_name, ""),
204 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
206 + {STRUCT_FLD(field_name, "old"),
207 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
208 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
209 + STRUCT_FLD(value, 0),
210 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
211 + STRUCT_FLD(old_name, ""),
212 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
214 + {STRUCT_FLD(field_name, "lru_position"),
215 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
216 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
217 + STRUCT_FLD(value, 0),
218 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
219 + STRUCT_FLD(old_name, ""),
220 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
222 + {STRUCT_FLD(field_name, "fix_count"),
223 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
224 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
225 + STRUCT_FLD(value, 0),
226 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
227 + STRUCT_FLD(old_name, ""),
228 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
230 + {STRUCT_FLD(field_name, "flush_type"),
231 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
232 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
233 + STRUCT_FLD(value, 0),
234 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
235 + STRUCT_FLD(old_name, ""),
236 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
238 + END_OF_ST_FIELD_INFO
241 +static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_blob_fields_info[] =
243 + {STRUCT_FLD(field_name, "space_id"),
244 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
245 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
246 + STRUCT_FLD(value, 0),
247 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
248 + STRUCT_FLD(old_name, ""),
249 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
251 + {STRUCT_FLD(field_name, "page_no"),
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 + {STRUCT_FLD(field_name, "compressed"),
260 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
261 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
262 + STRUCT_FLD(value, 0),
263 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
264 + STRUCT_FLD(old_name, ""),
265 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
267 + {STRUCT_FLD(field_name, "part_len"),
268 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
269 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
270 + STRUCT_FLD(value, 0),
271 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
272 + STRUCT_FLD(old_name, ""),
273 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
275 + {STRUCT_FLD(field_name, "next_page_no"),
276 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
277 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
278 + STRUCT_FLD(value, 0),
279 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
280 + STRUCT_FLD(old_name, ""),
281 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
283 + {STRUCT_FLD(field_name, "lru_position"),
284 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
285 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
286 + STRUCT_FLD(value, 0),
287 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
288 + STRUCT_FLD(old_name, ""),
289 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
291 + {STRUCT_FLD(field_name, "fix_count"),
292 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
293 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
294 + STRUCT_FLD(value, 0),
295 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
296 + STRUCT_FLD(old_name, ""),
297 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
299 + {STRUCT_FLD(field_name, "flush_type"),
300 + STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
301 + STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
302 + STRUCT_FLD(value, 0),
303 + STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
304 + STRUCT_FLD(old_name, ""),
305 + STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
307 + END_OF_ST_FIELD_INFO
310 +/***********************************************************************
311 +Fill the dynamic table information_schema.innodb_buffer_pool_pages. */
314 +i_s_innodb_buffer_pool_pages_fill(
315 +/*================*/
316 + /* out: 0 on success, 1 on failure */
317 + THD* thd, /* in: thread */
318 + TABLE_LIST* tables, /* in/out: tables to fill */
319 + COND* cond) /* in: condition (ignored) */
321 + TABLE* table = (TABLE *) tables->table;
325 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_fill");
327 + /* deny access to non-superusers */
328 + if (check_global_access(thd, PROCESS_ACL)) {
333 + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
335 + for (i = 0; i < srv_buf_pool_instances; i++) {
337 + buf_pool_t* buf_pool;
339 + buf_pool = buf_pool_from_array(i);
341 + buf_pool_mutex_enter(buf_pool);
343 + for (n_block = 0; n_block < buf_pool->curr_size; n_block++) {
344 + buf_block_t* block = buf_page_from_array(buf_pool, n_block);
345 + const buf_frame_t* frame = block->frame;
347 + char page_type[64];
349 + switch(fil_page_get_type(frame))
351 + case FIL_PAGE_INDEX:
352 + strcpy(page_type, "index");
354 + case FIL_PAGE_UNDO_LOG:
355 + strcpy(page_type, "undo_log");
357 + case FIL_PAGE_INODE:
358 + strcpy(page_type, "inode");
360 + case FIL_PAGE_IBUF_FREE_LIST:
361 + strcpy(page_type, "ibuf_free_list");
363 + case FIL_PAGE_TYPE_ALLOCATED:
364 + strcpy(page_type, "allocated");
366 + case FIL_PAGE_IBUF_BITMAP:
367 + strcpy(page_type, "bitmap");
369 + case FIL_PAGE_TYPE_SYS:
370 + strcpy(page_type, "sys");
372 + case FIL_PAGE_TYPE_TRX_SYS:
373 + strcpy(page_type, "trx_sys");
375 + case FIL_PAGE_TYPE_FSP_HDR:
376 + strcpy(page_type, "fsp_hdr");
378 + case FIL_PAGE_TYPE_XDES:
379 + strcpy(page_type, "xdes");
381 + case FIL_PAGE_TYPE_BLOB:
382 + strcpy(page_type, "blob");
384 + case FIL_PAGE_TYPE_ZBLOB:
385 + strcpy(page_type, "zblob");
387 + case FIL_PAGE_TYPE_ZBLOB2:
388 + strcpy(page_type, "zblob2");
391 + sprintf(page_type, "unknown (type=%li)", fil_page_get_type(frame));
394 + field_store_string(table->field[0], page_type);
395 + table->field[1]->store(block->page.space);
396 + table->field[2]->store(block->page.offset);
397 + table->field[3]->store(0);
398 + table->field[4]->store(block->page.buf_fix_count);
399 + table->field[5]->store(block->page.flush_type);
401 + if (schema_table_store_record(thd, table)) {
408 + buf_pool_mutex_exit(buf_pool);
411 + DBUG_RETURN(status);
414 +/***********************************************************************
415 +Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
418 +i_s_innodb_buffer_pool_pages_index_fill(
419 +/*================*/
420 + /* out: 0 on success, 1 on failure */
421 + THD* thd, /* in: thread */
422 + TABLE_LIST* tables, /* in/out: tables to fill */
423 + COND* cond) /* in: condition (ignored) */
425 + TABLE* table = (TABLE *) tables->table;
428 + index_id_t index_id;
430 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_fill");
432 + /* deny access to non-superusers */
433 + if (check_global_access(thd, PROCESS_ACL)) {
438 + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
440 + for (i = 0; i < srv_buf_pool_instances; i++) {
442 + buf_pool_t* buf_pool;
444 + buf_pool = buf_pool_from_array(i);
446 + buf_pool_mutex_enter(buf_pool);
448 + for (n_block = 0; n_block < buf_pool->curr_size; n_block++) {
449 + buf_block_t* block = buf_page_from_array(buf_pool, n_block);
450 + const buf_frame_t* frame = block->frame;
452 + if (fil_page_get_type(frame) == FIL_PAGE_INDEX) {
453 + index_id = btr_page_get_index_id(frame);
454 + table->field[0]->store(index_id);
455 + table->field[1]->store(block->page.space);
456 + table->field[2]->store(block->page.offset);
457 + table->field[3]->store(page_get_n_recs(frame));
458 + table->field[4]->store(page_get_data_size(frame));
459 + table->field[5]->store(block->is_hashed);
460 + table->field[6]->store(block->page.access_time);
461 + table->field[7]->store(block->page.newest_modification != 0);
462 + table->field[8]->store(block->page.oldest_modification != 0);
463 + table->field[9]->store(block->page.old);
464 + table->field[10]->store(0);
465 + table->field[11]->store(block->page.buf_fix_count);
466 + table->field[12]->store(block->page.flush_type);
468 + if (schema_table_store_record(thd, table)) {
475 + buf_pool_mutex_exit(buf_pool);
478 + DBUG_RETURN(status);
481 +/***********************************************************************
482 +Fill the dynamic table information_schema.innodb_buffer_pool_pages_index. */
485 +i_s_innodb_buffer_pool_pages_blob_fill(
486 +/*================*/
487 + /* out: 0 on success, 1 on failure */
488 + THD* thd, /* in: thread */
489 + TABLE_LIST* tables, /* in/out: tables to fill */
490 + COND* cond) /* in: condition (ignored) */
492 + TABLE* table = (TABLE *) tables->table;
497 + ulint next_page_no;
499 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_fill");
501 + /* deny access to non-superusers */
502 + if (check_global_access(thd, PROCESS_ACL)) {
507 + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
509 + for (i = 0; i < srv_buf_pool_instances; i++) {
511 + buf_pool_t* buf_pool;
513 + buf_pool = buf_pool_from_array(i);
515 + buf_pool_mutex_enter(buf_pool);
517 + for (n_block = 0; n_block < buf_pool->curr_size; n_block++) {
518 + buf_block_t* block = buf_page_from_array(buf_pool, n_block);
519 + page_zip_des_t* block_page_zip = buf_block_get_page_zip(block);
520 + const buf_frame_t* frame = block->frame;
522 + if (fil_page_get_type(frame) == FIL_PAGE_TYPE_BLOB) {
524 + if (UNIV_LIKELY_NULL(block_page_zip)) {
525 + part_len = 0; /* hmm, can't figure it out */
527 + next_page_no = mach_read_from_4(
528 + buf_block_get_frame(block)
531 + part_len = mach_read_from_4(
532 + buf_block_get_frame(block)
534 + + 0 /*BTR_BLOB_HDR_PART_LEN*/);
536 + next_page_no = mach_read_from_4(
537 + buf_block_get_frame(block)
539 + + 4 /*BTR_BLOB_HDR_NEXT_PAGE_NO*/);
542 + table->field[0]->store(block->page.space);
543 + table->field[1]->store(block->page.offset);
544 + table->field[2]->store(block_page_zip != NULL);
545 + table->field[3]->store(part_len);
547 + if(next_page_no == FIL_NULL)
549 + table->field[4]->store(0);
551 + table->field[4]->store(block->page.offset);
554 + table->field[5]->store(0);
555 + table->field[6]->store(block->page.buf_fix_count);
556 + table->field[7]->store(block->page.flush_type);
558 + if (schema_table_store_record(thd, table)) {
566 + buf_pool_mutex_exit(buf_pool);
569 + DBUG_RETURN(status);
572 +/***********************************************************************
573 +Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
576 +i_s_innodb_buffer_pool_pages_init(
578 + /* out: 0 on success */
579 + void* p) /* in/out: table schema object */
581 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_init");
582 + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
584 + schema->fields_info = i_s_innodb_buffer_pool_pages_fields_info;
585 + schema->fill_table = i_s_innodb_buffer_pool_pages_fill;
590 +/***********************************************************************
591 +Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
594 +i_s_innodb_buffer_pool_pages_index_init(
596 + /* out: 0 on success */
597 + void* p) /* in/out: table schema object */
599 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_index_init");
600 + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
602 + schema->fields_info = i_s_innodb_buffer_pool_pages_index_fields_info;
603 + schema->fill_table = i_s_innodb_buffer_pool_pages_index_fill;
608 +/***********************************************************************
609 +Bind the dynamic table information_schema.innodb_buffer_pool_pages. */
612 +i_s_innodb_buffer_pool_pages_blob_init(
614 + /* out: 0 on success */
615 + void* p) /* in/out: table schema object */
617 + DBUG_ENTER("i_s_innodb_buffer_pool_pages_blob_init");
618 + ST_SCHEMA_TABLE* schema = (ST_SCHEMA_TABLE*) p;
620 + schema->fields_info = i_s_innodb_buffer_pool_pages_blob_fields_info;
621 + schema->fill_table = i_s_innodb_buffer_pool_pages_blob_fill;
627 +UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages =
629 + /* the plugin type (a MYSQL_XXX_PLUGIN value) */
631 + STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
633 + /* pointer to type-specific plugin descriptor */
635 + STRUCT_FLD(info, &i_s_info),
639 + STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES"),
641 + /* plugin author (for SHOW PLUGINS) */
643 + STRUCT_FLD(author, plugin_author),
645 + /* general descriptive text (for SHOW PLUGINS) */
647 + STRUCT_FLD(descr, "InnoDB buffer pool pages"),
649 + /* the plugin license (PLUGIN_LICENSE_XXX) */
651 + STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
653 + /* the function to invoke when plugin is loaded */
654 + /* int (*)(void*); */
655 + STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_init),
657 + /* the function to invoke when plugin is unloaded */
658 + /* int (*)(void*); */
659 + STRUCT_FLD(deinit, i_s_common_deinit),
661 + /* plugin version (for SHOW PLUGINS) */
663 + STRUCT_FLD(version, 0x0100 /* 1.0 */),
665 + /* struct st_mysql_show_var* */
666 + STRUCT_FLD(status_vars, NULL),
668 + /* struct st_mysql_sys_var** */
669 + STRUCT_FLD(system_vars, NULL),
671 + /* reserved for dependency checking */
673 + STRUCT_FLD(__reserved1, NULL)
676 +UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index =
678 + /* the plugin type (a MYSQL_XXX_PLUGIN value) */
680 + STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
682 + /* pointer to type-specific plugin descriptor */
684 + STRUCT_FLD(info, &i_s_info),
688 + STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_INDEX"),
690 + /* plugin author (for SHOW PLUGINS) */
692 + STRUCT_FLD(author, plugin_author),
694 + /* general descriptive text (for SHOW PLUGINS) */
696 + STRUCT_FLD(descr, "InnoDB buffer pool index pages"),
698 + /* the plugin license (PLUGIN_LICENSE_XXX) */
700 + STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
702 + /* the function to invoke when plugin is loaded */
703 + /* int (*)(void*); */
704 + STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_index_init),
706 + /* the function to invoke when plugin is unloaded */
707 + /* int (*)(void*); */
708 + STRUCT_FLD(deinit, i_s_common_deinit),
710 + /* plugin version (for SHOW PLUGINS) */
712 + STRUCT_FLD(version, 0x0100 /* 1.0 */),
714 + /* struct st_mysql_show_var* */
715 + STRUCT_FLD(status_vars, NULL),
717 + /* struct st_mysql_sys_var** */
718 + STRUCT_FLD(system_vars, NULL),
720 + /* reserved for dependency checking */
722 + STRUCT_FLD(__reserved1, NULL)
725 +UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob =
727 + /* the plugin type (a MYSQL_XXX_PLUGIN value) */
729 + STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
731 + /* pointer to type-specific plugin descriptor */
733 + STRUCT_FLD(info, &i_s_info),
737 + STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_BLOB"),
739 + /* plugin author (for SHOW PLUGINS) */
741 + STRUCT_FLD(author, plugin_author),
743 + /* general descriptive text (for SHOW PLUGINS) */
745 + STRUCT_FLD(descr, "InnoDB buffer pool blob pages"),
747 + /* the plugin license (PLUGIN_LICENSE_XXX) */
749 + STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
751 + /* the function to invoke when plugin is loaded */
752 + /* int (*)(void*); */
753 + STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_blob_init),
755 + /* the function to invoke when plugin is unloaded */
756 + /* int (*)(void*); */
757 + STRUCT_FLD(deinit, i_s_common_deinit),
759 + /* plugin version (for SHOW PLUGINS) */
761 + STRUCT_FLD(version, 0x0100 /* 1.0 */),
763 + /* struct st_mysql_show_var* */
764 + STRUCT_FLD(status_vars, NULL),
766 + /* struct st_mysql_sys_var** */
767 + STRUCT_FLD(system_vars, NULL),
769 + /* reserved for dependency checking */
771 + STRUCT_FLD(__reserved1, NULL)
774 diff -ruN a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h
775 --- a/storage/innobase/handler/i_s.h 2010-12-04 19:46:39.657513849 +0900
776 +++ b/storage/innobase/handler/i_s.h 2010-12-06 19:23:47.635192988 +0900
778 extern struct st_mysql_plugin i_s_innodb_table_stats;
779 extern struct st_mysql_plugin i_s_innodb_index_stats;
780 extern struct st_mysql_plugin i_s_innodb_admin_command;
781 +extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages;
782 +extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index;
783 +extern struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob;
786 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
787 --- a/storage/innobase/include/buf0buf.h 2010-12-04 19:46:40.197471531 +0900
788 +++ b/storage/innobase/include/buf0buf.h 2010-12-06 19:23:47.638195824 +0900
789 @@ -1143,6 +1143,14 @@
791 const buf_pool_t* buf_pool) /*!< in: buffer pool */
792 __attribute__((nonnull, const));
793 +/********************************************************************//**
797 +buf_page_from_array(
798 +/*================*/
799 + buf_pool_t* buf_pool,
801 /******************************************************************//**
802 Returns the buffer pool instance given a page instance