1
################################################################################
2
# This test case checks if the option "binlog-direct-non-transactional-updates"
3
# makes non-transactional changes in the statement format to be written to the
4
# binary log as soon as the statement commits.
6
# In what follows, we use the include file rpl_mixing_engines.inc to generate
7
# sql commands from a format string. The format string consists of a sequence of
8
# 'codes' separated by spaces. Before it set of commands, we paste the expected
9
# sequence in the binary log. The following codes exist:
11
# - Define the scope of a transaction:
16
# - Change only T-Tables:
17
# T - Updates a T-Table.
18
# T-trig - Updates T-Tables through a trigger.
19
# T-func - Updates T-Tables through a function.
20
# T-proc - Updates T-Tables through a procedure.
21
# eT - Fails while updating the first tuple in a T-Table.
22
# Te - Fails while updating an n-tuple (n > 1) in a T-Table.
23
# Te-trig - Fails while updating an n-tuple (n > 1) in a T-Table.
24
# Te-func - Fails while updating an n-tuple (n > 1) in a T-Table.
26
# - Change only N-Tables
27
# N - Updates a N-Table.
28
# N-trig - Updates N-Tables through a trigger.
29
# N-func - Updates N-Tables through a function.
30
# N-proc - Updates N-Tables through a procedure.
31
# eN - Fails while updating the first tuple in a N-Table.
32
# Ne - Fails while updating an n-tuple (n > 1) in a N-Table.
33
# Ne-trig - Fails while updating an n-tuple (n > 1) in a N-Table.
34
# Ne-func - Fails while updating an n-tuple (n > 1) in a N-Table.
35
################################################################################
37
--source include/have_binlog_format_statement.inc
38
--source include/master-slave.inc
39
--source include/have_innodb.inc
41
set @@session.binlog_direct_non_transactional_updates= TRUE;
43
--echo #########################################################################
44
--echo # CONFIGURATION
45
--echo #########################################################################
47
--let $engine_type= Innodb
48
SET @commands= 'configure';
49
--source extra/rpl_tests/rpl_mixing_engines.inc
51
--echo #########################################################################
52
--echo # 1 - BINLOG ORDER
53
--echo #########################################################################
61
--echo #3) Generates in the binlog what follows:
62
--echo # --> STMT "N B T C" entries, format S.
64
SET @commands= 'B T N C';
65
--source extra/rpl_tests/rpl_mixing_engines.inc
67
SET @commands= 'B T N-trig C';
68
--source extra/rpl_tests/rpl_mixing_engines.inc
70
SET @commands= 'B T N-func C';
71
--source extra/rpl_tests/rpl_mixing_engines.inc
73
SET @commands= 'B T N-proc C';
74
--source extra/rpl_tests/rpl_mixing_engines.inc
76
SET @commands= 'B T-trig N C';
77
--source extra/rpl_tests/rpl_mixing_engines.inc
79
SET @commands= 'B T-trig N-trig C';
80
--source extra/rpl_tests/rpl_mixing_engines.inc
82
SET @commands= 'B T-trig N-func C';
83
--source extra/rpl_tests/rpl_mixing_engines.inc
85
SET @commands= 'B T-trig N-proc C';
86
--source extra/rpl_tests/rpl_mixing_engines.inc
88
SET @commands= 'B T-func N C';
89
--source extra/rpl_tests/rpl_mixing_engines.inc
91
SET @commands= 'B T-func N-trig C';
92
--source extra/rpl_tests/rpl_mixing_engines.inc
94
SET @commands= 'B T-func N-func C';
95
--source extra/rpl_tests/rpl_mixing_engines.inc
97
SET @commands= 'B T-func N-proc C';
98
--source extra/rpl_tests/rpl_mixing_engines.inc
100
SET @commands= 'B T-proc N C';
101
--source extra/rpl_tests/rpl_mixing_engines.inc
103
SET @commands= 'B T-proc N-trig C';
104
--source extra/rpl_tests/rpl_mixing_engines.inc
106
SET @commands= 'B T-proc N-func C';
107
--source extra/rpl_tests/rpl_mixing_engines.inc
109
SET @commands= 'B T-proc N-proc C';
110
--source extra/rpl_tests/rpl_mixing_engines.inc
118
--echo #3.e) Generates in the binlog what follows if T-* fails:
119
--echo # --> STMT "N" entry, format S.
120
--echo # Otherwise, what follows if N-* fails and a N-Table is changed:
121
--echo # --> STMT "N B T C" entries, format S.
123
SET @commands= 'B eT N C';
124
--source extra/rpl_tests/rpl_mixing_engines.inc
126
SET @commands= 'B Te N C';
127
--source extra/rpl_tests/rpl_mixing_engines.inc
129
SET @commands= 'B T eN C';
130
--source extra/rpl_tests/rpl_mixing_engines.inc
132
SET @commands= 'B T Ne C';
133
--source extra/rpl_tests/rpl_mixing_engines.inc
141
--echo #4) Generates in the binlog what follows:
142
--echo # --> STMT "N B T R" entries, format S.
144
SET @commands= 'B T N R';
145
--source extra/rpl_tests/rpl_mixing_engines.inc
147
SET @commands= 'B T N-trig R';
148
--source extra/rpl_tests/rpl_mixing_engines.inc
150
SET @commands= 'B T N-func R';
151
--source extra/rpl_tests/rpl_mixing_engines.inc
153
SET @commands= 'B T N-proc R';
154
--source extra/rpl_tests/rpl_mixing_engines.inc
156
SET @commands= 'B T-trig N R';
157
--source extra/rpl_tests/rpl_mixing_engines.inc
159
SET @commands= 'B T-trig N-trig R';
160
--source extra/rpl_tests/rpl_mixing_engines.inc
162
SET @commands= 'B T-trig N-func R';
163
--source extra/rpl_tests/rpl_mixing_engines.inc
165
SET @commands= 'B T-trig N-proc R';
166
--source extra/rpl_tests/rpl_mixing_engines.inc
168
SET @commands= 'B T-func N R';
169
--source extra/rpl_tests/rpl_mixing_engines.inc
171
SET @commands= 'B T-func N-trig R';
172
--source extra/rpl_tests/rpl_mixing_engines.inc
174
SET @commands= 'B T-func N-func R';
175
--source extra/rpl_tests/rpl_mixing_engines.inc
177
SET @commands= 'B T-func N-proc R';
178
--source extra/rpl_tests/rpl_mixing_engines.inc
180
SET @commands= 'B T-proc N R';
181
--source extra/rpl_tests/rpl_mixing_engines.inc
183
SET @commands= 'B T-proc N-trig R';
184
--source extra/rpl_tests/rpl_mixing_engines.inc
186
SET @commands= 'B T-proc N-func R';
187
--source extra/rpl_tests/rpl_mixing_engines.inc
189
SET @commands= 'B T-proc N-proc R';
190
--source extra/rpl_tests/rpl_mixing_engines.inc
198
--echo #4.e) Generates in the binlog what follows if T* fails:
199
--echo # --> STMT "B N C" entry, format S.
200
--echo # Otherwise, what follows if N* fails and a N-Table is changed:
201
--echo # --> STMT "N" entries, format S.
203
SET @commands= 'B eT N R';
204
--source extra/rpl_tests/rpl_mixing_engines.inc
206
SET @commands= 'B Te N R';
207
--source extra/rpl_tests/rpl_mixing_engines.inc
209
SET @commands= 'B T eN R';
210
--source extra/rpl_tests/rpl_mixing_engines.inc
212
SET @commands= 'B T Ne R';
213
--source extra/rpl_tests/rpl_mixing_engines.inc
216
--echo ###################################################################################
217
--echo # CHECK CONSISTENCY
218
--echo ###################################################################################
220
sync_slave_with_master;
222
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql
223
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
224
--diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
226
--echo ###################################################################################
228
--echo ###################################################################################
229
SET @commands= 'clean';
230
--source extra/rpl_tests/rpl_mixing_engines.inc