| 1 |
--source include/no_valgrind_without_big.inc |
| 2 |
--vertical_results |
| 3 |
let $engine_type= 'innodb'; |
| 4 |
|
| 5 |
######## Creat Table Section ######### |
| 6 |
use test; |
| 7 |
|
| 8 |
eval CREATE TABLE test.part_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=$engine_type |
| 12 |
PARTITION BY RANGE(id) |
| 13 |
SUBPARTITION BY hash(id) subpartitions 2 |
| 14 |
(PARTITION pa3 values less than (42), |
| 15 |
PARTITION pa6 values less than (60), |
| 16 |
PARTITION pa7 values less than (70), |
| 17 |
PARTITION pa8 values less than (80), |
| 18 |
PARTITION pa9 values less than (90), |
| 19 |
PARTITION pa10 values less than (100), |
| 20 |
PARTITION pa11 values less than MAXVALUE); |
| 21 |
|
| 22 |
######## Create SPs, Functions, Views and Triggers Section ############## |
| 23 |
|
| 24 |
delimiter |; |
| 25 |
|
| 26 |
CREATE PROCEDURE test.proc_part() |
| 27 |
BEGIN |
| 28 |
DECLARE ins_count INT DEFAULT 1000; |
| 29 |
DECLARE del_count INT; |
| 30 |
DECLARE cur_user VARCHAR(255); |
| 31 |
DECLARE local_uuid VARCHAR(255); |
| 32 |
DECLARE local_time TIMESTAMP; |
| 33 |
|
| 34 |
SET local_time= NOW(); |
| 35 |
SET cur_user= CURRENT_USER(); |
| 36 |
SET local_uuid= UUID(); |
| 37 |
|
| 38 |
WHILE ins_count > 0 DO |
| 39 |
INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(), |
| 40 |
ins_count,'Going to test MBR for MySQL'); |
| 41 |
SET ins_count = ins_count - 1; |
| 42 |
END WHILE; |
| 43 |
SELECT MAX(id) FROM test.part_tbl INTO del_count; |
| 44 |
WHILE del_count > 0 DO |
| 45 |
DELETE FROM test.part_tbl WHERE id = del_count; |
| 46 |
select count(*) as internal_count, del_count -- these two lines are for |
| 47 |
FROM test.part_tbl; -- debug to show the problem |
| 48 |
SET del_count = del_count - 2; |
| 49 |
END WHILE; |
| 50 |
END| |
| 51 |
|
| 52 |
delimiter ;| |
| 53 |
|
| 54 |
############ Finish Setup Section ################### |
| 55 |
|
| 56 |
############ Test Section ################### |
| 57 |
--horizontal_results |
| 58 |
|
| 59 |
CALL test.proc_part(); |
| 60 |
|
| 61 |
select count(*) as Part from test.part_tbl; |
| 62 |
|
| 63 |
###### CLEAN UP SECTION ############## |
| 64 |
|
| 65 |
DROP PROCEDURE test.proc_part; |
| 66 |
DROP TABLE test.part_tbl; |
| 67 |
|