summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2008-08-20 19:06:31 +0500
committerAlexander Barkov <bar@mysql.com>2008-08-20 19:06:31 +0500
commit0c5bc2eafc95cb20f332becd295c29be95149700 (patch)
tree9b01eca71e89e78891e200183ef0f206f42306ab /client
parente4e99f1439cd46a5f96e39289e6bc4f74c86ce88 (diff)
downloadmariadb-git-0c5bc2eafc95cb20f332becd295c29be95149700.tar.gz
Bug#31455 mysqlbinlog don't print user readable info about RBR events
Implementing -v command line parameter to mysqlbinlog to decode and print row events. mysql-test/include/mysqlbinlog_row_engine.inc mysql-test/r/mysqlbinlog_row.result mysql-test/r/mysqlbinlog_row_big.result mysql-test/r/mysqlbinlog_row_innodb.result mysql-test/r/mysqlbinlog_row_myisam.result mysql-test/r/mysqlbinlog_row_trans.result mysql-test/t/mysqlbinlog_row.test mysql-test/t/mysqlbinlog_row_big.test mysql-test/t/mysqlbinlog_row_innodb.test mysql-test/t/mysqlbinlog_row_myisam.test mysql-test/t/mysqlbinlog_row_trans.test Adding tests client/Makefile.am Adding new files to symlink client/mysqlbinlog.cc Adding -v option sql/log_event.cc Impelentations of the new methods sql/log_event.h Declaration of the new methods and member sql/mysql_priv.h Adding new function prototype sql/rpl_tblmap.cc Adding pre-processor conditions sql/rpl_tblmap.h Adding pre-processor conditions sql/rpl_utility.h Adding pre-processor conditions sql/sql_base.cc Adding reset_table_id_sequence() function. sql/sql_repl.cc Resetting table_id on "RESET MASTER" .bzrignore Ignoring new symlinked files
Diffstat (limited to 'client')
-rw-r--r--client/Makefile.am1
-rw-r--r--client/mysqlbinlog.cc13
2 files changed, 14 insertions, 0 deletions
diff --git a/client/Makefile.am b/client/Makefile.am
index 25b0c0cee00..c5c82ec0a42 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -104,6 +104,7 @@ DEFS = -DUNDEF_THREADS_HACK \
-DDATADIR="\"$(localstatedir)\""
sql_src=log_event.h mysql_priv.h rpl_constants.h \
+ rpl_utility.h rpl_tblmap.h rpl_tblmap.cc \
log_event.cc my_decimal.h my_decimal.cc \
log_event_old.h log_event_old.cc \
rpl_record_old.h rpl_record_old.cc
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 9f021115d5d..3c9ee0072f2 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -83,6 +83,8 @@ static const char* user = 0;
static char* pass = 0;
static char *charset= 0;
+static uint verbose= 0;
+
static ulonglong start_position, stop_position;
#define start_position_mot ((my_off_t)start_position)
#define stop_position_mot ((my_off_t)stop_position)
@@ -1063,6 +1065,9 @@ that may lead to an endless loop.",
{"user", 'u', "Connect to the remote server as username.",
(uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
+ {"verbose", 'v', "Reconstruct SQL statements out of row events. "
+ "-v -v adds comments on column data types",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
@@ -1258,6 +1263,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
(find_type_or_exit(argument, &base64_output_mode_typelib, opt->name)-1);
}
break;
+ case 'v':
+ if (argument == disabled_my_option)
+ verbose= 0;
+ else
+ verbose++;
+ break;
case 'V':
print_version();
exit(0);
@@ -1343,6 +1354,8 @@ static Exit_status dump_log_entries(const char* logname)
*/
fprintf(result_file, "DELIMITER /*!*/;\n");
strmov(print_event_info.delimiter, "/*!*/;");
+
+ print_event_info.verbose= short_form ? 0 : verbose;
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));