Commit e91e55d6 authored by grog@mysql.com's avatar grog@mysql.com

set_var.cc, mysqld.cc, ha_innodb.h:

  BUG#12701: SHOW VARIABLES does not show correct size of buffer pool.
ha_innodb.cc:
  BUG#12701: SHOW VARIABLES does not show correct size of buffer pool
parent f0e558c1
...@@ -142,15 +142,16 @@ uint innobase_init_flags = 0; ...@@ -142,15 +142,16 @@ uint innobase_init_flags = 0;
ulong innobase_cache_size = 0; ulong innobase_cache_size = 0;
ulong innobase_large_page_size = 0; ulong innobase_large_page_size = 0;
/* The default values for the following, type long, start-up parameters /* The default values for the following, type long or longlong, start-up
are declared in mysqld.cc: */ parameters are declared in mysqld.cc: */
long innobase_mirrored_log_groups, innobase_log_files_in_group, long innobase_mirrored_log_groups, innobase_log_files_in_group,
innobase_log_file_size, innobase_log_buffer_size, innobase_log_buffer_size, innobase_buffer_pool_awe_mem_mb,
innobase_buffer_pool_awe_mem_mb, innobase_additional_mem_pool_size, innobase_file_io_threads,
innobase_buffer_pool_size, innobase_additional_mem_pool_size, innobase_lock_wait_timeout, innobase_force_recovery,
innobase_file_io_threads, innobase_lock_wait_timeout, innobase_open_files;
innobase_force_recovery, innobase_open_files;
longlong innobase_buffer_pool_size, innobase_log_file_size;
/* The default values for the following char* start-up parameters /* The default values for the following char* start-up parameters
are determined in innobase_init below: */ are determined in innobase_init below: */
...@@ -1210,6 +1211,25 @@ innobase_init(void) ...@@ -1210,6 +1211,25 @@ innobase_init(void)
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
/* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) {
if (innobase_buffer_pool_size > UINT_MAX32) {
sql_print_error(
"innobase_buffer_pool_size can't be over 4GB"
" on 32-bit systems");
DBUG_RETURN(0);
}
if (innobase_log_file_size > UINT_MAX32) {
sql_print_error(
"innobase_log_file_size can't be over 4GB"
" on 32-bit systems");
DBUG_RETURN(0);
}
}
os_innodb_umask = (ulint)my_umask; os_innodb_umask = (ulint)my_umask;
/* First calculate the default path for innodb_data_home_dir etc., /* First calculate the default path for innodb_data_home_dir etc.,
......
...@@ -206,8 +206,9 @@ extern ulong innobase_large_page_size; ...@@ -206,8 +206,9 @@ extern ulong innobase_large_page_size;
extern char *innobase_home, *innobase_tmpdir, *innobase_logdir; extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
extern long innobase_lock_scan_time; extern long innobase_lock_scan_time;
extern long innobase_mirrored_log_groups, innobase_log_files_in_group; extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
extern long innobase_log_file_size, innobase_log_buffer_size; extern longlong innobase_buffer_pool_size, innobase_log_file_size;
extern long innobase_buffer_pool_size, innobase_additional_mem_pool_size; extern long innobase_log_buffer_size;
extern long innobase_additional_mem_pool_size;
extern long innobase_buffer_pool_awe_mem_mb; extern long innobase_buffer_pool_awe_mem_mb;
extern long innobase_file_io_threads, innobase_lock_wait_timeout; extern long innobase_file_io_threads, innobase_lock_wait_timeout;
extern long innobase_force_recovery; extern long innobase_force_recovery;
......
...@@ -5418,7 +5418,8 @@ log and this option does nothing anymore.", ...@@ -5418,7 +5418,8 @@ log and this option does nothing anymore.",
{"innodb_buffer_pool_size", OPT_INNODB_BUFFER_POOL_SIZE, {"innodb_buffer_pool_size", OPT_INNODB_BUFFER_POOL_SIZE,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
(gptr*) &innobase_buffer_pool_size, (gptr*) &innobase_buffer_pool_size, 0, (gptr*) &innobase_buffer_pool_size, (gptr*) &innobase_buffer_pool_size, 0,
GET_LONG, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, ~0L, 0, 1024*1024L, 0}, GET_LL, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, LONGLONG_MAX, 0,
1024*1024L, 0},
{"innodb_concurrency_tickets", OPT_INNODB_CONCURRENCY_TICKETS, {"innodb_concurrency_tickets", OPT_INNODB_CONCURRENCY_TICKETS,
"Number of times a thread is allowed to enter InnoDB within the same \ "Number of times a thread is allowed to enter InnoDB within the same \
SQL query after it has once got the ticket", SQL query after it has once got the ticket",
...@@ -5442,9 +5443,10 @@ log and this option does nothing anymore.", ...@@ -5442,9 +5443,10 @@ log and this option does nothing anymore.",
(gptr*) &innobase_log_buffer_size, (gptr*) &innobase_log_buffer_size, 0, (gptr*) &innobase_log_buffer_size, (gptr*) &innobase_log_buffer_size, 0,
GET_LONG, REQUIRED_ARG, 1024*1024L, 256*1024L, ~0L, 0, 1024, 0}, GET_LONG, REQUIRED_ARG, 1024*1024L, 256*1024L, ~0L, 0, 1024, 0},
{"innodb_log_file_size", OPT_INNODB_LOG_FILE_SIZE, {"innodb_log_file_size", OPT_INNODB_LOG_FILE_SIZE,
"Size of each log file in a log group in megabytes.", "Size of each log file in a log group.",
(gptr*) &innobase_log_file_size, (gptr*) &innobase_log_file_size, 0, (gptr*) &innobase_log_file_size, (gptr*) &innobase_log_file_size, 0,
GET_LONG, REQUIRED_ARG, 5*1024*1024L, 1*1024*1024L, ~0L, 0, 1024*1024L, 0}, GET_LL, REQUIRED_ARG, 5*1024*1024L, 1*1024*1024L, LONGLONG_MAX, 0,
1024*1024L, 0},
{"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP, {"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP,
"Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.", "Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.",
(gptr*) &innobase_log_files_in_group, (gptr*) &innobase_log_files_in_group, (gptr*) &innobase_log_files_in_group, (gptr*) &innobase_log_files_in_group,
......
...@@ -818,7 +818,7 @@ struct show_var_st init_vars[]= { ...@@ -818,7 +818,7 @@ struct show_var_st init_vars[]= {
{"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG }, {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG },
{sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS}, {sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS},
{"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG }, {"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG },
{"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG }, {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONGLONG },
{"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL}, {"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL},
{sys_innodb_commit_concurrency.name, (char*) &sys_innodb_commit_concurrency, SHOW_SYS}, {sys_innodb_commit_concurrency.name, (char*) &sys_innodb_commit_concurrency, SHOW_SYS},
{sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS}, {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS},
...@@ -836,7 +836,7 @@ struct show_var_st init_vars[]= { ...@@ -836,7 +836,7 @@ struct show_var_st init_vars[]= {
{"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR}, {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR},
{"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL}, {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL},
{"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG }, {"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG },
{"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONG}, {"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONGLONG},
{"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG}, {"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG},
{"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR},
{sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS}, {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment