Commit ff92a3af authored by Michael Widenius's avatar Michael Widenius

Fixed that test doesn't abort if 'var' points to a deleted directory (common case when using --mem)

Better error message if --log-bin is used without --log-bin-index

mysql-test/lib/v1/mysql-test-run.pl:
  Fixed that test doesn't abort if 'var' points to a deleted directory (common case when using --mem)
sql/mysqld.cc:
  Better error message if --log-bin is used without --log-bin-index
parent 5fe4a51c
...@@ -2372,8 +2372,11 @@ sub remove_stale_vardir () { ...@@ -2372,8 +2372,11 @@ sub remove_stale_vardir () {
mtr_report("WARNING: Using the 'mysql-test/var' symlink"); mtr_report("WARNING: Using the 'mysql-test/var' symlink");
# Make sure the directory where it points exist # Make sure the directory where it points exist
mtr_error("The destination for symlink $opt_vardir does not exist") if (! -d readlink($opt_vardir))
if ! -d readlink($opt_vardir); {
mtr_report("The destination for symlink $opt_vardir does not exist; Removing it and creating a new var directory");
unlink($opt_vardir);
}
foreach my $bin ( glob("$opt_vardir/*") ) foreach my $bin ( glob("$opt_vardir/*") )
{ {
...@@ -2432,8 +2435,11 @@ sub setup_vardir() { ...@@ -2432,8 +2435,11 @@ sub setup_vardir() {
# it's a symlink # it's a symlink
# Make sure the directory where it points exist # Make sure the directory where it points exist
mtr_error("The destination for symlink $opt_vardir does not exist") if (! -d readlink($opt_vardir))
if ! -d readlink($opt_vardir); {
mtr_report("The destination for symlink $opt_vardir does not exist; Removing it and creating a new var directory");
unlink($opt_vardir);
}
} }
elsif ( $opt_mem ) elsif ( $opt_mem )
{ {
......
...@@ -707,6 +707,7 @@ char mysql_real_data_home[FN_REFLEN], ...@@ -707,6 +707,7 @@ char mysql_real_data_home[FN_REFLEN],
language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN],
*opt_init_file, *opt_tc_log_file, *opt_init_file, *opt_tc_log_file,
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
const char *opt_basename;
char mysql_unpacked_real_data_home[FN_REFLEN]; char mysql_unpacked_real_data_home[FN_REFLEN];
int mysql_unpacked_real_data_home_len; int mysql_unpacked_real_data_home_len;
uint reg_ext_length; uint reg_ext_length;
...@@ -3509,7 +3510,6 @@ static int init_common_variables(const char *conf_file_name, int argc, ...@@ -3509,7 +3510,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
char **argv, const char **groups) char **argv, const char **groups)
{ {
char buff[FN_REFLEN], *s; char buff[FN_REFLEN], *s;
const char *basename;
umask(((~my_umask) & 0666)); umask(((~my_umask) & 0666));
tzset(); // Set tzname tzset(); // Set tzname
...@@ -3569,13 +3569,13 @@ static int init_common_variables(const char *conf_file_name, int argc, ...@@ -3569,13 +3569,13 @@ static int init_common_variables(const char *conf_file_name, int argc,
strmake(glob_hostname, STRING_WITH_LEN("localhost")); strmake(glob_hostname, STRING_WITH_LEN("localhost"));
sql_print_warning("gethostname failed, using '%s' as hostname", sql_print_warning("gethostname failed, using '%s' as hostname",
glob_hostname); glob_hostname);
basename= "mysql"; opt_basename= "mysql";
} }
else else
{ {
basename= glob_hostname; opt_basename= glob_hostname;
} }
strmake(pidfile_name, basename, sizeof(pidfile_name)-5); strmake(pidfile_name, opt_basename, sizeof(pidfile_name)-5);
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
/* /*
...@@ -4305,11 +4305,13 @@ a file name for --log-bin-index option", opt_binlog_index_name); ...@@ -4305,11 +4305,13 @@ a file name for --log-bin-index option", opt_binlog_index_name);
require a name. But as we don't want to break many existing setups, we require a name. But as we don't want to break many existing setups, we
only give warning, not error. only give warning, not error.
*/ */
sql_print_warning("No argument was provided to --log-bin, and " sql_print_warning("No argument was provided to --log-bin and "
"--log-bin-index was not used; so replication " "neither --log-basename or --log-bin-index where "
"may break when this MySQL server acts as a " "used; This may cause repliction to break when this "
"master and has his hostname changed!! Please " "server acts as a master and has its hostname "
"use '--log-bin=%s' to avoid this problem.", ln); "changed!! Please use '--log-basename=%s' or "
"'--log-bin=%s' to avoid this problem.",
opt_basename, ln);
} }
if (ln == buf) if (ln == buf)
{ {
......
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