| 1 |
######################################################## |
| 2 |
# WHAT |
| 3 |
# ==== |
| 4 |
# This test aims to check that the mysqlbinlog --verbose |
| 5 |
# command can output binlogs in 4 format variants. |
| 6 |
# |
| 7 |
# 1) Updates logged as write_row events |
| 8 |
# Only primary key and updated columns included in the |
| 9 |
# event |
| 10 |
# 2) Updates logged as write_row_events |
| 11 |
# All columns included in the event |
| 12 |
# 3) Updates logged as update_row events |
| 13 |
# Only primary key and updated columns included in the |
| 14 |
# event |
| 15 |
# 4) Updates logged as update_row events |
| 16 |
# All columns included in the event |
| 17 |
######################################################## |
| 18 |
|
| 19 |
# We require binlog_format_row as we're independent of binlog format |
| 20 |
# and there's no point running the same test 3 times |
| 21 |
-- source include/have_binlog_format_row.inc |
| 22 |
|
| 23 |
--disable_query_log |
| 24 |
--let $binlog_file=write-partial-row.binlog |
| 25 |
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 26 |
create table raw_binlog_rows (txt varchar(1000)); |
| 27 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
| 28 |
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 29 |
--enable_query_log |
| 30 |
--echo Verbose statements from : $binlog_file |
| 31 |
# Output --verbose lines, with extra Windows CR's trimmed |
| 32 |
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; |
| 33 |
drop table raw_binlog_rows; |
| 34 |
|
| 35 |
--disable_query_log |
| 36 |
--let $binlog_file=write-full-row.binlog |
| 37 |
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 38 |
create table raw_binlog_rows (txt varchar(1000)); |
| 39 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
| 40 |
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 41 |
--enable_query_log |
| 42 |
--echo Verbose statements from : $binlog_file |
| 43 |
# Output --verbose lines, with extra Windows CR's trimmed |
| 44 |
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; |
| 45 |
drop table raw_binlog_rows; |
| 46 |
|
| 47 |
--disable_query_log |
| 48 |
--let $binlog_file=update-partial-row.binlog |
| 49 |
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 50 |
create table raw_binlog_rows (txt varchar(1000)); |
| 51 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
| 52 |
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 53 |
--enable_query_log |
| 54 |
--echo Verbose statements from : $binlog_file |
| 55 |
# Output --verbose lines, with extra Windows CR's trimmed |
| 56 |
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; |
| 57 |
drop table raw_binlog_rows; |
| 58 |
|
| 59 |
--disable_query_log |
| 60 |
--let $binlog_file=update-full-row.binlog |
| 61 |
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 62 |
create table raw_binlog_rows (txt varchar(1000)); |
| 63 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n'; |
| 64 |
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql |
| 65 |
--enable_query_log |
| 66 |
--echo Verbose statements from : $binlog_file |
| 67 |
# Output --verbose lines, with extra Windows CR's trimmed |
| 68 |
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; |
| 69 |
drop table raw_binlog_rows; |