Debian Codegraph @

mysql-test/suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc

raw
1 #
2 # Get the mysqlbinlog tool --verbose mode to dump the Binlog contents with
3 # extra row data included, e.g.
4 #
5 #### Extra row ndb info: data_format: 0, len: 8 :0x0007200006000000
6 #
7 # Then process this input to get the number of distinct values, and hence
8 # distinct transaction ids in the binlog
9 #
10
11 --disable_query_log
12 let $MYSQLD_DATADIR= `select @@datadir;`;
13 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
14
15 create table raw_binlog_rows (txt varchar(1000));
16 create table diff_extra_data (txt varchar(1000));
17
18 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
19
20 insert into diff_extra_data select distinct(txt) from raw_binlog_rows where txt like '### Extra row ndb info: data_format:%';
21 --enable_query_log
22
23 --echo Number of different transaction ids in Binlog
24 select count(1) as number_of_transactions from diff_extra_data;
25
26 --disable_query_log
27 drop table diff_extra_data;
28 drop table raw_binlog_rows;
29 --enable_query_log
30 --remove_file $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql