Commit 3b643667 authored by unknown's avatar unknown

merge with 4.0 to get fix for mysqlbinlog


client/mysqlbinlog.cc:
  Auto merged
mysql-test/t/rpl_trunc_binlog.test:
  Auto merged
parents a8d0df3a ebc1c91f
...@@ -45,17 +45,15 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; ...@@ -45,17 +45,15 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 };
void sql_print_error(const char *format, ...); void sql_print_error(const char *format, ...);
static bool one_database = 0; static bool one_database = 0;
static bool force_opt= 0; static const char* database= 0;
static const char* database; static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
static bool short_form = 0;
static ulonglong offset = 0; static ulonglong offset = 0;
static const char* host = 0; static const char* host = 0;
static int port = MYSQL_PORT; 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* user = 0;
static const char* pass = ""; static const char* pass = "";
static ulonglong position = 0; static ulonglong position = 0;
static bool use_remote = 0;
static short binlog_flags = 0; static short binlog_flags = 0;
static MYSQL* mysql = NULL; static MYSQL* mysql = NULL;
static const char* dirname_for_local_load= 0; static const char* dirname_for_local_load= 0;
...@@ -237,6 +235,9 @@ static struct my_option my_long_options[] = ...@@ -237,6 +235,9 @@ static struct my_option my_long_options[] =
0, 0}, 0, 0},
{"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR, {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"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.", {"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, (gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
...@@ -341,22 +342,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -341,22 +342,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'd': case 'd':
one_database = 1; one_database = 1;
break; break;
case 'h':
use_remote = 1;
break;
case 'P':
use_remote = 1;
break;
case 'p': case 'p':
use_remote = 1;
pass = my_strdup(argument, MYF(0)); pass = my_strdup(argument, MYF(0));
break; break;
case 'r': case 'r':
if (!(result_file = my_fopen(argument, O_WRONLY | O_BINARY, MYF(MY_WME)))) if (!(result_file = my_fopen(argument, O_WRONLY | O_BINARY, MYF(MY_WME))))
exit(1); exit(1);
break; break;
case 'u': case 'R':
use_remote = 1; remote_opt= 1;
break; break;
case 'V': case 'V':
print_version(); print_version();
...@@ -395,7 +389,7 @@ static MYSQL* safe_connect() ...@@ -395,7 +389,7 @@ static MYSQL* safe_connect()
static void dump_log_entries(const char* logname) static void dump_log_entries(const char* logname)
{ {
if (use_remote) if (remote_opt)
dump_remote_log_entries(logname); dump_remote_log_entries(logname);
else else
dump_local_log_entries(logname); dump_local_log_entries(logname);
...@@ -688,7 +682,7 @@ int main(int argc, char** argv) ...@@ -688,7 +682,7 @@ int main(int argc, char** argv)
return -1; return -1;
} }
if (use_remote) if (remote_opt)
mysql = safe_connect(); mysql = safe_connect();
MY_TMPDIR tmpdir; MY_TMPDIR tmpdir;
...@@ -711,7 +705,7 @@ int main(int argc, char** argv) ...@@ -711,7 +705,7 @@ int main(int argc, char** argv)
free_tmpdir(&tmpdir); free_tmpdir(&tmpdir);
if (result_file != stdout) if (result_file != stdout)
my_fclose(result_file, MYF(0)); my_fclose(result_file, MYF(0));
if (use_remote) if (remote_opt)
mysql_close(mysql); mysql_close(mysql);
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_end(0); my_end(0);
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
source include/master-slave.inc; source include/master-slave.inc;
connection slave; 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; stop slave;
connection master; connection master;
flush logs; flush logs;
......
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