mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
ha_innodb.cc:
Make copies of all string-type start/up options in case C-sharp moves them around; remove the need to specify innodb_log_arch_dir in my.cnf, since it has no relevance anyway sql/ha_innodb.cc: Make copies of all string-type start/up options in case C-sharp moves them around; remove the need to specify innodb_log_arch_dir in my.cnf, since it has no relevance anyway
This commit is contained in:
120
sql/ha_innodb.cc
120
sql/ha_innodb.cc
@ -90,10 +90,11 @@ long innobase_mirrored_log_groups, innobase_log_files_in_group,
|
|||||||
are determined in innobase_init below: */
|
are determined in innobase_init below: */
|
||||||
|
|
||||||
char* innobase_data_home_dir = NULL;
|
char* innobase_data_home_dir = NULL;
|
||||||
|
char* innobase_data_file_path = NULL;
|
||||||
char* innobase_log_group_home_dir = NULL;
|
char* innobase_log_group_home_dir = NULL;
|
||||||
char* innobase_log_arch_dir = NULL;
|
char* innobase_log_arch_dir = NULL;
|
||||||
/* The following has a midleading name: starting from 4.0.5 this also
|
/* The following has a misleading name: starting from 4.0.5, this also
|
||||||
affects Windows */
|
affects Windows: */
|
||||||
char* innobase_unix_file_flush_method = NULL;
|
char* innobase_unix_file_flush_method = NULL;
|
||||||
|
|
||||||
/* Below we have boolean-valued start-up parameters, and their default
|
/* Below we have boolean-valued start-up parameters, and their default
|
||||||
@ -104,14 +105,7 @@ my_bool innobase_log_archive = FALSE;
|
|||||||
my_bool innobase_use_native_aio = FALSE;
|
my_bool innobase_use_native_aio = FALSE;
|
||||||
my_bool innobase_fast_shutdown = TRUE;
|
my_bool innobase_fast_shutdown = TRUE;
|
||||||
|
|
||||||
/*
|
static char *internal_innobase_data_file_path = NULL;
|
||||||
Set default InnoDB data file size to 10 MB and let it be
|
|
||||||
auto-extending. Thus users can use InnoDB without having to
|
|
||||||
specify any startup options.
|
|
||||||
*/
|
|
||||||
|
|
||||||
char *innobase_data_file_path= (char*) "ibdata1:10M:autoextend";
|
|
||||||
static char *internal_innobase_data_file_path=0;
|
|
||||||
|
|
||||||
/* The following counter is used to convey information to InnoDB
|
/* The following counter is used to convey information to InnoDB
|
||||||
about server activity: in selects it is not sensible to call
|
about server activity: in selects it is not sensible to call
|
||||||
@ -652,21 +646,24 @@ innobase_init(void)
|
|||||||
|
|
||||||
os_innodb_umask = (ulint)my_umask;
|
os_innodb_umask = (ulint)my_umask;
|
||||||
|
|
||||||
/*
|
/* First calculate the default path for innodb_data_home_dir etc.,
|
||||||
When using the embedded server, the datadirectory is not
|
in case the user has not given any value.
|
||||||
in the current directory.
|
|
||||||
*/
|
Note that when using the embedded server, the datadirectory is not
|
||||||
if (mysql_embedded)
|
necessarily the current directory of this program. */
|
||||||
|
|
||||||
|
if (mysql_embedded) {
|
||||||
default_path = mysql_real_data_home;
|
default_path = mysql_real_data_home;
|
||||||
else
|
} else {
|
||||||
{
|
/* It's better to use current lib, to keep paths short */
|
||||||
/* It's better to use current lib, to keep path's short */
|
|
||||||
current_dir[0] = FN_CURLIB;
|
current_dir[0] = FN_CURLIB;
|
||||||
current_dir[1] = FN_LIBCHAR;
|
current_dir[1] = FN_LIBCHAR;
|
||||||
current_dir[2] = 0;
|
current_dir[2] = 0;
|
||||||
default_path = current_dir;
|
default_path = current_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ut_a(default_path);
|
||||||
|
|
||||||
if (specialflag & SPECIAL_NO_PRIOR) {
|
if (specialflag & SPECIAL_NO_PRIOR) {
|
||||||
srv_set_thread_priorities = FALSE;
|
srv_set_thread_priorities = FALSE;
|
||||||
} else {
|
} else {
|
||||||
@ -674,22 +671,62 @@ innobase_init(void)
|
|||||||
srv_query_thread_priority = QUERY_PRIOR;
|
srv_query_thread_priority = QUERY_PRIOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Set InnoDB initialization parameters according to the values
|
||||||
Set InnoDB initialization parameters according to the values
|
read from MySQL .cnf file */
|
||||||
read from MySQL .cnf file
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Make a copy of innobase_data_file_path to not modify the original
|
/* --------------------------------------------------*/
|
||||||
internal_innobase_data_file_path=my_strdup(innobase_data_file_path,
|
/* Make copies of all string-valued parameters, because after
|
||||||
|
C# calls server_init(), it may move the parameter strings around */
|
||||||
|
|
||||||
|
if (innobase_data_home_dir) {
|
||||||
|
innobase_data_home_dir = my_strdup(
|
||||||
|
innobase_data_home_dir,
|
||||||
MYF(MY_WME));
|
MYF(MY_WME));
|
||||||
|
}
|
||||||
|
if (innobase_data_file_path) {
|
||||||
|
innobase_data_file_path = my_strdup(
|
||||||
|
innobase_data_file_path,
|
||||||
|
MYF(MY_WME));
|
||||||
|
}
|
||||||
|
if (innobase_log_group_home_dir) {
|
||||||
|
innobase_log_group_home_dir = my_strdup(
|
||||||
|
innobase_log_group_home_dir,
|
||||||
|
MYF(MY_WME));
|
||||||
|
}
|
||||||
|
if (innobase_log_arch_dir) {
|
||||||
|
innobase_log_arch_dir = my_strdup(
|
||||||
|
innobase_log_arch_dir,
|
||||||
|
MYF(MY_WME));
|
||||||
|
}
|
||||||
|
if (innobase_unix_file_flush_method) {
|
||||||
|
innobase_unix_file_flush_method = my_strdup(
|
||||||
|
innobase_unix_file_flush_method,
|
||||||
|
MYF(MY_WME));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------- Data files -------------------------*/
|
||||||
|
|
||||||
|
/* The default dir for data files is the datadir of MySQL */
|
||||||
|
|
||||||
srv_data_home = (innobase_data_home_dir ? innobase_data_home_dir :
|
srv_data_home = (innobase_data_home_dir ? innobase_data_home_dir :
|
||||||
default_path);
|
default_path);
|
||||||
srv_arch_dir = (innobase_log_arch_dir ? innobase_log_arch_dir :
|
|
||||||
default_path);
|
|
||||||
|
|
||||||
ret = (bool)
|
/* Set default InnoDB data file size to 10 MB and let it be
|
||||||
srv_parse_data_file_paths_and_sizes(internal_innobase_data_file_path,
|
auto-extending. Thus users can use InnoDB in >= 4.0 without having
|
||||||
|
to specify any startup options. */
|
||||||
|
|
||||||
|
if (!innobase_data_file_path) {
|
||||||
|
innobase_data_file_path = (char*) "ibdata1:10M:autoextend";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Since InnoDB edits the argument in the next call, we make another
|
||||||
|
copy of it: */
|
||||||
|
|
||||||
|
internal_innobase_data_file_path = my_strdup(innobase_data_file_path,
|
||||||
|
MYF(MY_WME));
|
||||||
|
|
||||||
|
ret = (bool) srv_parse_data_file_paths_and_sizes(
|
||||||
|
internal_innobase_data_file_path,
|
||||||
&srv_data_file_names,
|
&srv_data_file_names,
|
||||||
&srv_data_file_sizes,
|
&srv_data_file_sizes,
|
||||||
&srv_data_file_is_raw_partition,
|
&srv_data_file_is_raw_partition,
|
||||||
@ -697,12 +734,26 @@ innobase_init(void)
|
|||||||
&srv_auto_extend_last_data_file,
|
&srv_auto_extend_last_data_file,
|
||||||
&srv_last_file_size_max);
|
&srv_last_file_size_max);
|
||||||
if (ret == FALSE) {
|
if (ret == FALSE) {
|
||||||
sql_print_error("InnoDB: syntax error in innodb_data_file_path");
|
sql_print_error(
|
||||||
|
"InnoDB: syntax error in innodb_data_file_path");
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!innobase_log_group_home_dir)
|
/* -------------- Log files ---------------------------*/
|
||||||
|
|
||||||
|
/* The default dir for log files is the datadir of MySQL */
|
||||||
|
|
||||||
|
if (!innobase_log_group_home_dir) {
|
||||||
innobase_log_group_home_dir = default_path;
|
innobase_log_group_home_dir = default_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Since innodb_log_arch_dir has no relevance under MySQL,
|
||||||
|
starting from 4.0.6 we always set it the same as
|
||||||
|
innodb_log_group_home_dir: */
|
||||||
|
|
||||||
|
innobase_log_arch_dir = innobase_log_group_home_dir;
|
||||||
|
|
||||||
|
srv_arch_dir = innobase_log_arch_dir;
|
||||||
|
|
||||||
ret = (bool)
|
ret = (bool)
|
||||||
srv_parse_log_group_home_dirs(innobase_log_group_home_dir,
|
srv_parse_log_group_home_dirs(innobase_log_group_home_dir,
|
||||||
@ -716,9 +767,9 @@ innobase_init(void)
|
|||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
srv_file_flush_method_str = (innobase_unix_file_flush_method ?
|
/* --------------------------------------------------*/
|
||||||
innobase_unix_file_flush_method :
|
|
||||||
NULL);
|
srv_file_flush_method_str = innobase_unix_file_flush_method;
|
||||||
|
|
||||||
srv_n_log_groups = (ulint) innobase_mirrored_log_groups;
|
srv_n_log_groups = (ulint) innobase_mirrored_log_groups;
|
||||||
srv_n_log_files = (ulint) innobase_log_files_in_group;
|
srv_n_log_files = (ulint) innobase_log_files_in_group;
|
||||||
@ -741,7 +792,9 @@ innobase_init(void)
|
|||||||
srv_fast_shutdown = (ibool) innobase_fast_shutdown;
|
srv_fast_shutdown = (ibool) innobase_fast_shutdown;
|
||||||
|
|
||||||
srv_print_verbose_log = mysql_embedded ? 0 : 1;
|
srv_print_verbose_log = mysql_embedded ? 0 : 1;
|
||||||
|
|
||||||
if (strcmp(default_charset_info->name, "latin1") == 0) {
|
if (strcmp(default_charset_info->name, "latin1") == 0) {
|
||||||
|
|
||||||
/* Store the character ordering table to InnoDB.
|
/* Store the character ordering table to InnoDB.
|
||||||
For non-latin1 charsets we use the MySQL comparison
|
For non-latin1 charsets we use the MySQL comparison
|
||||||
functions, and consequently we do not need to know
|
functions, and consequently we do not need to know
|
||||||
@ -4177,3 +4230,4 @@ ha_innobase::get_auto_increment()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_INNOBASE_DB */
|
#endif /* HAVE_INNOBASE_DB */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user