| 1 |
# |
| 2 |
# Dump the contents of the SR table using mysqldump |
| 3 |
# |
| 4 |
|
| 5 |
--let $sr_min = `SELECT MIN(seqno) FROM mysql.wsrep_streaming_log` |
| 6 |
--let $sr_max = `SELECT MAX(seqno) FROM mysql.wsrep_streaming_log` |
| 7 |
|
| 8 |
--let $seqno = $sr_min |
| 9 |
while ($seqno <= $sr_max) |
| 10 |
{ |
| 11 |
--let $sr_fragment_file = $MYSQLTEST_VARDIR/tmp/sr_fragment.log |
| 12 |
--exec rm -rf $sr_fragment_file |
| 13 |
--disable_query_log |
| 14 |
--eval SELECT frag INTO DUMPFILE '$sr_fragment_file' FROM mysql.wsrep_streaming_log WHERE seqno = $seqno |
| 15 |
--enable_query_log |
| 16 |
|
| 17 |
--let $sr_binlog_file = $MYSQLTEST_VARDIR/tmp/sr_binlog.log |
| 18 |
--exec rm -rf $sr_binlog_file |
| 19 |
|
| 20 |
--exec cp std_data/binlog-header.binlog $sr_binlog_file |
| 21 |
--exec cat $sr_fragment_file >> $sr_binlog_file |
| 22 |
|
| 23 |
--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /#[0-9]+ +[0-9]+:[0-9]+:[0-9]+/<ISO TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/ /thread_id=[0-9]+/thread_id=<QUERY_THREAD_ID>/ /table id [0-9]+/table id <TABLE_ID>/ /mapped to number [0-9]+/mapped to number <TABLE_ID>/ /auto_increment_increment=[0-9]+/auto_increment_increment=<AUTO_INCREMENT_INCREMENT>/ /auto_increment_offset=[0-9]+/auto_increment_offset=<AUTO_INCREMENT_OFFSET>/ /exec_time=[0-9]+/exec_time=<EXEC_TIME>/ |
| 24 |
--exec $MYSQL_BINLOG $sr_binlog_file --base64-output=decode-rows --start-position=256 --skip-annotate-row-events | grep -v 'SET @' 2>&1 |
| 25 |
|
| 26 |
--inc $seqno |
| 27 |
} |