Commit b3cae9db authored by Julius Goryavsky's avatar Julius Goryavsky

MDEV-20401: Server incorrectly auto-sets lower_case_file_system value

Server auto-sets lower_case_file_system value based on default
datadir's behavior instead of instead of using the directory specified
by the user through the configuration file or command line options.

This patch fixes this problem.
parent 147d4b1e
...@@ -4674,8 +4674,10 @@ static int init_common_variables() ...@@ -4674,8 +4674,10 @@ static int init_common_variables()
get corrupted if accesses with names of different case. get corrupted if accesses with names of different case.
*/ */
DBUG_PRINT("info", ("lower_case_table_names: %d", lower_case_table_names)); DBUG_PRINT("info", ("lower_case_table_names: %d", lower_case_table_names));
if(mysql_real_data_home_ptr == NULL || *mysql_real_data_home_ptr == 0)
mysql_real_data_home_ptr= mysql_real_data_home;
SYSVAR_AUTOSIZE(lower_case_file_system, SYSVAR_AUTOSIZE(lower_case_file_system,
test_if_case_insensitive(mysql_real_data_home)); test_if_case_insensitive(mysql_real_data_home_ptr));
if (!lower_case_table_names && lower_case_file_system == 1) if (!lower_case_table_names && lower_case_file_system == 1)
{ {
if (lower_case_table_names_used) if (lower_case_table_names_used)
...@@ -4692,7 +4694,7 @@ static int init_common_variables() ...@@ -4692,7 +4694,7 @@ static int init_common_variables()
{ {
if (global_system_variables.log_warnings) if (global_system_variables.log_warnings)
sql_print_warning("Setting lower_case_table_names=2 because file " sql_print_warning("Setting lower_case_table_names=2 because file "
"system for %s is case insensitive", mysql_real_data_home); "system for %s is case insensitive", mysql_real_data_home_ptr);
SYSVAR_AUTOSIZE(lower_case_table_names, 2); SYSVAR_AUTOSIZE(lower_case_table_names, 2);
} }
} }
...@@ -4703,7 +4705,7 @@ static int init_common_variables() ...@@ -4703,7 +4705,7 @@ static int init_common_variables()
sql_print_warning("lower_case_table_names was set to 2, even though your " sql_print_warning("lower_case_table_names was set to 2, even though your "
"the file system '%s' is case sensitive. Now setting " "the file system '%s' is case sensitive. Now setting "
"lower_case_table_names to 0 to avoid future problems.", "lower_case_table_names to 0 to avoid future problems.",
mysql_real_data_home); mysql_real_data_home_ptr);
SYSVAR_AUTOSIZE(lower_case_table_names, 0); SYSVAR_AUTOSIZE(lower_case_table_names, 0);
} }
else else
......
...@@ -839,7 +839,7 @@ static Sys_var_ulong Sys_connect_timeout( ...@@ -839,7 +839,7 @@ static Sys_var_ulong Sys_connect_timeout(
static Sys_var_charptr Sys_datadir( static Sys_var_charptr Sys_datadir(
"datadir", "Path to the database root directory", "datadir", "Path to the database root directory",
READ_ONLY GLOBAL_VAR(mysql_real_data_home_ptr), PARSED_EARLY READ_ONLY GLOBAL_VAR(mysql_real_data_home_ptr),
CMD_LINE(REQUIRED_ARG, 'h'), IN_FS_CHARSET, DEFAULT(mysql_real_data_home)); CMD_LINE(REQUIRED_ARG, 'h'), IN_FS_CHARSET, DEFAULT(mysql_real_data_home));
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
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