~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_stm_binlog_direct.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
5
#
 
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:
 
10
#
 
11
# - Define the scope of a transaction:
 
12
# B - Begin.
 
13
# C - Commit.
 
14
# R - Rollback.
 
15
#
 
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.
 
25
#
 
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
################################################################################
 
36
 
 
37
--source include/have_binlog_format_statement.inc
 
38
--source include/master-slave.inc
 
39
--source include/have_innodb.inc
 
40
 
 
41
set @@session.binlog_direct_non_transactional_updates= TRUE;
 
42
 
 
43
--echo #########################################################################
 
44
--echo #                            CONFIGURATION
 
45
--echo #########################################################################
 
46
 
 
47
--let $engine_type= Innodb
 
48
SET @commands= 'configure';
 
49
--source extra/rpl_tests/rpl_mixing_engines.inc
 
50
 
 
51
--echo #########################################################################
 
52
--echo #                          1 - BINLOG ORDER
 
53
--echo #########################################################################
 
54
connection master;
 
55
 
 
56
--echo
 
57
--echo
 
58
--echo
 
59
--echo
 
60
--echo #
 
61
--echo #3) Generates in the binlog what follows:
 
62
--echo #       --> STMT  "N B T C" entries, format S.
 
63
--echo #
 
64
SET @commands= 'B T N C';
 
65
--source extra/rpl_tests/rpl_mixing_engines.inc
 
66
 
 
67
SET @commands= 'B T N-trig C';
 
68
--source extra/rpl_tests/rpl_mixing_engines.inc
 
69
 
 
70
SET @commands= 'B T N-func C';
 
71
--source extra/rpl_tests/rpl_mixing_engines.inc
 
72
 
 
73
SET @commands= 'B T N-proc C';
 
74
--source extra/rpl_tests/rpl_mixing_engines.inc
 
75
 
 
76
SET @commands= 'B T-trig N C';
 
77
--source extra/rpl_tests/rpl_mixing_engines.inc
 
78
 
 
79
SET @commands= 'B T-trig N-trig C';
 
80
--source extra/rpl_tests/rpl_mixing_engines.inc
 
81
 
 
82
SET @commands= 'B T-trig N-func C';
 
83
--source extra/rpl_tests/rpl_mixing_engines.inc
 
84
 
 
85
SET @commands= 'B T-trig N-proc C';
 
86
--source extra/rpl_tests/rpl_mixing_engines.inc
 
87
 
 
88
SET @commands= 'B T-func N C';
 
89
--source extra/rpl_tests/rpl_mixing_engines.inc
 
90
 
 
91
SET @commands= 'B T-func N-trig C';
 
92
--source extra/rpl_tests/rpl_mixing_engines.inc
 
93
 
 
94
SET @commands= 'B T-func N-func C';
 
95
--source extra/rpl_tests/rpl_mixing_engines.inc
 
96
 
 
97
SET @commands= 'B T-func N-proc C';
 
98
--source extra/rpl_tests/rpl_mixing_engines.inc
 
99
 
 
100
SET @commands= 'B T-proc N C';
 
101
--source extra/rpl_tests/rpl_mixing_engines.inc
 
102
 
 
103
SET @commands= 'B T-proc N-trig C';
 
104
--source extra/rpl_tests/rpl_mixing_engines.inc
 
105
 
 
106
SET @commands= 'B T-proc N-func C';
 
107
--source extra/rpl_tests/rpl_mixing_engines.inc
 
108
 
 
109
SET @commands= 'B T-proc N-proc C';
 
110
--source extra/rpl_tests/rpl_mixing_engines.inc
 
111
 
 
112
 
 
113
--echo
 
114
--echo
 
115
--echo
 
116
--echo
 
117
--echo #
 
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.
 
122
--echo #
 
123
SET @commands= 'B eT N C';
 
124
--source extra/rpl_tests/rpl_mixing_engines.inc
 
125
 
 
126
SET @commands= 'B Te N C';
 
127
--source extra/rpl_tests/rpl_mixing_engines.inc
 
128
 
 
129
SET @commands= 'B T eN C';
 
130
--source extra/rpl_tests/rpl_mixing_engines.inc
 
131
 
 
132
SET @commands= 'B T Ne C';
 
133
--source extra/rpl_tests/rpl_mixing_engines.inc
 
134
 
 
135
 
 
136
--echo
 
137
--echo
 
138
--echo
 
139
--echo
 
140
--echo #
 
141
--echo #4) Generates in the binlog what follows:
 
142
--echo #     --> STMT  "N B T R" entries, format S.
 
143
--echo #
 
144
SET @commands= 'B T N R';
 
145
--source extra/rpl_tests/rpl_mixing_engines.inc
 
146
 
 
147
SET @commands= 'B T N-trig R';
 
148
--source extra/rpl_tests/rpl_mixing_engines.inc
 
149
 
 
150
SET @commands= 'B T N-func R';
 
151
--source extra/rpl_tests/rpl_mixing_engines.inc
 
152
 
 
153
SET @commands= 'B T N-proc R';
 
154
--source extra/rpl_tests/rpl_mixing_engines.inc
 
155
 
 
156
SET @commands= 'B T-trig N R';
 
157
--source extra/rpl_tests/rpl_mixing_engines.inc
 
158
 
 
159
SET @commands= 'B T-trig N-trig R';
 
160
--source extra/rpl_tests/rpl_mixing_engines.inc
 
161
 
 
162
SET @commands= 'B T-trig N-func R';
 
163
--source extra/rpl_tests/rpl_mixing_engines.inc
 
164
 
 
165
SET @commands= 'B T-trig N-proc R';
 
166
--source extra/rpl_tests/rpl_mixing_engines.inc
 
167
 
 
168
SET @commands= 'B T-func N R';
 
169
--source extra/rpl_tests/rpl_mixing_engines.inc
 
170
 
 
171
SET @commands= 'B T-func N-trig R';
 
172
--source extra/rpl_tests/rpl_mixing_engines.inc
 
173
 
 
174
SET @commands= 'B T-func N-func R';
 
175
--source extra/rpl_tests/rpl_mixing_engines.inc
 
176
 
 
177
SET @commands= 'B T-func N-proc R';
 
178
--source extra/rpl_tests/rpl_mixing_engines.inc
 
179
 
 
180
SET @commands= 'B T-proc N R';
 
181
--source extra/rpl_tests/rpl_mixing_engines.inc
 
182
 
 
183
SET @commands= 'B T-proc N-trig R';
 
184
--source extra/rpl_tests/rpl_mixing_engines.inc
 
185
 
 
186
SET @commands= 'B T-proc N-func R';
 
187
--source extra/rpl_tests/rpl_mixing_engines.inc
 
188
 
 
189
SET @commands= 'B T-proc N-proc R';
 
190
--source extra/rpl_tests/rpl_mixing_engines.inc
 
191
 
 
192
 
 
193
--echo
 
194
--echo
 
195
--echo
 
196
--echo
 
197
--echo #
 
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.
 
202
--echo #
 
203
SET @commands= 'B eT N R';
 
204
--source extra/rpl_tests/rpl_mixing_engines.inc
 
205
 
 
206
SET @commands= 'B Te N R';
 
207
--source extra/rpl_tests/rpl_mixing_engines.inc
 
208
 
 
209
SET @commands= 'B T eN R';
 
210
--source extra/rpl_tests/rpl_mixing_engines.inc
 
211
 
 
212
SET @commands= 'B T Ne R';
 
213
--source extra/rpl_tests/rpl_mixing_engines.inc
 
214
 
 
215
 
 
216
--echo ###################################################################################
 
217
--echo #                               CHECK CONSISTENCY 
 
218
--echo ###################################################################################
 
219
connection master;
 
220
sync_slave_with_master;
 
221
  
 
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
 
225
  
 
226
--echo ###################################################################################
 
227
--echo #                                        CLEAN
 
228
--echo ###################################################################################
 
229
SET @commands= 'clean';
 
230
--source extra/rpl_tests/rpl_mixing_engines.inc