summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_gtid_thread_id.test
blob: ff9f653e271d913ed9b37b54ab444032acd8ded3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# This will test If Gtid_log_event have thread_id info
#
--source include/have_binlog_format_row.inc
--source include/master-slave.inc

--connection master
--let thread_id=`select connection_id()`
create table t1(a int);
insert into t1 values(1);
insert into t1 values(1);
set @@pseudo_thread_id=99999;
drop table t1;

--sync_slave_with_master
let datadir= `select @@datadir`;
let filename= slave-bin.000001;
let local=$datadir/slave-bin.000001;
let outfile=$MYSQLTEST_VARDIR/tmp/binlog.sql;
exec $MYSQL_BINLOG $local > $outfile;

--let SEARCH_FILE= $outfile
## Should be same as master thread_id $thread_id
--let SEARCH_PATTERN=GTID [0-9]-[0-9]-[0-9] trans thread_id=$thread_id\n
--echo #Only 2 matches
##replace the thread_id beacsue it an be different on different runs
--replace_regex /thread_id=[0-9]+/thread_id=master_thread_id /
--source include/search_pattern_in_file.inc

#Please note that \n after $thread_id is important otherwise it can match
#prefix of @@pseudo_thread_id set at master
--let SEARCH_PATTERN=GTID [0-9]-[0-9]-[0-9] ddl thread_id=$thread_id\n
--echo #Only 1 matches
--replace_regex /thread_id=[0-9]+/thread_id=master_thread_id /
--source include/search_pattern_in_file.inc

## Should be same as master pseudo_thread_id 99999
--let SEARCH_PATTERN=GTID [0-9]-[0-9]-[0-9] ddl thread_id=99999\n
--echo #Only 1 matches
--source include/search_pattern_in_file.inc
remove_file $outfile;

--source include/rpl_end.inc