| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_log_bin.inc |
| 3 |
--source include/have_debug.inc |
| 4 |
|
| 5 |
use test; |
| 6 |
|
| 7 |
reset master; |
| 8 |
|
| 9 |
create table t1 (a int primary key, b int) engine=ndb; |
| 10 |
|
| 11 |
--echo Low level transport test |
| 12 |
set global debug='+d,ndb_injector_set_event_conflict_flags'; |
| 13 |
|
| 14 |
--echo Two inserts to the same table, with nothing else in the epoch, |
| 15 |
--echo will be grouped together in one binlog event, as the |
| 16 |
--echo extra row info is the same. |
| 17 |
insert into test.t1 values (1,1), (2,2); |
| 18 |
|
| 19 |
# Wait for epoch boundary |
| 20 |
--disable_query_log |
| 21 |
--disable_result_log |
| 22 |
show binlog events; |
| 23 |
--enable_result_log |
| 24 |
--enable_query_log |
| 25 |
|
| 26 |
--echo A separate delete. |
| 27 |
delete from test.t1 where a=2; |
| 28 |
|
| 29 |
# Wait for epoch boundary |
| 30 |
--disable_query_log |
| 31 |
--disable_result_log |
| 32 |
show binlog events; |
| 33 |
--enable_result_log |
| 34 |
--enable_query_log |
| 35 |
|
| 36 |
|
| 37 |
--disable_query_log |
| 38 |
let $MYSQLD_DATADIR= `select @@datadir;`; |
| 39 |
--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql |
| 40 |
|
| 41 |
create table raw_binlog_rows (txt varchar(1000)); |
| 42 |
|
| 43 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n'; |
| 44 |
|
| 45 |
select replace(txt, '\r', '') as txt from raw_binlog_rows where txt like '### Extra row ndb info: data_format:%'; |
| 46 |
|
| 47 |
|
| 48 |
drop table raw_binlog_rows; |
| 49 |
--enable_query_log |
| 50 |
|
| 51 |
set global debug=''; |
| 52 |
delete from test.t1; |
| 53 |
|
| 54 |
# Wait for delete to be written to binlog before RESET MASTER |
| 55 |
--disable_query_log |
| 56 |
--disable_result_log |
| 57 |
show binlog events; |
| 58 |
--enable_result_log |
| 59 |
--enable_query_log |
| 60 |
|
| 61 |
reset master; |
| 62 |
|
| 63 |
--echo Specific flag settings test : Reflect |
| 64 |
|
| 65 |
set global debug='+d,ndb_set_reflect_anyvalue'; |
| 66 |
|
| 67 |
--echo Two inserts to the same table, with nothing else in the epoch, |
| 68 |
--echo will be grouped together in one binlog event, as the |
| 69 |
--echo extra row info is the same. |
| 70 |
insert into test.t1 values (1,1), (2,2); |
| 71 |
|
| 72 |
# Wait for epoch boundary |
| 73 |
--disable_query_log |
| 74 |
--disable_result_log |
| 75 |
show binlog events; |
| 76 |
--enable_result_log |
| 77 |
--enable_query_log |
| 78 |
|
| 79 |
--echo A separate delete. |
| 80 |
delete from test.t1 where a=2; |
| 81 |
|
| 82 |
# Wait for epoch boundary |
| 83 |
--disable_query_log |
| 84 |
--disable_result_log |
| 85 |
show binlog events; |
| 86 |
--enable_result_log |
| 87 |
--enable_query_log |
| 88 |
|
| 89 |
|
| 90 |
--disable_query_log |
| 91 |
let $MYSQLD_DATADIR= `select @@datadir;`; |
| 92 |
--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql |
| 93 |
|
| 94 |
create table raw_binlog_rows (txt varchar(1000)); |
| 95 |
|
| 96 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n'; |
| 97 |
|
| 98 |
select replace(txt, '\r', '') as txt from raw_binlog_rows where txt like '### Extra row ndb info: data_format:%'; |
| 99 |
|
| 100 |
|
| 101 |
drop table raw_binlog_rows; |
| 102 |
--enable_query_log |
| 103 |
|
| 104 |
set global debug=''; |
| 105 |
delete from test.t1; |
| 106 |
|
| 107 |
# Wait for delete to be written to binlog before RESET MASTER |
| 108 |
--disable_query_log |
| 109 |
--disable_result_log |
| 110 |
show binlog events; |
| 111 |
--enable_result_log |
| 112 |
--enable_query_log |
| 113 |
|
| 114 |
reset master; |
| 115 |
|
| 116 |
--echo Specific flag settings test : Refresh |
| 117 |
set global debug='+d,ndb_set_refresh_anyvalue'; |
| 118 |
|
| 119 |
--echo Two inserts to the same table, with nothing else in the epoch, |
| 120 |
--echo will be grouped together in one binlog event, as the |
| 121 |
--echo extra row info is the same. |
| 122 |
insert into test.t1 values (1,1), (2,2); |
| 123 |
|
| 124 |
# Wait for epoch boundary |
| 125 |
--disable_query_log |
| 126 |
--disable_result_log |
| 127 |
show binlog events; |
| 128 |
--enable_result_log |
| 129 |
--enable_query_log |
| 130 |
|
| 131 |
--echo A separate delete. |
| 132 |
delete from test.t1 where a=2; |
| 133 |
|
| 134 |
# Wait for epoch boundary |
| 135 |
--disable_query_log |
| 136 |
--disable_result_log |
| 137 |
show binlog events; |
| 138 |
--enable_result_log |
| 139 |
--enable_query_log |
| 140 |
|
| 141 |
|
| 142 |
--disable_query_log |
| 143 |
let $MYSQLD_DATADIR= `select @@datadir;`; |
| 144 |
--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql |
| 145 |
|
| 146 |
create table raw_binlog_rows (txt varchar(1000)); |
| 147 |
|
| 148 |
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n'; |
| 149 |
|
| 150 |
select replace(txt, '\r', '') as txt from raw_binlog_rows where txt like '### Extra row ndb info: data_format:%'; |
| 151 |
|
| 152 |
|
| 153 |
drop table raw_binlog_rows; |
| 154 |
--enable_query_log |
| 155 |
|
| 156 |
set global debug=''; |
| 157 |
|
| 158 |
drop table t1; |
| 159 |
--remove_file $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql |