Debian Codegraph @

mysql-test/suite/ndb_binlog/t/ndb_binlog_index.test

raw
1 --source include/have_ndb.inc
2 --source include/have_log_bin.inc
3
4 --disable_query_log
5 reset master;
6 --enable_query_log
7
8 --echo -------------------------------------------------
9 --echo First run using ndb_binlog_index table containing
10 --echo epoch end position information
11 --echo -------------------------------------------------
12 show create table mysql.ndb_binlog_index;
13
14 --source suite/ndb_binlog/t/ndb_binlog_index_test_schema_independent.inc
15
16 --echo ------------------------------------------------
17 --echo Second run using ndb_binlog_index table without
18 --echo epoch end position information
19 --echo ------------------------------------------------
20
21 alter table mysql.ndb_binlog_index drop column next_file;
22 alter table mysql.ndb_binlog_index drop column next_position;
23 reset master;
24 show create table mysql.ndb_binlog_index;
25
26 --source suite/ndb_binlog/t/ndb_binlog_index_test_schema_independent.inc
27
28 --echo Now restore original schema
29 reset master;
30
31 alter table mysql.ndb_binlog_index add column next_position bigint unsigned not null;
32 alter table mysql.ndb_binlog_index add column next_file varchar(255) not null;
33
34 reset master;
35
36 --echo --------------------------------------
37 --echo Quick test of ndb-log-empty-epochs = 1
38 --echo --------------------------------------
39
40 select * from mysql.ndb_binlog_index order by epoch;
41
42 --source include/show_binlog_events.inc
43 show variables like 'ndb_log_empty_epochs';
44
45 set global ndb_log_empty_epochs=1;
46 show variables like 'ndb_log_empty_epochs';
47
48 --echo Allow some empty epochs to pass...
49
50 let $got_some_epochs=0;
51
52 while(!$got_some_epochs)
53 {
54 let $got_some_epochs=query_get_value(select (count(1) > 10) as num from mysql.ndb_binlog_index, num, 1);
55 --sleep 1
56 }
57
58 --echo Show that we have entries in ndb_binlog_index
59 select count(1) > 0 from mysql.ndb_binlog_index;
60
61 --echo Show that all ndb_binlog_index entries have the same file + position
62 select bi1.epoch, bi1.Position, bi1.File, bi1.next_position, bi1.next_file,
63 bi2.epoch, bi2.Position, bi2.File, bi2.next_position, bi2.next_file
64 from mysql.ndb_binlog_index as bi1,
65 mysql.ndb_binlog_index as bi2
66 where
67 # Start and Next not same
68 bi1.Position != bi1.next_position OR
69 bi1.File != bi1.next_file OR
70 # All epochs not the same
71 bi1.Position != bi2.Position OR
72 bi1.File != bi2.File;
73
74 --echo Show that we have no epochs in the Binlog
75 --source include/show_binlog_events.inc
76
77 --echo Disable
78 set global ndb_log_empty_epochs=0;
79