Commit 9f962b0d authored by marko's avatar marko

branches/zip: Make innodb_file_per_table a settable global variable.

There is one consideration: fil_init() chooses the tablespace hash size
based on the initial value of srv_file_per_table.  However, this is nothing
new: InnoDB could be started with innodb_file_per_table=0 even though
*.ibd files exist.

srv_file_per_table: Declare as my_bool instead of ibool, because
MYSQL_SYSVAR_BOOL() expects a pointer to my_bool.  Document the
variable also in srv0srv.h.

innobase_start_or_create_for_mysql(): Note why it is OK to temporarily
clear srv_file_per_table.

innobase_file_per_table: Remove.
parent b569a7d3
...@@ -139,7 +139,6 @@ static char* innobase_log_arch_dir = NULL; ...@@ -139,7 +139,6 @@ static char* innobase_log_arch_dir = NULL;
#endif /* UNIV_LOG_ARCHIVE */ #endif /* UNIV_LOG_ARCHIVE */
static my_bool innobase_use_doublewrite = TRUE; static my_bool innobase_use_doublewrite = TRUE;
static my_bool innobase_use_checksums = TRUE; static my_bool innobase_use_checksums = TRUE;
static my_bool innobase_file_per_table = FALSE;
static my_bool innobase_locks_unsafe_for_binlog = FALSE; static my_bool innobase_locks_unsafe_for_binlog = FALSE;
static my_bool innobase_rollback_on_timeout = FALSE; static my_bool innobase_rollback_on_timeout = FALSE;
static my_bool innobase_create_status_file = FALSE; static my_bool innobase_create_status_file = FALSE;
...@@ -1751,7 +1750,6 @@ innobase_init( ...@@ -1751,7 +1750,6 @@ innobase_init(
row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout; row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout;
srv_file_per_table = (ibool) innobase_file_per_table;
srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog;
srv_max_n_open_files = (ulint) innobase_open_files; srv_max_n_open_files = (ulint) innobase_open_files;
...@@ -8320,8 +8318,8 @@ static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown, ...@@ -8320,8 +8318,8 @@ static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
".", ".",
NULL, NULL, 1, 0, IF_NETWARE(1,2), 0); NULL, NULL, 1, 0, IF_NETWARE(1,2), 0);
static MYSQL_SYSVAR_BOOL(file_per_table, innobase_file_per_table, static MYSQL_SYSVAR_BOOL(file_per_table, srv_file_per_table,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_NOCMDARG,
"Stores each InnoDB table to an .ibd file in the database dir.", "Stores each InnoDB table to an .ibd file in the database dir.",
NULL, NULL, FALSE); NULL, NULL, FALSE);
......
...@@ -57,7 +57,11 @@ extern char* srv_data_home; ...@@ -57,7 +57,11 @@ extern char* srv_data_home;
extern char* srv_arch_dir; extern char* srv_arch_dir;
#endif /* UNIV_LOG_ARCHIVE */ #endif /* UNIV_LOG_ARCHIVE */
extern ibool srv_file_per_table; /* store to its own file each table created by an user; data
dictionary tables are in the system tablespace 0 */
extern my_bool srv_file_per_table;
/* Place locks to records only i.e. do not use next-key locking except
on duplicate key checking and foreign key checking */
extern ibool srv_locks_unsafe_for_binlog; extern ibool srv_locks_unsafe_for_binlog;
extern ulint srv_n_data_files; extern ulint srv_n_data_files;
......
...@@ -87,7 +87,7 @@ UNIV_INTERN char* srv_arch_dir = NULL; ...@@ -87,7 +87,7 @@ UNIV_INTERN char* srv_arch_dir = NULL;
/* store to its own file each table created by an user; data /* store to its own file each table created by an user; data
dictionary tables are in the system tablespace 0 */ dictionary tables are in the system tablespace 0 */
UNIV_INTERN ibool srv_file_per_table = FALSE; UNIV_INTERN my_bool srv_file_per_table;
/* Place locks to records only i.e. do not use next-key locking except /* Place locks to records only i.e. do not use next-key locking except
on duplicate key checking and foreign key checking */ on duplicate key checking and foreign key checking */
UNIV_INTERN ibool srv_locks_unsafe_for_binlog = FALSE; UNIV_INTERN ibool srv_locks_unsafe_for_binlog = FALSE;
......
...@@ -979,7 +979,7 @@ innobase_start_or_create_for_mysql(void) ...@@ -979,7 +979,7 @@ innobase_start_or_create_for_mysql(void)
ulint tablespace_size_in_header; ulint tablespace_size_in_header;
ulint err; ulint err;
ulint i; ulint i;
ibool srv_file_per_table_original_value my_bool srv_file_per_table_original_value
= srv_file_per_table; = srv_file_per_table;
mtr_t mtr; mtr_t mtr;
#ifdef HAVE_DARWIN_THREADS #ifdef HAVE_DARWIN_THREADS
...@@ -1015,8 +1015,11 @@ innobase_start_or_create_for_mysql(void) ...@@ -1015,8 +1015,11 @@ innobase_start_or_create_for_mysql(void)
(ulong)sizeof(ulint), (ulong)sizeof(void*)); (ulong)sizeof(ulint), (ulong)sizeof(void*));
} }
srv_file_per_table = FALSE; /* system tables are created in tablespace /* System tables are created in tablespace 0. Thus, we must
0 */ temporarily clear srv_file_per_table. This is ok, because the
server will not accept connections (which could modify
innodb_file_per_table) until this function has returned. */
srv_file_per_table = FALSE;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
fprintf(stderr, fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n"); "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
......
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