diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 100845a081b..39130049c33 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -1688,9 +1688,9 @@ select count(*) from t1 where x = 18446744073709551601; count(*) 1 drop table t1; -SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; -variable_value -ok +SELECT IF(variable_value BETWEEN 488 AND 512, 'OK', variable_value) FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; +IF(variable_value BETWEEN 488 AND 512, 'OK', variable_value) +OK SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size'; variable_value 16384 diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index dd8a67eeec2..985376446c3 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1321,8 +1321,7 @@ drop table t1; # Test for testable InnoDB status variables. This test # uses previous ones(pages_created, rows_deleted, ...). ---replace_result 511 ok 512 ok 2047 ok 513 ok 514 ok 515 ok -SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; +SELECT IF(variable_value BETWEEN 488 AND 512, 'OK', variable_value) FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size'; SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted'; SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted'; diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index d5c7e317f92..92a880e70ed 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1587,11 +1587,6 @@ buf_chunk_init( /* Round down to a multiple of page size, although it already should be. */ mem_size = ut_2pow_round(mem_size, ulint(srv_page_size)); - /* Reserve space for the block descriptors. */ - mem_size += ut_2pow_round((mem_size >> srv_page_size_shift) - * (sizeof *block) - + (srv_page_size - 1), - ulint(srv_page_size)); DBUG_EXECUTE_IF("ib_buf_chunk_init_fails", return(NULL);); @@ -1913,8 +1908,7 @@ buf_pool_init_instance( ut_min(BUF_READ_AHEAD_PAGES, ut_2_power_up(buf_pool->curr_size / BUF_READ_AHEAD_PORTION)); - buf_pool->curr_pool_size = buf_pool->curr_size - << srv_page_size_shift; + buf_pool->curr_pool_size = buf_pool_size; buf_pool->old_size = buf_pool->curr_size; buf_pool->n_chunks_new = buf_pool->n_chunks; @@ -2718,12 +2712,12 @@ buf_pool_resize() ut_ad(UT_LIST_GET_LEN(buf_pool->withdraw) == 0); ut_ad(buf_pool->flush_rbt == NULL); - buf_pool->curr_size = new_instance_size; - buf_pool->n_chunks_new = (new_instance_size << srv_page_size_shift) / srv_buf_pool_chunk_unit; + buf_pool->curr_size = buf_pool->n_chunks_new * buf_pool->chunks->size; + buf_pool_mutex_exit(buf_pool); } #ifdef BTR_CUR_HASH_ADAPT @@ -3053,7 +3047,7 @@ calc_buf_pool_size: ut_2_power_up(buf_pool->curr_size / BUF_READ_AHEAD_PORTION)); buf_pool->curr_pool_size - = buf_pool->curr_size << srv_page_size_shift; + = buf_pool->n_chunks * srv_buf_pool_chunk_unit; curr_size += buf_pool->curr_pool_size; buf_pool->old_size = buf_pool->curr_size; }