File: rpl_extra_row_data.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (76 lines) | stat: -rw-r--r-- 2,513 bytes parent folder | download
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
--source include/not_group_replication_plugin.inc
--source include/have_debug.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc

connection slave;
--let $debug_point_silent= 1
--let $debug_point= extra_row_ndb_info_check
--source include/add_debug_point.inc
connection master;
--let $debug_point= extra_row_ndb_info_set_618
--source include/add_debug_point.inc
--echo Basic insert, update, delete from Master->Slave
--echo DBUG code will set + check transfer of extra
--echo row data in RBR
--echo **** On Master ****
CREATE TABLE t1 (a INT);

--echo Ten inserts in one transaction -> 1 epoch transaction
BEGIN;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
COMMIT;

--echo Wait for Binlog-on-disk
flush logs;

--echo Check that we have the expected extra row data in the Binlog
create table raw_data(txt varchar(1000));
--disable_query_log
let $MYSQLD_DATADIR= `select @@datadir;`;
--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/rpl_extra_row_ndb_info.out

--eval load data local infile '$MYSQLTEST_VARDIR/tmp/rpl_extra_row_ndb_info.out' into table raw_data columns terminated by '\n';
--enable_query_log

select replace(txt, '\r', '') from raw_data where txt like '%### Extra row ndb info: data_format:%' order by txt;
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_extra_row_ndb_info.out
drop table raw_data;

--echo Generate some more insert, update, delete traffic
INSERT INTO t1 SELECT a+10 FROM t1;
INSERT INTO t1 SELECT a+20 FROM t1;
INSERT INTO t1 SELECT a+40 FROM t1;
# 80 rows, 80 inserts
UPDATE t1 SET a = a+1;
UPDATE t1 SET a = a+1;
UPDATE t1 SET a = a+1;
UPDATE t1 SET a = a+1;
UPDATE t1 SET a = a+1;
# 5 Updates of 80 rows = 400 updates, enough to show all potential lengths
# of Binlog extra row data including 0 + 255.

# 10 deletes
DELETE FROM t1 WHERE a > 390;

#show binlog events;
#let $MYSQLD_DATADIR= `select @@datadir;`;
#--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/master-bin.000001

--echo **** On Slave ****
--source include/sync_slave_sql_with_master.inc
connection slave;

--echo Check row count and that slave is running ok
SELECT count(*) from t1;
source include/check_slave_is_running.inc;

connection master;
DROP TABLE t1;
--source include/sync_slave_sql_with_master.inc
--let $debug_point= extra_row_ndb_info_check
--source include/remove_debug_point.inc
connection master;
--let $debug_point= extra_row_ndb_info_set_618
--source include/remove_debug_point.inc
--source include/rpl_end.inc