1##################################################################
2# rpl_row_big_table_id
3#
4# MDEV-17803 Row-based event is not applied when
5# table map id is greater 32 bit int
6#
7# Verify row-based events applying when table map id value is about and greater
8# than 1 << 32.
9##################################################################
10--source include/not_valgrind.inc
11--source include/word_size.inc
12--source include/have_debug.inc
13--source include/have_binlog_format_row.inc
14--source include/master-slave.inc
15
16--connection master
17# To reset last table id
18--let $rpl_server_number= 1
19--source include/rpl_restart_server.inc
20
21SET @saved_dbug = @@SESSION.debug_dbug;
22SET @@debug_dbug="d,simulate_big_table_id";
23CREATE TABLE t (a int);
24
25--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
26--let $binlog_pos=  query_get_value(SHOW MASTER STATUS, Position, 1)
27INSERT INTO t SET a= 0;
28ALTER TABLE t comment '';
29INSERT INTO t SET a= 1;
30ALTER TABLE t comment '';
31INSERT INTO t SET a= 2;
32ALTER TABLE t comment '';
33INSERT INTO t SET a= 3;
34
35# display simulated big table_id
36--let $_in_from=in '$binlog_file' from $binlog_pos
37--replace_result "$_in_from" "in <file> from  <pos>"
38--replace_column 2 # 5 #
39--replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/
40--eval show binlog events in '$binlog_file' from $binlog_pos
41
42
43--sync_slave_with_master
44
45if (`SELECT sum(a) != 6 FROM t`)
46{
47  --echo *** unexpected result; check slave applier ***
48  --die
49}
50
51
52# Cleanup
53
54--connection master
55DROP TABLE t;
56SET debug_dbug= @saved_dbug;
57--sync_slave_with_master
58
59--source include/rpl_end.inc
60