| 1 |
# |
| 2 |
# Munch the mysqlbinlog tool output into deterministic form to look at server ids |
| 3 |
# |
| 4 |
|
| 5 |
--disable_query_log |
| 6 |
let $_dump_file= $MYSQLTEST_VARDIR/tmp/rpl_ndb_mysqlbinlog.sql; |
| 7 |
let $_datadir= `select @@datadir`; |
| 8 |
--exec $MYSQL_BINLOG --verbose $_datadir/$BINLOG_FILENAME.000001 > $_dump_file |
| 9 |
set sql_log_bin=0; |
| 10 |
create table raw_binlog_rows (txt varchar(1000)); |
| 11 |
eval load data infile '$_dump_file' into table raw_binlog_rows |
| 12 |
columns terminated by '\n'; |
| 13 |
remove_file $_dump_file; |
| 14 |
|
| 15 |
# |
| 16 |
# Show the values for 'server id' and 'event type' in the mysqlbinlog output. |
| 17 |
# Remove other non-deterministic and uninteresting elements. |
| 18 |
# |
| 19 |
echo select 'server id' and 'event type' from mysqlbinlog output; |
| 20 |
replace_regex |
| 21 |
/#[0-9]*[ ]*[0-9]*:[0-9]*:[0-9]* server id /server id / |
| 22 |
/thread_id=[0-9]*// |
| 23 |
/exec_time=[0-9]*// |
| 24 |
/end_log_pos [0-9]*// |
| 25 |
/table id [0-9]*// |
| 26 |
/error_code=[0-9]*// |
| 27 |
/mapped to number [0-9]*// |
| 28 |
/CRC32 0x[0-9a-f]{8}// |
| 29 |
/last_committed=[0-9]*// |
| 30 |
/sequence_number=[0-9]*// |
| 31 |
/rbr_only=[a-z]+// |
| 32 |
/Xid = [0-9]*// |
| 33 |
/original_committed_timestamp=[0-9]*.immediate_commit_timestamp=[0-9]*// |
| 34 |
/transaction_length=[0-9]*// |
| 35 |
/\t// |
| 36 |
; |
| 37 |
select replace(txt, '\r', '') as binlog_entries from raw_binlog_rows |
| 38 |
where txt like '%server id%' |
| 39 |
and not (txt like '%Start%' or |
| 40 |
txt like '%Rotate%' or |
| 41 |
txt like '%Anonymous\_GTID%' or |
| 42 |
txt like '%Previous-GTIDs%'); |
| 43 |
|
| 44 |
drop table raw_binlog_rows; |
| 45 |
set sql_log_bin=1; |
| 46 |
--enable_query_log |