From 4f9100b67cf5a8cab82f413d11d1dc7baf6859e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Apr 2006 10:48:53 -0700 Subject: [PATCH 1/3] Bug #18312: mysqltest: --sleep=0 doesn't disable sleep Allow --sleep=0 to be specified to mysqltest, so that sleep calls can be disabled. Original patch from Paul DuBois. client/mysqltest.c: Handle --sleep=0 being specified. --- client/mysqltest.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index e51d83270b5..ecf54e40400 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -153,7 +153,7 @@ static uint global_expected_errors; /* ************************************************************************ */ -static int record = 0, opt_sleep=0; +static int record= 0, opt_sleep= -1; static char *db = 0, *pass=0; const char *user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./"; static int port = 0; @@ -1724,11 +1724,12 @@ int do_sleep(struct st_query *query, my_bool real_sleep) query->first_argument); /* Fixed sleep time selected by --sleep option */ - if (opt_sleep && !real_sleep) + if (opt_sleep >= 0 && !real_sleep) sleep_val= opt_sleep; DBUG_PRINT("info", ("sleep_val: %f", sleep_val)); - my_sleep((ulong) (sleep_val * 1000000L)); + if (sleep_val) + my_sleep((ulong) (sleep_val * 1000000L)); query->last_argument= sleep_end; return 0; } @@ -2935,7 +2936,7 @@ static struct my_option my_long_options[] = "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"sleep", 'T', "Sleep always this many seconds on sleep commands.", - (gptr*) &opt_sleep, (gptr*) &opt_sleep, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, + (gptr*) &opt_sleep, (gptr*) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, 0, 0, 0, 0, 0}, {"socket", 'S', "Socket file to use for connection.", (gptr*) &unix_sock, (gptr*) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, From 661c6aeaad6411344e6f20ac7d669363e39f7a97 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Apr 2006 18:26:39 -0700 Subject: [PATCH 2/3] Bug #18607: LOAD DATA FROM MASTER fails because of INFORMATION_SCHEMA database Simply exclude INFORMATION_SCHEMA from LOAD DATA FROM MASTER just like we exclude the `mysql` database. There's no test for this, because it requires an unfiltered 'LOAD DATA FROM MASTER' which is too likely to cause chaos (such as when running the test suite against an external server). sql/repl_failsafe.cc: Exclude information_schema from LOAD DATA FROM MASTER. --- sql/repl_failsafe.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 5cdd24afba4..21e46e71825 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -860,7 +860,8 @@ bool load_master_data(THD* thd) if (!db_ok(db, replicate_do_db, replicate_ignore_db) || !db_ok_with_wild_table(db) || - !strcmp(db,"mysql")) + !strcmp(db,"mysql") || + is_schema_db(db)) { *cur_table_res = 0; continue; From 57b21b5bdbd6484dead4bea8e5a520a0ee6a9b41 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 May 2006 22:16:08 +0500 Subject: [PATCH 3/3] Fix for Win build BitKeeper/etc/ignore: Added client/mysql_upgrade to the ignore list client/mysql_upgrade.c: fixed for Win build include/config-win.h: fixed for Win build --- .bzrignore | 1 + client/mysql_upgrade.c | 6 ++++-- include/config-win.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.bzrignore b/.bzrignore index 352629ab5c5..80ed7872005 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1281,3 +1281,4 @@ mysql-test/r/udf.log extra/yassl/taocrypt/benchmark/benchmark extra/yassl/taocrypt/test/test extra/yassl/testsuite/testsuite +client/mysql_upgrade diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 78e4acd4c1d..551be79fc99 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -135,7 +135,9 @@ static int create_check_file(const char *path) if (check_file < 0) return 1; - error= my_write(check_file, VERSION, strlen(VERSION), MYF(MY_WME | MY_FNABP)); + error= my_write(check_file, + MYSQL_SERVER_VERSION, strlen(MYSQL_SERVER_VERSION), + MYF(MY_WME | MY_FNABP)); error= my_close(check_file, MYF(MY_FAE | MY_WME)) || error; return error; } @@ -243,7 +245,7 @@ int main(int argc, char **argv) && (test_file_exists("./bin", "mysqld") || test_file_exists("./libexec", "mysqld"))) { - getcwd(bindir, sizeof(bindir)); + my_getwd(bindir, sizeof(bindir), MYF(0)); bindir_end= bindir + strlen(bindir); } else diff --git a/include/config-win.h b/include/config-win.h index b2e1c9831d4..8d937ffed22 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -367,6 +367,7 @@ inline double ulonglong2double(ulonglong value) #include #else #define DEFAULT_MYSQL_HOME "c:\\mysql" +#define DATADIR "c:\\mysql\\data" #define PACKAGE "mysql" #define DEFAULT_BASEDIR "C:\\" #define SHAREDIR "share"