Commit a57aa6bb authored by Alexander Barkov's avatar Alexander Barkov
Browse files

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
parent c6978225
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -389,6 +389,9 @@ client/readline.cpp
client/rpl_constants.h
client/rpl_record_old.cc
client/rpl_record_old.h
client/rpl_tblmap.h
client/rpl_tblmap.cc
client/rpl_utility.h
client/select_test
client/sql_string.cpp
client/ssl_test
+1 −0
Original line number Diff line number Diff line
@@ -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
+13 −0
Original line number Diff line number Diff line
@@ -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);
@@ -1344,6 +1355,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));

+1922 −0

File added.

Preview size limit exceeded, changes collapsed.

+5225 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading