1 --source include/have_innodb.inc
2 --source include/have_partition.inc
4 let $engine_type= 'innodb';
6 ######## Creat Table Section #########
9 eval CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
10 dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
11 fkid MEDIUMINT, filler VARCHAR(255),
12 PRIMARY KEY(id)) ENGINE=$engine_type
13 PARTITION BY RANGE(id)
14 SUBPARTITION BY hash(id) subpartitions 2
15 (PARTITION pa3 values less than (42),
16 PARTITION pa6 values less than (60),
17 PARTITION pa7 values less than (70),
18 PARTITION pa8 values less than (80),
19 PARTITION pa9 values less than (90),
20 PARTITION pa10 values less than (100),
21 PARTITION pa11 values less than MAXVALUE);
23 ######## Create SPs, Functions, Views and Triggers Section ##############
27 CREATE PROCEDURE test.proc_part()
29 DECLARE ins_count INT DEFAULT 1000;
30 DECLARE del_count INT;
31 DECLARE cur_user VARCHAR(255);
32 DECLARE local_uuid VARCHAR(255);
33 DECLARE local_time TIMESTAMP;
35 SET local_time= NOW();
36 SET cur_user= CURRENT_USER();
37 SET local_uuid= UUID();
39 WHILE ins_count > 0 DO
40 INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
41 ins_count,'Going to test MBR for MySQL');
42 SET ins_count = ins_count - 1;
44 SELECT MAX(id) FROM test.part_tbl INTO del_count;
45 WHILE del_count > 0 DO
46 DELETE FROM test.part_tbl WHERE id = del_count;
47 select count(*) as internal_count, del_count -- these two lines are for
48 FROM test.part_tbl; -- debug to show the problem
49 SET del_count = del_count - 2;
55 ############ Finish Setup Section ###################
57 ############ Test Section ###################
60 CALL test.proc_part();
62 select count(*) as Part from test.part_tbl;
64 ###### CLEAN UP SECTION ##############
66 DROP PROCEDURE test.proc_part;
67 DROP TABLE test.part_tbl;