~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_ddl.test

  • Committer: msvensson at pilot
  • Date: 2007-04-24 09:11:45 UTC
  • mfrom: (2469.1.106)
  • Revision ID: sp1r-msvensson@pilot.blaudden-20070424091145-10463
Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
######################## rpl_ddl.test ########################
2
 
#                                                            #
3
 
# DDL statements (sometimes with implicit COMMIT) executed   #
4
 
# by the master and it's propagation into the slave          #
5
 
#                                                            #
6
 
##############################################################
 
1
################# extra/rpl_tests/rpl_ddl.test ########################
 
2
#                                                                     #
 
3
# DDL statements (sometimes with implicit COMMIT) and other stuff     #
 
4
# executed on the master and it's propagation into the slave.         #
 
5
#                                                                     #
 
6
# The variables                                                       #
 
7
#    $engine_type       -- storage engine to be tested/used for the   #
 
8
#                          permanent tables within the master         #
 
9
#    $temp_engine_type  -- storage engine which supports TEMPORARY    #
 
10
#                          tables <> $engine_type                     #
 
11
#                          $temp_engine_type must point to an all     #
 
12
#                          time available storage engine              #
 
13
#                          2007-02 MySQL 5.1 MyISAM and MEMORY only   #
 
14
#    $show_binlog       -- print binlog entries                       #
 
15
#                          0 - no (default) + fits to the file with   #
 
16
#                              results                                #
 
17
#                          1 - yes (important for debugging)          #
 
18
#                          This variable is used within               #
 
19
#                          include/rpl_stmt_seq.inc.                  #
 
20
#    $manipulate        -- Manipulation of the binary logs            #
 
21
#                          0 - do nothing                             #
 
22
#                          1 - so that the output of SHOW BINLOG      #
 
23
#                              EVENTS IN <current log> contains only  #
 
24
#                              commands of the current test sequence  #
 
25
#                              This is especially useful, if the      #
 
26
#                              $show_binlog is set to 1 and many      #
 
27
#                              subtest are executed.                  #
 
28
#                          This variable is used within               #
 
29
#                          include/rpl_stmt_seq.inc.                  #
 
30
# have to be set before sourcing this script.                         #
 
31
#                                                                     #
 
32
# General assumption about the ideal replication behaviour:           #
 
33
#    Whatever on the master is executed the content of the slave must #
 
34
#    be in sync with it.                                              #
 
35
#                                                                     #
 
36
#    Tests of special interest:                                       #
 
37
#    a) Which DDL commands cause an implicit COMMIT ?                 #
 
38
#       This is also of interest outside of replication.              #
 
39
#    b) Transactions modifying table content ending with              #
 
40
#       - explicit COMMIT or ROLLBACK                                 #
 
41
#       - implicit COMMIT because the connection to the master        #
 
42
#         executed a corresponding DDL statement or runs in           #
 
43
#         AUTOCOMMIT mode                                             #
 
44
#       - something similar to "implicit COMMIT" if the storage       #
 
45
#         engine (master) is not transactional                        #
 
46
#    c) Command which change no data like SELECT or SHOW              #
 
47
#       They do not change anything within the master but             #
 
48
#       this must be also valid for the slave.                        #
 
49
#                                                                     #
 
50
#######################################################################
7
51
 
8
 
#
9
 
# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
10
 
#
11
 
#      1. !All! objects to be dropped, renamed, altered ... must be created
12
 
#         in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
13
 
#         sequences start.
14
 
#
15
 
#      2. Never use a test object, which was direct or indirect affected by a
16
 
#         preceeding test sequence again.
17
 
#         Except table d1.t1 where ONLY DML is allowed.
18
 
#
19
 
#         If one preceeding test sequence hits a (sometimes not good visible,
20
 
#         because the sql error code of the statement might be 0) bug
21
 
#         and these rules are ignored, a following test sequence might earn ugly
22
 
#         effects like failing 'sync_slave_with_master', crashes of the slave or
23
 
#         abort of the test case etc..
24
 
#
25
 
#      3. The assignment of the DDL command to be tested to $my_stmt can
26
 
#         be a bit difficult. "'" must be avoided, because the test
27
 
#         routine "include/rpl_stmt_seq.inc" performs a
28
 
#         eval SELECT CONCAT('######## ','$my_stmt','  ########') as "";
 
52
# Last update:
 
53
# 2007-02-12 ML: - slave needs AUTOCOMMIT = 1, because we want to check only
 
54
#                  the propagation of actions of the master connection.
 
55
#                - replace comments via SQL by "--echo ..."
 
56
#                - remove some bugs within the testscripts
 
57
#                - remove the use of include/rpl_stmt_seq2.inc
 
58
#              
 
59
#
 
60
# NOTES:
 
61
# 2006-11-15 Lars: Matthias (ML) is the "owner" of this test case.
 
62
#                  So, please get him to review it whenever you want to
 
63
#                  do changes to it.
 
64
#
 
65
# PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
 
66
#
 
67
#    Typical test architecture (--> include/rpl_stmt_seq.inc)
 
68
#    --------------------------------------------------------
 
69
#    1. Master (no AUTOCOMMIT!): INSERT INTO mysqltest1.t1 without commit
 
70
#    2. Master and slave: Check the content of mysqltest1.t1
 
71
#    3. Master (no AUTOCOMMIT!): EXECUTE the statement to be tested
 
72
#    4. Master and slave: Check the content of mysqltest1.t1
 
73
#    5. Master (no AUTOCOMMIT!): ROLLBACK
 
74
#    6. Master and slave: Check the content of mysqltest1.t1
 
75
#       If the previous into mysqltest1.t1 inserted row is visible,
 
76
#       than the statement to be tested caused an explicit COMMIT
 
77
#       (statement = COMMIT) or an implicit COMMIT (example CREATE TABLE).
 
78
#       If the previous into mysqltest1.t1 inserted row is not visible,
 
79
#       than the statement to be tested caused either an explicit ROLLBACK
 
80
#       (statement = ROLLBACK), an implicit ROLLBACK (deadlock etc. but
 
81
#       not tested here) or it does not cause any transaction end. 
 
82
#    7. Flush the logs
 
83
#            
 
84
#    Some rules:
 
85
#    -----------
 
86
#    1. Any use of mysqltest1.t1 within the statement to be tested must be
 
87
#       avoided if possible. The only known exception is around LOCK TABLE.
 
88
#               
 
89
#    2. The test logics needs for
 
90
#           master connection: AUTOCOMMIT = 0
 
91
#           slave  connection: AUTOCOMMIT = 1
 
92
#       The master connection  is the actor and the slave connection is 
 
93
#       only an observer. I.e. the slave connection must not influence
 
94
#       the activities of master connection.
 
95
#
 
96
#    3. !All! objects to be dropped, renamed, altered ... must be created
 
97
#       before the tests start.
 
98
#       --> less switching of AUTOCOMMIT mode on master side.
 
99
#
 
100
#    4. Never use a test object, which was direct or indirect affected by a
 
101
#       preceeding test sequence again.
 
102
#       If one preceeding test sequence hits a (sometimes not visible,
 
103
#       because the sql error code of the statement might be 0) bug
 
104
#       and these rules are ignored, a following test sequence might earn ugly
 
105
#       effects like failing 'sync_slave_with_master', crashes of the slave or
 
106
#       abort of the test case etc.. This means during analysis the first look
 
107
#       points into a totally wrong area.
 
108
#       Except table mysqltest1.t1 where ONLY DML is allowed.
 
109
#
 
110
#    5. This file is used in several tests (t/rpl_ddl_<whatever>.test).
 
111
#         Please be aware that every change of the current file affects
 
112
#         the results of these tests.
 
113
#
 
114
# ML: Some maybe banal hints:
 
115
#     1. The fact that we have here a master - slave replication does
 
116
#        not cause that many general MySQL properties do not apply.
 
117
#        Example:
 
118
#        The connection to the slave is just a simple session and not a however
 
119
#        magic working "copy" of the master session or something similar.
 
120
#        - TEMPORARY TABLES and @variables are session specific
 
121
#        - the slave session cannot see these things of the master.
 
122
#     2. The slave connection must not call sync_slave_with_master.
 
123
#     3. SHOW STATUS SLAVE must be run within the slave connection.
 
124
#     4. Testcase analysis becomes much more comfortable if 
 
125
#        $show_binlog within include/rpl_stmt_seq.inc is set to 1.
29
126
#
30
127
 
31
128
###############################################################
33
130
###############################################################
34
131
# The sync_slave_with_master is needed to make the xids deterministic.
35
132
sync_slave_with_master;
 
133
 
 
134
--echo
 
135
--echo -------- switch to master -------
36
136
connection master;
37
 
 
38
137
SET AUTOCOMMIT = 1;
39
138
#
40
139
# 1. DROP all objects, which probably already exist, but must be created here
47
146
#
48
147
# 2. CREATE all objects needed
49
148
#    working database is mysqltest1
50
 
#    working (transactional!) is mysqltest1.t1 
 
149
#    working table (transactional!) is mysqltest1.t1 
51
150
#
52
151
CREATE DATABASE mysqltest1;
53
152
CREATE DATABASE mysqltest2;
73
172
eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type;
74
173
eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type;
75
174
eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type;
76
 
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
 
175
eval CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=$temp_engine_type;
77
176
 
78
177
#
79
178
# 3. master sessions: never do AUTOCOMMIT
80
 
#    slave  sessions: never do AUTOCOMMIT
 
179
#    slave  sessions: do AUTOCOMMIT
81
180
#
82
181
SET AUTOCOMMIT = 0;
83
182
use mysqltest1;
84
183
sync_slave_with_master;
 
184
--echo
 
185
--echo -------- switch to slave --------
85
186
connection slave;
86
 
--disable_query_log
87
 
SELECT '-------- switch to slave --------' as "";
88
 
--enable_query_log
89
 
SET AUTOCOMMIT = 0;
 
187
SET AUTOCOMMIT = 1;
90
188
use mysqltest1;
 
189
--echo
 
190
--echo -------- switch to master -------
91
191
connection master;
92
 
--disable_query_log
93
 
SELECT '-------- switch to master -------' as "";
94
 
--enable_query_log
95
192
 
96
193
 
97
194
# We don't want to abort the whole test if one statement sent
100
197
--disable_abort_on_error
101
198
 
102
199
###############################################################
 
200
# Banal case: commands which should never commit
 
201
# Just for checking if the test sequence is usable
 
202
###############################################################
 
203
 
 
204
let $my_stmt= SELECT 1;
 
205
let $my_master_commit= false;
 
206
let $my_slave_commit= false;
 
207
--source include/rpl_stmt_seq.inc
 
208
 
 
209
let $my_stmt= SELECT COUNT(*) FROM t1;
 
210
let $my_master_commit= false;
 
211
let $my_slave_commit= false;
 
212
--source include/rpl_stmt_seq.inc
 
213
 
 
214
###############################################################
103
215
# Banal case: (explicit) COMMIT and ROLLBACK
104
216
# Just for checking if the test sequence is usable
105
217
###############################################################
143
255
let $my_slave_commit= true;
144
256
--source include/rpl_stmt_seq.inc
145
257
SHOW TABLES LIKE 't2';
 
258
--echo
 
259
--echo -------- switch to slave --------
146
260
connection slave;
147
 
--disable_query_log
148
 
SELECT '-------- switch to slave --------' as "";
149
 
--enable_query_log
150
261
SHOW TABLES LIKE 't2';
 
262
--echo
 
263
--echo -------- switch to master -------
151
264
connection master;
152
 
--disable_query_log
153
 
SELECT '-------- switch to master -------' as "";
154
 
--enable_query_log
155
265
 
156
 
# Note: Since this test is executed with a skip-innodb slave, the
157
 
# slave incorrectly commits the insert.  One can *not* have InnoDB on
158
 
# master and MyISAM on slave and expect that a transactional rollback
159
 
# after a CREATE TEMPORARY TABLE should work correctly on the slave.
160
 
# For this to work properly the handler on the slave must be able to 
161
 
# handle transactions (e.g. InnoDB or NDB).
162
266
let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
163
267
let $my_master_commit= false;
164
 
let $my_slave_commit= true;
 
268
let $my_slave_commit= false;
165
269
--source include/rpl_stmt_seq.inc
166
270
SHOW TABLES LIKE 't23';
 
271
--echo
 
272
--echo -------- switch to slave --------
167
273
connection slave;
168
 
--disable_query_log
169
 
SELECT '-------- switch to slave --------' as "";
170
 
--enable_query_log
171
274
SHOW TABLES LIKE 't23';
 
275
--echo
 
276
--echo -------- switch to master -------
172
277
connection master;
173
 
--disable_query_log
174
 
SELECT '-------- switch to master -------' as "";
175
 
--enable_query_log
176
278
 
177
279
let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
178
280
let $my_master_commit= true;
179
281
let $my_slave_commit= true;
180
282
--source include/rpl_stmt_seq.inc
181
283
SHOW TABLES LIKE 't20';
 
284
--echo
 
285
--echo -------- switch to slave --------
182
286
connection slave;
183
 
--disable_query_log
184
 
SELECT '-------- switch to slave --------' as "";
185
 
--enable_query_log
186
287
SHOW TABLES LIKE 't20';
 
288
--echo
 
289
--echo -------- switch to master -------
187
290
connection master;
188
 
--disable_query_log
189
 
SELECT '-------- switch to master -------' as "";
190
 
--enable_query_log
191
291
 
192
292
let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
193
293
let $my_master_commit= true;
194
294
let $my_slave_commit= true;
195
295
--source include/rpl_stmt_seq.inc
196
296
describe mysqltest1.t4;
 
297
--echo
 
298
--echo -------- switch to slave --------
197
299
connection slave;
198
 
--disable_query_log
199
 
SELECT '-------- switch to slave --------' as "";
200
 
--enable_query_log
201
300
describe mysqltest1.t4;
 
301
--echo
 
302
--echo -------- switch to master -------
202
303
connection master;
203
 
--disable_query_log
204
 
SELECT '-------- switch to master -------' as "";
205
 
--enable_query_log
206
304
 
207
 
let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE=;
 
305
let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= $engine_type;
208
306
let $my_master_commit= true;
209
307
let $my_slave_commit= true;
210
 
--source include/rpl_stmt_seq2.inc
 
308
--source include/rpl_stmt_seq.inc
211
309
 
212
 
# Note: Since this test is executed with a skip-innodb slave, the
213
 
# slave incorrectly commits the insert.  One can *not* have InnoDB on
214
 
# master and MyISAM on slave and expect that a transactional rollback
215
 
# after a CREATE TEMPORARY TABLE should work correctly on the slave.
216
 
# For this to work properly the handler on the slave must be able to 
217
 
# handle transactions (e.g. InnoDB or NDB).
218
310
let $engine='';
219
311
let $eng_type='';
220
312
 
221
 
let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
 
313
let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=$temp_engine_type;
222
314
let $my_master_commit= false;
223
 
let $my_slave_commit= true;
 
315
let $my_slave_commit= false;
224
316
--source include/rpl_stmt_seq.inc
225
317
 
226
318
let $my_stmt= TRUNCATE TABLE mysqltest1.t7;
228
320
let $my_slave_commit= true;
229
321
--source include/rpl_stmt_seq.inc
230
322
SELECT * FROM mysqltest1.t7;
 
323
sync_slave_with_master;
 
324
--echo
231
325
--echo -------- switch to slave --------
232
 
sync_slave_with_master;
 
326
connection slave;
233
327
SELECT * FROM mysqltest1.t7;
 
328
--echo
234
329
--echo -------- switch to master -------
235
330
connection master;
236
331
 
238
333
# Cases with LOCK/UNLOCK
239
334
###############################################################
240
335
 
241
 
# MySQL insists in locking mysqltest1.t1, because rpl_stmt_seq performs an
242
 
# INSERT into this table.
 
336
# Attention:
 
337
#    We have to LOCK mysqltest1.t1 here, though it violates the testing
 
338
#    philosophy. 
 
339
#    Mysql response in case without previous LOCK TABLES mysqltest1.t1
 
340
#    is:
 
341
#        SELECT MAX(...) FROM mysqltest1.t1 is
 
342
#          ERROR HY000: Table 't1' was not locked with LOCK TABLES
243
343
let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
244
344
let $my_master_commit= true;
245
345
let $my_slave_commit= true;
253
353
--source include/rpl_stmt_seq.inc
254
354
 
255
355
# With prior read locking
256
 
# Note that this test generate an error since the rpl_stmt_seq.inc
257
 
# tries to insert into t1.
 
356
# Attention:
 
357
#    This subtest generates an error since the rpl_stmt_seq.inc
 
358
#    tries to insert into t1.
258
359
LOCK TABLES mysqltest1.t1 READ;
259
360
let $my_stmt= UNLOCK TABLES;
260
361
let $my_master_commit= false;
277
378
let $my_slave_commit= true;
278
379
--source include/rpl_stmt_seq.inc
279
380
SHOW INDEX FROM mysqltest1.t6;
 
381
--echo
 
382
--echo -------- switch to slave --------
280
383
connection slave;
281
 
--disable_query_log
282
 
SELECT '-------- switch to slave --------' as "";
283
 
--enable_query_log
284
384
SHOW INDEX FROM mysqltest1.t6;
 
385
--echo
 
386
--echo -------- switch to master -------
285
387
connection master;
286
 
--disable_query_log
287
 
SELECT '-------- switch to master -------' as "";
288
 
--enable_query_log
289
388
 
290
389
let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
291
390
let $my_master_commit= true;
292
391
let $my_slave_commit= true;
293
392
--source include/rpl_stmt_seq.inc
294
393
SHOW INDEX FROM mysqltest1.t5;
 
394
--echo
 
395
--echo -------- switch to slave --------
295
396
connection slave;
296
 
--disable_query_log
297
 
SELECT '-------- switch to slave --------' as "";
298
 
--enable_query_log
299
397
SHOW INDEX FROM mysqltest1.t5;
 
398
--echo
 
399
--echo -------- switch to master -------
300
400
connection master;
301
 
--disable_query_log
302
 
SELECT '-------- switch to master -------' as "";
303
 
--enable_query_log
304
401
 
305
402
###############################################################
306
403
# Cases with DATABASE
311
408
let $my_slave_commit= true;
312
409
--source include/rpl_stmt_seq.inc
313
410
SHOW DATABASES LIKE "mysqltest2";
 
411
--echo
 
412
--echo -------- switch to slave --------
314
413
connection slave;
315
 
--disable_query_log
316
 
SELECT '-------- switch to slave --------' as "";
317
 
--enable_query_log
318
414
SHOW DATABASES LIKE "mysqltest2";
 
415
--echo
 
416
--echo -------- switch to master -------
319
417
connection master;
320
 
--disable_query_log
321
 
SELECT '-------- switch to master -------' as "";
322
 
--enable_query_log
323
418
 
324
419
let $my_stmt= CREATE DATABASE mysqltest3;
325
420
let $my_master_commit= true;
326
421
let $my_slave_commit= true;
327
422
--source include/rpl_stmt_seq.inc
328
423
SHOW DATABASES LIKE "mysqltest3";
 
424
--echo
 
425
--echo -------- switch to slave --------
329
426
connection slave;
330
 
--disable_query_log
331
 
SELECT '-------- switch to slave --------' as "";
332
 
--enable_query_log
333
427
SHOW DATABASES LIKE "mysqltest3";
 
428
--echo
 
429
--echo -------- switch to master -------
334
430
connection master;
335
 
--disable_query_log
336
 
SELECT '-------- switch to master -------' as "";
337
 
--enable_query_log
338
431
 
339
432
# End of 4.1 tests
340
433
 
341
434
###############################################################
342
 
# Cases with stored procedures
 
435
# Cases with STORED PROCEDUREs
343
436
###############################################################
344
437
let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
345
438
let $my_master_commit= true;
348
441
--vertical_results
349
442
--replace_column 5 # 6 #
350
443
SHOW PROCEDURE STATUS LIKE 'p1';
351
 
--disable_query_log
352
 
SELECT '-------- switch to slave -------' as "";
353
 
--enable_query_log
 
444
--echo
 
445
--echo -------- switch to slave --------
354
446
connection slave;
355
447
--replace_column 5 # 6 #
356
448
SHOW PROCEDURE STATUS LIKE 'p1';
 
449
--echo
 
450
--echo -------- switch to master -------
357
451
connection master;
358
452
--horizontal_results
359
453
 
364
458
--vertical_results
365
459
--replace_column 5 # 6 #
366
460
SHOW PROCEDURE STATUS LIKE 'p1';
367
 
--disable_query_log
368
 
SELECT '-------- switch to slave -------' as "";
369
 
--enable_query_log
 
461
--echo
 
462
--echo -------- switch to slave --------
370
463
connection slave;
371
464
--replace_column 5 # 6 #
372
465
SHOW PROCEDURE STATUS LIKE 'p1';
 
466
--echo
 
467
--echo -------- switch to master -------
373
468
connection master;
374
469
--horizontal_results
375
470
 
379
474
--source include/rpl_stmt_seq.inc
380
475
--vertical_results
381
476
SHOW PROCEDURE STATUS LIKE 'p1';
382
 
--disable_query_log
383
 
SELECT '-------- switch to slave -------' as "";
384
 
--enable_query_log
 
477
--echo
 
478
--echo -------- switch to slave --------
385
479
connection slave;
386
480
SHOW PROCEDURE STATUS LIKE 'p1';
 
481
--echo
 
482
--echo -------- switch to master -------
387
483
connection master;
388
484
--horizontal_results
389
485
 
395
491
let $my_slave_commit= true;
396
492
--source include/rpl_stmt_seq.inc
397
493
SHOW CREATE VIEW v1;
398
 
--disable_query_log
399
 
SELECT '-------- switch to slave -------' as "";
400
 
--enable_query_log
 
494
--echo
 
495
--echo -------- switch to slave --------
401
496
connection slave;
402
497
SHOW CREATE VIEW v1;
 
498
--echo
 
499
--echo -------- switch to master -------
403
500
connection master;
404
501
 
405
502
let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
407
504
let $my_slave_commit= true;
408
505
--source include/rpl_stmt_seq.inc
409
506
SHOW CREATE VIEW v1;
410
 
--disable_query_log
411
 
SELECT '-------- switch to slave -------' as "";
412
 
--enable_query_log
 
507
--echo
 
508
--echo -------- switch to slave --------
413
509
connection slave;
414
510
SHOW CREATE VIEW v1;
 
511
--echo
 
512
--echo -------- switch to master -------
415
513
connection master;
416
514
 
417
515
let $my_stmt= DROP VIEW IF EXISTS v1;
420
518
--source include/rpl_stmt_seq.inc
421
519
--error 1146
422
520
SHOW CREATE VIEW v1;
423
 
--disable_query_log
424
 
SELECT '-------- switch to slave -------' as "";
425
 
--enable_query_log
 
521
--echo
 
522
--echo -------- switch to slave --------
426
523
connection slave;
427
524
--error 1146
428
525
SHOW CREATE VIEW v1;
 
526
--echo
 
527
--echo -------- switch to master -------
429
528
connection master;
430
529
 
431
530
###############################################################
436
535
let $my_slave_commit= true;
437
536
--source include/rpl_stmt_seq.inc
438
537
SHOW TRIGGERS;
439
 
--disable_query_log
440
 
SELECT '-------- switch to slave -------' as "";
441
 
--enable_query_log
 
538
--echo
 
539
--echo -------- switch to slave --------
442
540
connection slave;
443
541
SHOW TRIGGERS;
 
542
--echo
 
543
--echo -------- switch to master -------
444
544
connection master;
445
545
 
446
546
let $my_stmt= DROP TRIGGER trg1;
448
548
let $my_slave_commit= true;
449
549
--source include/rpl_stmt_seq.inc
450
550
SHOW TRIGGERS;
451
 
--disable_query_log
452
 
SELECT '-------- switch to slave -------' as "";
453
 
--enable_query_log
 
551
--echo
 
552
--echo -------- switch to slave --------
454
553
connection slave;
455
554
SHOW TRIGGERS;
 
555
--echo
 
556
--echo -------- switch to master -------
456
557
connection master;
457
558
 
458
559
###############################################################
463
564
let $my_slave_commit= true;
464
565
--source include/rpl_stmt_seq.inc
465
566
SELECT user FROM mysql.user WHERE user = 'user1';
466
 
--disable_query_log
467
 
SELECT '-------- switch to slave -------' as "";
468
 
--enable_query_log
 
567
--echo
 
568
--echo -------- switch to slave --------
469
569
connection slave;
470
570
SELECT user FROM mysql.user WHERE user = 'user1';
 
571
--echo
 
572
--echo -------- switch to master -------
471
573
connection master;
472
574
 
473
575
let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
475
577
let $my_slave_commit= true;
476
578
--source include/rpl_stmt_seq.inc
477
579
SELECT user FROM mysql.user WHERE user = 'rename1';
478
 
--disable_query_log
479
 
SELECT '-------- switch to slave -------' as "";
480
 
--enable_query_log
 
580
--echo
 
581
--echo -------- switch to slave --------
481
582
connection slave;
482
583
SELECT user FROM mysql.user WHERE user = 'rename1';
 
584
--echo
 
585
--echo -------- switch to master -------
483
586
connection master;
484
587
 
485
588
let $my_stmt= DROP USER rename1@localhost;
487
590
let $my_slave_commit= true;
488
591
--source include/rpl_stmt_seq.inc
489
592
SELECT user FROM mysql.user WHERE user = 'rename1';
490
 
--disable_query_log
491
 
SELECT '-------- switch to slave -------' as "";
492
 
--enable_query_log
 
593
--echo
 
594
--echo -------- switch to slave --------
493
595
connection slave;
494
596
SELECT user FROM mysql.user WHERE user = 'rename1';
495
 
connection master;
496
597
 
497
598
###############################################################
498
599
# Cleanup
499
600
###############################################################
500
 
--disable_warnings
501
 
DROP DATABASE IF EXISTS mysqltest1;
502
 
DROP DATABASE IF EXISTS mysqltest2;
503
 
DROP DATABASE IF EXISTS mysqltest3;
 
601
use test;
 
602
--echo
 
603
--echo -------- switch to master -------
 
604
connection master;
 
605
DROP DATABASE mysqltest1;
 
606
# mysqltest2 was alreday DROPPED some tests before.
 
607
DROP DATABASE mysqltest3;
504
608
--enable_warnings
505
609
 
506
610
-- source include/master-slave-end.inc
507