Debian Codegraph @

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

raw
1 -- source include/have_multi_ndb.inc
2 -- source include/have_binlog_format_mixed_or_row.inc
3 -- source include/have_debug.inc
4
5 #
6 # Test behaviour of Ndb Binlogging with asynchronous
7 # NdbAPI disconnections
8 #
9 # Blobs are relevant as they internally use multiple
10 # separate events which must be merged in the API
11 # to generate single logical row events.
12 #
13 # If the event stream is not consistent around the
14 # disconnection and reconnection then the Blob
15 # merge/reassmebly code is likely to detect a
16 # problem.
17 #
18 # Multiple blob columns are used to increase the
19 # chance of detecting a problem
20 #
21
22 --connection server1
23 --echo Create table with multiple Blob columns
24 create table t1 (a int primary key,
25 b0 text,
26 b1 text,
27 b2 text,
28 b3 text,
29 b4 text,
30 b5 text,
31 b6 text,
32 b7 text,
33 b8 text,
34 b9 text)
35 engine=ndb comment='NDB_TABLE=NOLOGGING=1';
36
37
38 --let $rows=20
39
40 --let $i=$rows
41 --disable_query_log
42 while ($i)
43 {
44 --eval insert into t1 values ($i, repeat('BJC0', 1000), repeat('TSG1', 1000), repeat('EIN2', 1000), repeat('GIM3', 500), repeat('GOC4', 600), repeat('TFL5', 713), repeat('PRH6', 300), repeat('HFB7', 555), repeat('SHC8', 313), repeat('GHC9', 453))
45 --dec $i
46 }
47 --enable_query_log
48
49 delimiter %;
50
51 CREATE DEFINER=`root`@`localhost` PROCEDURE `load1`()
52 begin
53 set @x=1;
54 repeat
55 update test.t1 set b0=repeat('SMT0', 1000),
56 b1=repeat('BML1', 1000),
57 b2=repeat('TMS2', 1000),
58 b3=repeat('LMN3', 500),
59 b4=repeat('LME4', 600),
60 b5=repeat('SMN5', 713),
61 b6=repeat('LMB6', 300),
62 b7=repeat('SMC7', 555),
63 b8=repeat('SML8', 313),
64 b9=repeat('TMS9', 453);
65 set @x=row_count();
66 until @x = 0
67 end repeat;
68 end%
69
70 delimiter ;%
71
72 --echo Starting Blob load on server 1
73 --send call load1()
74
75
76 --connection server2
77 --echo Cause cluster disconnections of server2
78
79 call mtr.add_suppression("incident event has been written to the binary log");
80
81 --let $loops=6
82 while ($loops)
83 {
84 --echo Disconnecting server 2
85 --exec $NDB_MGM -e"ALL DUMP 900 16"
86
87 --sleep 15
88
89 --dec $loops
90 }
91
92 # Wait for recovery
93 --source include/ndb_not_readonly.inc
94
95 --echo Loops done
96 --echo Clear table
97
98 --let $remain=1
99
100 # Delete the rows from the table, so the stored procedure knows
101 # to exit
102 --disable_query_log
103 --disable_result_log
104 while($remain)
105 {
106 --error 0, 1205
107 delete from test.t1;
108
109 --let $remain = query_get_value(select count(1) as c from test.t1, c, 1)
110 }
111
112 --enable_result_log
113 --enable_query_log
114 --echo Returing to server1
115 --connection server1
116 # May get lock timeout (deadlock) from stored proc
117 # deadlocking with delete - that's ok
118 --error 0, 1205
119 --reap
120
121 drop procedure load1;
122 drop table t1;