Debian Codegraph @

mysql-test/suite/innodb/t/innodb_bug30919.test

raw
1 --source include/have_innodb.inc
2 --source include/have_partition.inc
3 --vertical_results
4 let $engine_type= 'innodb';
5
6 ######## Creat Table Section #########
7 use test;
8
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);
22
23 ######## Create SPs, Functions, Views and Triggers Section ##############
24
25 --enable_prepare_warnings
26
27 delimiter |;
28
29 CREATE PROCEDURE test.proc_part()
30 BEGIN
31 DECLARE ins_count INT DEFAULT 1000;
32 DECLARE del_count INT;
33 DECLARE cur_user VARCHAR(255);
34 DECLARE local_uuid VARCHAR(255);
35 DECLARE local_time TIMESTAMP;
36
37 SET local_time= NOW();
38 SET cur_user= CURRENT_USER();
39 SET local_uuid= UUID();
40
41 WHILE ins_count > 0 DO
42 INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
43 ins_count,'Going to test MBR for MySQL');
44 SET ins_count = ins_count - 1;
45 END WHILE;
46 SELECT MAX(id) FROM test.part_tbl INTO del_count;
47 WHILE del_count > 0 DO
48 DELETE FROM test.part_tbl WHERE id = del_count;
49 select count(*) as internal_count, del_count -- these two lines are for
50 FROM test.part_tbl; -- debug to show the problem
51 SET del_count = del_count - 2;
52 END WHILE;
53 END|
54
55 delimiter ;|
56
57 --disable_prepare_warnings
58
59 ############ Finish Setup Section ###################
60
61 ############ Test Section ###################
62 --horizontal_results
63
64 CALL test.proc_part();
65
66 select count(*) as Part from test.part_tbl;
67
68 ###### CLEAN UP SECTION ##############
69
70 DROP PROCEDURE test.proc_part;
71 DROP TABLE test.part_tbl;
72