1
by brian
clean slate |
1 |
stop slave;
|
2 |
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
3 |
reset master;
|
|
4 |
reset slave;
|
|
5 |
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
6 |
start slave;
|
|
7 |
use test;
|
|
8 |
CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
9 |
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
|
|
10 |
fkid MEDIUMINT, filler VARCHAR(255),
|
|
11 |
PRIMARY KEY(id)) ENGINE='innodb';
|
|
12 |
CREATE PROCEDURE test.proc_norm()
|
|
13 |
BEGIN
|
|
14 |
DECLARE ins_count INT DEFAULT 1000;
|
|
15 |
DECLARE del_count INT;
|
|
16 |
DECLARE cur_user VARCHAR(255);
|
|
17 |
DECLARE local_uuid VARCHAR(255);
|
|
18 |
DECLARE local_time TIMESTAMP;
|
|
19 |
SET local_time= NOW();
|
|
20 |
SET cur_user= CURRENT_USER();
|
|
21 |
SET local_uuid= UUID();
|
|
22 |
WHILE ins_count > 0 DO
|
|
23 |
INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
|
|
24 |
ins_count,'Going to test MBR for MySQL');
|
|
25 |
SET ins_count = ins_count - 1;
|
|
26 |
END WHILE;
|
|
27 |
SELECT MAX(id) FROM test.regular_tbl INTO del_count;
|
|
28 |
WHILE del_count > 0 DO
|
|
29 |
DELETE FROM test.regular_tbl WHERE id = del_count;
|
|
30 |
SET del_count = del_count - 2;
|
|
31 |
END WHILE;
|
|
32 |
END|
|
|
33 |
CALL test.proc_norm();
|
|
34 |
DROP PROCEDURE test.proc_norm;
|
|
35 |
DROP TABLE test.regular_tbl;
|