| 1 |
--source include/not_group_replication_plugin.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
--source include/have_binlog_format_row.inc |
| 4 |
--source include/master-slave.inc |
| 5 |
|
| 6 |
connection slave; |
| 7 |
--let $debug_point_silent= 1 |
| 8 |
--let $debug_point= extra_row_ndb_info_check |
| 9 |
--source include/add_debug_point.inc |
| 10 |
connection master; |
| 11 |
--let $debug_point= extra_row_ndb_info_set_618 |
| 12 |
--source include/add_debug_point.inc |
| 13 |
--echo Basic insert, update, delete from Master->Slave |
| 14 |
--echo DBUG code will set + check transfer of extra |
| 15 |
--echo row data in RBR |
| 16 |
--echo **** On Master **** |
| 17 |
CREATE TABLE t1 (a INT); |
| 18 |
|
| 19 |
--echo Ten inserts in one transaction -> 1 epoch transaction |
| 20 |
BEGIN; |
| 21 |
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); |
| 22 |
COMMIT; |
| 23 |
|
| 24 |
--echo Wait for Binlog-on-disk |
| 25 |
flush logs; |
| 26 |
|
| 27 |
--echo Check that we have the expected extra row data in the Binlog |
| 28 |
create table raw_data(txt varchar(1000)); |
| 29 |
--disable_query_log |
| 30 |
let $MYSQLD_DATADIR= `select @@datadir;`; |
| 31 |
--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/rpl_extra_row_ndb_info.out |
| 32 |
|
| 33 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/rpl_extra_row_ndb_info.out' into table raw_data columns terminated by '\n'; |
| 34 |
--enable_query_log |
| 35 |
|
| 36 |
select replace(txt, '\r', '') from raw_data where txt like '%### Extra row ndb info: data_format:%' order by txt; |
| 37 |
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_extra_row_ndb_info.out |
| 38 |
drop table raw_data; |
| 39 |
|
| 40 |
--echo Generate some more insert, update, delete traffic |
| 41 |
INSERT INTO t1 SELECT a+10 FROM t1; |
| 42 |
INSERT INTO t1 SELECT a+20 FROM t1; |
| 43 |
INSERT INTO t1 SELECT a+40 FROM t1; |
| 44 |
# 80 rows, 80 inserts |
| 45 |
UPDATE t1 SET a = a+1; |
| 46 |
UPDATE t1 SET a = a+1; |
| 47 |
UPDATE t1 SET a = a+1; |
| 48 |
UPDATE t1 SET a = a+1; |
| 49 |
UPDATE t1 SET a = a+1; |
| 50 |
# 5 Updates of 80 rows = 400 updates, enough to show all potential lengths |
| 51 |
# of Binlog extra row data including 0 + 255. |
| 52 |
|
| 53 |
# 10 deletes |
| 54 |
DELETE FROM t1 WHERE a > 390; |
| 55 |
|
| 56 |
#show binlog events; |
| 57 |
#let $MYSQLD_DATADIR= `select @@datadir;`; |
| 58 |
#--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/master-bin.000001 |
| 59 |
|
| 60 |
--echo **** On Slave **** |
| 61 |
--source include/sync_slave_sql_with_master.inc |
| 62 |
connection slave; |
| 63 |
|
| 64 |
--echo Check row count and that slave is running ok |
| 65 |
SELECT count(*) from t1; |
| 66 |
source include/check_slave_is_running.inc; |
| 67 |
|
| 68 |
connection master; |
| 69 |
DROP TABLE t1; |
| 70 |
--source include/sync_slave_sql_with_master.inc |
| 71 |
--let $debug_point= extra_row_ndb_info_check |
| 72 |
--source include/remove_debug_point.inc |
| 73 |
connection master; |
| 74 |
--let $debug_point= extra_row_ndb_info_set_618 |
| 75 |
--source include/remove_debug_point.inc |
| 76 |
--source include/rpl_end.inc |