From 0ed892f1975a380066b4ac7cc38852021344dbbd Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 5 Jan 2005 01:08:45 +0100 Subject: [PATCH 1/5] Change mysqld_safe search for mysqld relative to the current working directory to only look for the mysqld binary (and english error strings) and assume the datadir from that. Then, if that datadir turns out to not exist, startup will fail. This avoids the behavior where mysqld_safe would go off and run a totally different binary because the data directory had been moved (even when --datadir was specified on the command line). (Bug #7249) --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 270c08679eb..f6b0169d230 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -86,7 +86,7 @@ parse_arguments() { MY_PWD=`pwd` # Check if we are starting this relative (for the binary release) -if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ +if test -f ./share/mysql/english/errmsg.sys -a \ -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are @@ -97,7 +97,7 @@ then defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" fi # Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ +elif test -f ./share/mysql/english/errmsg.sys -a \ -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are From 9971b2f0f582ef3c744000a28421f1945609a89c Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 6 Jan 2005 01:08:03 +0100 Subject: [PATCH 2/5] Add support for --default-character-set to mysqladmin (Bug #7524) --- client/mysqladmin.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2e8b3cd588a..ae92765dfdf 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -33,7 +33,8 @@ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 -char *host= NULL, *user= 0, *opt_password= 0; +char *host= NULL, *user= 0, *opt_password= 0, + *default_charset= NULL; char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN]; ulonglong last_values[MAX_MYSQL_VAR]; @@ -145,6 +146,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default-character-set", OPT_DEFAULT_CHARSET, + "Set the default character set.", (gptr*) &default_charset, + (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, @@ -343,6 +347,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + if (default_charset) + mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (sql_connect(&mysql, option_wait)) { unsigned int err= mysql_errno(&mysql); From 746fd9fdacc52ccc297db7703ea9288b67138167 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Thu, 6 Jan 2005 11:19:20 +0200 Subject: [PATCH 3/5] os0file.c: Use the fcntl() file flush method on OS X; Apple disabled fsync() for internal disk drives, which caused corruption in power outages; the patch was recommended by an Apple engineer --- innobase/os/os0file.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index aa45030d93b..f02b81b8fd8 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1763,7 +1763,21 @@ os_file_flush( #else int ret; -#ifdef HAVE_FDATASYNC +#ifdef HAVE_DARWIN_THREADS + /* Apple has disabled fsync() for internal disk drives in OS X. That + caused corruption for a user when he tested a power outage. Let us in + OS X use a nonstandard flush method recommended by an Apple + engineer. */ + + ret = fcntl(file, F_FULLFSYNC, NULL); + + if (ret) { + /* If we are not on a file system that supports this, then + fall back to a plain fsync. */ + + ret = fsync(file); + } +#elif HAVE_FDATASYNC ret = fdatasync(file); #else /* fprintf(stderr, "Flushing to file %p\n", file); */ From 57099ef6c6f14fa3e6b912f1f8884b9b5feb7c54 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 6 Jan 2005 14:35:14 +0100 Subject: [PATCH 4/5] - enable "with-extra-charsets=complex" for the "compile-dist" distribution build (to make the test suite pass) --- BUILD/compile-dist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD/compile-dist b/BUILD/compile-dist index 2344d4dfffd..ef6302f0d9c 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -42,5 +42,6 @@ fi --with-embedded-server \ --with-berkeley-db \ --with-innodb \ - --enable-thread-safe-client + --enable-thread-safe-client \ + --with-extra-charsets=complex make From 421738e8ce0382c4d72f36766765c3e49a74d72f Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Thu, 6 Jan 2005 17:08:38 +0200 Subject: [PATCH 5/5] removed unused label --- sql/sql_parse.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 55d26a68116..cd8e73c446d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2429,7 +2429,6 @@ mysql_execute_command(THD *thd) create_table_local); break; -create_error: res= 1; //error reported unsent_create_error: // put tables back for PS rexecuting