4
# The test verifies correctness of DDL Query event parallelization
8
--source include/master-slave.inc
9
--source include/have_binlog_format_statement.inc
18
source include/stop_slave.inc;
19
set @save.slave_parallel_workers= @@global.slave_parallel_workers;
20
eval set @@global.slave_parallel_workers= $workers;
22
# Note, the number of db:s should be greater than MAX_DBS_IN_QUERY_MTS
23
# in order to satisfy to the over-max final test.
26
let $queries= `select $dbs*$tables * 8`;
29
# D1. CREATE/DROP database
32
# D2. CREATE/DROP/ALTER/RENAME table
41
eval create database d$n;
46
eval create table d$n.t$m (a int);
47
eval select round(rand()*$tables) into @var;
48
eval insert into d$n.t$m values (@var);
55
eval create database d$n;
60
eval create table d$n.t$m (a int);
61
eval select round(rand()*$tables) into @var;
62
eval insert into d$n.t$m values (@var);
74
let $n_1 = `select floor(rand()*$dbs) + 1`;
75
let $n_2 = `select floor(rand()*$dbs) + 1`;
76
let $n1_1= `select floor(rand()*$dbs) + 1`;
77
let $n1_2= `select floor(rand()*$dbs) + 1`;
78
let $m= `select floor(rand()*$tables) + 1`;
80
--error 0,ER_TABLE_EXISTS_ERROR
81
eval rename table d$n_1.t$m to d$n1_1.t$m, d$n_2.t$m to d$n1_2.t$m;
82
--error 0,ER_TABLE_EXISTS_ERROR
83
eval rename table d$n1_1.t$m to d$n_1.t$m, d$n1_2.t$m to d$n_2.t$m;
91
# D3. CREATE/DROP Stored Proc, Stored Func, Trigger, Func
96
# n'th db tables won't have any trigger to avoid circular dependency
108
eval create trigger `d$n1`.`trg_t$m` before insert on `d$n1`.`t$m` for each row insert into `d$n`.`t$m` values(1);
112
eval create function `d$n`.`func_$m` (a int) returns int
114
insert into `d$n`.`t$m` values(1);
118
eval create procedure `d$n`.`proc_$m`(a int)
120
insert into `d$n`.`t$m` values(1);
132
# D3. CREATE/ALTER/DROP event
135
CREATE EVENT d1.e_1 on schedule every '50:20:12:45' day_second do select 1;
136
ALTER EVENT d1.e_1 RENAME to d2.e_2;
140
# D4. CREATE/DROP view
143
CREATE VIEW d1.v_1 AS SELECT 1;
144
CREATE VIEW d2.v_2 AS SELECT 1;
145
DROP VIEW d1.v_1, d2.v_2;
155
source include/start_slave.inc;
158
sync_slave_with_master;
170
let $diff_tables=master:d$n.t$m, slave:d$n.t$m;
171
source include/diff_tables.inc;
178
# Finally, over-the-max-limit updated db:s
183
# Prepare the test with dropping the triggers
186
# n'th db tables won't have any trigger to avoid circular dependency
198
eval drop trigger `d$n1`.`trg_t$m`;
210
let $tables_2_rename= ;
211
#let $m= `select floor(rand()*$tables) + 1`;
212
let $m= `select floor($tables/2)`;
216
let $tables_2_rename= $tables_2_rename d$n1.t$m to d$n2.t$m ,;
217
eval drop table d$n2.t$m;
228
# The following query will leave so many warnings as many extra db pairs
229
eval rename table $tables_2_rename d$n.t$m to d$n1.t$m;
235
# DEBUG output (to remove)
236
# Hunting after bug#13033076.
237
# Let's see if rename leaves any garbage after its run
239
sync_slave_with_master;
240
let $MYSQLD_DATADIR= `SELECT @@datadir`;
243
echo "database d$n:";
244
--list_files $MYSQLD_DATADIR/d$n
258
# Hunting after bug#13033076: to drop db:s on master concurrently as
259
# well through 4 connections.
261
--connect(con1, localhost, root,,)
262
--connect(con2, localhost, root,,)
263
--connect(con3, localhost, root,,)
264
--connect(con4, localhost, root,,)
266
let $reap_not_done= 0;
275
--send_eval drop database d$n;
283
--send_eval drop database d$n;
291
--send_eval drop database d$n;
299
--send_eval drop database d$n;
301
let $reap_not_done= 1;
323
sync_slave_with_master;
325
set @@global.slave_parallel_workers= @save.slave_parallel_workers;
327
--source include/rpl_end.inc