Browse Source
Bug#47323 : mysqlbinlog --verbose displays bad output when events contain subset of columns
Bug#47323 : mysqlbinlog --verbose displays bad output when events contain subset of columns
Commit the non-NDB specific part (originated by frazer) to 5.1 mainline.pull/374/head
7 changed files with 248 additions and 1 deletions
-
161mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_verbose.result
-
BINmysql-test/suite/binlog/std_data/update-full-row.binlog
-
BINmysql-test/suite/binlog/std_data/update-partial-row.binlog
-
BINmysql-test/suite/binlog/std_data/write-full-row.binlog
-
BINmysql-test/suite/binlog/std_data/write-partial-row.binlog
-
82mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_verbose.test
-
6sql/log_event.cc
@ -0,0 +1,161 @@ |
|||||
|
Verbose statements from : write-partial-row.binlog |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
txt |
||||
|
### INSERT INTO mysql.ndb_apply_status |
||||
|
### SET |
||||
|
### @1=1 |
||||
|
### @2=25769803786 |
||||
|
### @3='' |
||||
|
### @4=0 |
||||
|
### @5=0 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=3 |
||||
|
### @2=3 |
||||
|
### @3=3 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=1 |
||||
|
### @2=1 |
||||
|
### @3=1 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=2 |
||||
|
### @2=2 |
||||
|
### @3=2 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @2=4 |
||||
|
### @3=4 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @3=40 |
||||
|
### DELETE FROM test.ba |
||||
|
### WHERE |
||||
|
### @1=2 |
||||
|
drop table raw_binlog_rows; |
||||
|
Verbose statements from : write-full-row.binlog |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
txt |
||||
|
### INSERT INTO mysql.ndb_apply_status |
||||
|
### SET |
||||
|
### @1=2 |
||||
|
### @2=25769803786 |
||||
|
### @3='' |
||||
|
### @4=0 |
||||
|
### @5=0 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=3 |
||||
|
### @2=3 |
||||
|
### @3=3 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=1 |
||||
|
### @2=1 |
||||
|
### @3=1 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=2 |
||||
|
### @2=2 |
||||
|
### @3=2 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @2=4 |
||||
|
### @3=4 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @2=4 |
||||
|
### @3=40 |
||||
|
### DELETE FROM test.ba |
||||
|
### WHERE |
||||
|
### @1=2 |
||||
|
drop table raw_binlog_rows; |
||||
|
Verbose statements from : update-partial-row.binlog |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
txt |
||||
|
### INSERT INTO mysql.ndb_apply_status |
||||
|
### SET |
||||
|
### @1=3 |
||||
|
### @2=25769803786 |
||||
|
### @3='' |
||||
|
### @4=0 |
||||
|
### @5=0 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=3 |
||||
|
### @2=3 |
||||
|
### @3=3 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=1 |
||||
|
### @2=1 |
||||
|
### @3=1 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=2 |
||||
|
### @2=2 |
||||
|
### @3=2 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @2=4 |
||||
|
### @3=4 |
||||
|
### UPDATE test.ba |
||||
|
### WHERE |
||||
|
### @1=4 |
||||
|
### @3=4 |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @3=40 |
||||
|
### DELETE FROM test.ba |
||||
|
### WHERE |
||||
|
### @1=2 |
||||
|
drop table raw_binlog_rows; |
||||
|
Verbose statements from : update-full-row.binlog |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
txt |
||||
|
### INSERT INTO mysql.ndb_apply_status |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @2=25769803786 |
||||
|
### @3='' |
||||
|
### @4=0 |
||||
|
### @5=0 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=3 |
||||
|
### @2=3 |
||||
|
### @3=3 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=1 |
||||
|
### @2=1 |
||||
|
### @3=1 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=2 |
||||
|
### @2=2 |
||||
|
### @3=2 |
||||
|
### INSERT INTO test.ba |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @2=4 |
||||
|
### @3=4 |
||||
|
### UPDATE test.ba |
||||
|
### WHERE |
||||
|
### @1=4 |
||||
|
### @2=4 |
||||
|
### @3=4 |
||||
|
### SET |
||||
|
### @1=4 |
||||
|
### @2=4 |
||||
|
### @3=40 |
||||
|
### DELETE FROM test.ba |
||||
|
### WHERE |
||||
|
### @1=2 |
||||
|
drop table raw_binlog_rows; |
||||
@ -0,0 +1,82 @@ |
|||||
|
######################################################## |
||||
|
# Test mysqlbinlog command with Ndb produced Binlog |
||||
|
# variants |
||||
|
# |
||||
|
# WHAT |
||||
|
# ==== |
||||
|
# This test aims to check that the mysqlbinlog --verbose |
||||
|
# command can output binlogs in 4 format variants, currently |
||||
|
# used by Ndb |
||||
|
# |
||||
|
# 1) Updates logged as write_row events |
||||
|
# Only primary key and updated columns included in the |
||||
|
# event |
||||
|
# 2) Updates logged as write_row_events |
||||
|
# All columns included in the event |
||||
|
# 3) Updates logged as update_row events |
||||
|
# Only primary key and updated columns included in the |
||||
|
# event |
||||
|
# 4) Updates logged as update_row events |
||||
|
# All columns included in the event |
||||
|
# |
||||
|
# Format variant (1) is the Ndb default. |
||||
|
# Bug#47323 resulted in binlogs generated in format (1) |
||||
|
# being incorrectly parsed by the mysqlbinlog --verbose |
||||
|
# option |
||||
|
# |
||||
|
# HOW |
||||
|
# === |
||||
|
# Row-based binlog files in each format have been |
||||
|
# captured from an Ndb cluster |
||||
|
# These are output using the mysqlbinlog --verbose |
||||
|
# tool and the output is checked. |
||||
|
# |
||||
|
######################################################## |
||||
|
|
||||
|
# We require binlog_format_row as we're independent of binlog format |
||||
|
# and there's no point running the same test 3 times |
||||
|
-- source include/have_binlog_format_row.inc |
||||
|
|
||||
|
--disable_query_log |
||||
|
--let $binlog_file=write-partial-row.binlog |
||||
|
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
create table raw_binlog_rows (txt varchar(1000)); |
||||
|
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
||||
|
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
--enable_query_log |
||||
|
--echo Verbose statements from : $binlog_file |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
drop table raw_binlog_rows; |
||||
|
|
||||
|
--disable_query_log |
||||
|
--let $binlog_file=write-full-row.binlog |
||||
|
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
create table raw_binlog_rows (txt varchar(1000)); |
||||
|
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
||||
|
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
--enable_query_log |
||||
|
--echo Verbose statements from : $binlog_file |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
drop table raw_binlog_rows; |
||||
|
|
||||
|
--disable_query_log |
||||
|
--let $binlog_file=update-partial-row.binlog |
||||
|
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
create table raw_binlog_rows (txt varchar(1000)); |
||||
|
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
||||
|
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
--enable_query_log |
||||
|
--echo Verbose statements from : $binlog_file |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
drop table raw_binlog_rows; |
||||
|
|
||||
|
--disable_query_log |
||||
|
--let $binlog_file=update-full-row.binlog |
||||
|
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
create table raw_binlog_rows (txt varchar(1000)); |
||||
|
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
||||
|
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
||||
|
--enable_query_log |
||||
|
--echo Verbose statements from : $binlog_file |
||||
|
select txt from raw_binlog_rows where txt like '###%'; |
||||
|
drop table raw_binlog_rows; |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue