2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
7
SET GLOBAL binlog_format = 'ROW';
8
SET SESSION binlog_format = 'ROW';
9
select @@global.binlog_format, @@session.binlog_format;
10
@@global.binlog_format ROW
11
@@session.binlog_format ROW
12
DROP TABLE IF EXISTS t1, t2, t3;
13
DROP PROCEDURE IF EXISTS p1;
14
DROP PROCEDURE IF EXISTS p2;
15
DROP PROCEDURE IF EXISTS p3;
16
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
17
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
18
fkid MEDIUMINT, filler VARCHAR(255),
19
PRIMARY KEY(id)) ENGINE='innodb';
20
CREATE TABLE t2(id MEDIUMINT NOT NULL AUTO_INCREMENT,
21
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
22
fkid MEDIUMINT, filler VARCHAR(255),
23
PRIMARY KEY(id)) ENGINE='innodb'
24
PARTITION BY KEY(id) partitions 5;
25
CREATE TABLE t3(id MEDIUMINT NOT NULL AUTO_INCREMENT,
26
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
27
fkid MEDIUMINT, filler VARCHAR(255),
28
PRIMARY KEY(id)) ENGINE='innodb'
29
PARTITION BY RANGE(id)
30
SUBPARTITION BY hash(id) subpartitions 2
31
(PARTITION pa1 values less than (10),
32
PARTITION pa2 values less than (20),
33
PARTITION pa3 values less than (30),
34
PARTITION pa4 values less than (40),
35
PARTITION pa5 values less than (50),
36
PARTITION pa6 values less than (60),
37
PARTITION pa7 values less than (70),
38
PARTITION pa8 values less than (80),
39
PARTITION pa9 values less than (90),
40
PARTITION pa10 values less than (100),
41
PARTITION pa11 values less than MAXVALUE);
44
DECLARE ins_count INT DEFAULT 1000;
45
DECLARE del_count INT;
46
DECLARE cur_user VARCHAR(255);
47
DECLARE local_uuid VARCHAR(255);
48
DECLARE local_time TIMESTAMP;
49
SET local_time= NOW();
50
SET cur_user= CURRENT_USER();
51
SET local_uuid= UUID();
52
WHILE ins_count > 0 DO
53
INSERT INTO t1 VALUES (NULL, NOW(), USER() , UUID(),
54
ins_count,'Going to test MBR for MySQL');
55
SET ins_count = ins_count - 1;
57
SELECT MAX(id) FROM t1 INTO del_count;
58
WHILE del_count > 0 DO
59
DELETE FROM t1 WHERE id = del_count;
60
SET del_count = del_count - 2;
65
DECLARE ins_count INT DEFAULT 1000;
66
DECLARE del_count INT;
67
DECLARE cur_user VARCHAR(255);
68
DECLARE local_uuid VARCHAR(255);
69
DECLARE local_time TIMESTAMP;
70
SET local_time= NOW();
71
SET cur_user= CURRENT_USER();
72
SET local_uuid= UUID();
73
WHILE ins_count > 0 DO
74
INSERT INTO t2 VALUES (NULL, NOW(), USER() , UUID(),
75
ins_count,'Going to test MBR for MySQL');
76
SET ins_count = ins_count - 1;
78
SELECT MAX(id) FROM t2 INTO del_count;
79
WHILE del_count > 0 DO
80
DELETE FROM t2 WHERE id = del_count;
81
SET del_count = del_count - 2;
86
DECLARE ins_count INT DEFAULT 1000;
87
DECLARE del_count INT;
88
DECLARE cur_user VARCHAR(255);
89
DECLARE local_uuid VARCHAR(255);
90
DECLARE local_time TIMESTAMP;
91
SET local_time= NOW();
92
SET cur_user = CURRENT_USER();
93
SET local_uuid=UUID();
94
WHILE ins_count > 0 DO
95
INSERT INTO t3 VALUES (NULL, NOW(), USER(), UUID(),
96
ins_count,'Going to test MBR for MySQL');
97
SET ins_count = ins_count - 1;
99
SELECT MAX(id) FROM t3 INTO del_count;
100
WHILE del_count > 0 DO
101
DELETE FROM t3 WHERE id = del_count;
102
SET del_count = del_count - 2;
106
SELECT count(*) as "Master regular" FROM t1;
109
SELECT count(*) as "Master bykey" FROM t2;
112
SELECT count(*) as "Master byrange" FROM t3;
114
show create table t3;
116
Create Table CREATE TABLE `t3` (
117
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
118
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
119
`user` char(255) DEFAULT NULL,
121
`fkid` mediumint(9) DEFAULT NULL,
122
`filler` varchar(255) DEFAULT NULL,
124
) ENGINE=MyISAM AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM, PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM, PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM, PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
127
Master_Host 127.0.0.1
129
Master_Port MASTER_MYPORT
131
Master_Log_File master-bin.000001
132
Read_Master_Log_Pos #
135
Relay_Master_Log_File master-bin.000001
137
Slave_SQL_Running Yes
141
Replicate_Ignore_Table
142
Replicate_Wild_Do_Table
143
Replicate_Wild_Ignore_Table
147
Exec_Master_Log_Pos #
152
Master_SSL_Allowed No
158
Seconds_Behind_Master #
159
Master_SSL_Verify_Server_Cert No
164
SELECT count(*) "Slave norm" FROM t1;
166
SELECT count(*) "Slave bykey" FROM t2;
168
SELECT count(*) "Slave byrange" FROM t3;
170
DROP TABLE t1, t2, t3;
171
DROP PROCEDURE IF EXISTS p1;
172
DROP PROCEDURE IF EXISTS p2;
173
DROP PROCEDURE IF EXISTS p3;