From 654d266c8bca6ef770e4a592b32696e920ce0e98 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Oct 2003 20:41:06 +0200 Subject: [PATCH 1/3] Fix for a test failure with the standard (no-BDB) binary: as the test is meaningful only if the slave supports transactions, we require this. As in 4.0 the slave runs with --skip-innodb, we test for BDB. --- mysql-test/t/rpl_trunc_binlog.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/t/rpl_trunc_binlog.test b/mysql-test/t/rpl_trunc_binlog.test index efdc3012471..11ec0026560 100644 --- a/mysql-test/t/rpl_trunc_binlog.test +++ b/mysql-test/t/rpl_trunc_binlog.test @@ -6,6 +6,10 @@ source include/master-slave.inc; connection slave; +# If we are not supporting transactions in the slave, the unfinished transaction +# won't cause any error, so we need to skip the test. In the 4.0 testsuite, the +# slave always runs without InnoDB, so we check for BDB. +source include/have_bdb.inc; stop slave; connection master; flush logs; From 9214babea78625a061dd7530283981c783289ab3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Oct 2003 01:30:10 +0300 Subject: [PATCH 2/3] Fix for option 'R' (connect to remote server) in mysqlbinlog client/mysqlbinlog.cc: Fix for option 'R' (connect to remote server) --- client/mysqlbinlog.cc | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 8e108e20299..a50a89f330b 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -45,17 +45,15 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; void sql_print_error(const char *format, ...); static bool one_database = 0; -static bool force_opt= 0; -static const char* database; -static bool short_form = 0; +static const char* database= 0; +static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static ulonglong offset = 0; static const char* host = 0; static int port = MYSQL_PORT; -static const char* sock= MYSQL_UNIX_ADDR; +static const char* sock= 0; static const char* user = 0; static const char* pass = ""; static ulonglong position = 0; -static bool use_remote = 0; static short binlog_flags = 0; static MYSQL* mysql = NULL; @@ -238,6 +236,9 @@ static struct my_option my_long_options[] = 0, 0}, {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"remote", 'R', "Connect to remote MySQL server", + (gptr*) &remote_opt, (gptr*) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + 0, 0}, {"short-form", 's', "Just show the queries, no extra info.", (gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -342,22 +343,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'd': one_database = 1; break; - case 'h': - use_remote = 1; - break; - case 'P': - use_remote = 1; - break; case 'p': - use_remote = 1; pass = my_strdup(argument, MYF(0)); break; case 'r': if (!(result_file = my_fopen(argument, O_WRONLY | O_BINARY, MYF(MY_WME)))) exit(1); break; - case 'u': - use_remote = 1; + case 'R': + remote_opt= 1; break; case 'V': print_version(); @@ -396,7 +390,7 @@ static MYSQL* safe_connect() static void dump_log_entries(const char* logname) { - if (use_remote) + if (remote_opt) dump_remote_log_entries(logname); else dump_local_log_entries(logname); @@ -758,7 +752,7 @@ int main(int argc, char** argv) return -1; } - if (use_remote) + if (remote_opt) mysql = safe_connect(); MY_TMPDIR tmpdir; @@ -782,7 +776,7 @@ int main(int argc, char** argv) free_tmpdir(&tmpdir); if (result_file != stdout) my_fclose(result_file, MYF(0)); - if (use_remote) + if (remote_opt) mysql_close(mysql); free_defaults(defaults_argv); my_end(0); From 26456b883808edc0f3aaa186b36f1d7739c2a74e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Oct 2003 10:23:54 +0300 Subject: [PATCH 3/3] Fixed test case that my last patch to mysqlbinlog broke. Changed --remote to --read-from-remote-server (mysqlbinlog) client/mysqlbinlog.cc: Changed --remote to --read-from-remote-server to make option more understandable mysql-test/t/mysqlbinlog.test: Fixed test case that --remote broke --- client/mysqlbinlog.cc | 2 +- mysql-test/t/mysqlbinlog.test | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index a50a89f330b..298521b5aa7 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -236,7 +236,7 @@ static struct my_option my_long_options[] = 0, 0}, {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"remote", 'R', "Connect to remote MySQL server", + {"read-from-remote-server", 'R', "Read binary logs from a MySQL server", (gptr*) &remote_opt, (gptr*) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"short-form", 's', "Just show the queries, no extra info.", diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 22b63146652..c5e1be37b01 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -76,28 +76,28 @@ select "--- Remote --" as ""; # This is broken now # By the way it seems that remote version fetches all events with name >= master-bin.001 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.001 +--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.001 # This is broken too --disable_query_log select "--- Broken LOAD DATA --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002 +--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002 # And this too ! (altough it is documented) --disable_query_log select "--- --database --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.001 +--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.001 # Strangely but this works --disable_query_log select "--- --position --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002 +--exec $MYSQL_BINLOG --short-form --read-from-remote-server --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002 # clean up drop table t1;