Debian Codegraph @

mysql-test/suite/parts/inc/partition-dml-1-12.inc

raw
1 # NOTE: Currently run for InnoDB Storage Engine only
2
3 --echo # test handler operation with partitioned table
4 eval CREATE TABLE t1 (
5 col_1_int int,
6 col_2_int int,
7 PRIMARY KEY(col_2_int),
8 KEY idx1 (col_1_int, col_2_int))
9 ENGINE = $engine
10 PARTITION BY KEY() partitions 4;
11
12 SHOW CREATE TABLE t1;
13
14 --echo # test handler read forward
15
16 --echo # insert values in all partitions - 1st set
17 INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
18
19 --echo # insert values in all partitions - 2nd set
20 INSERT INTO t1 VALUES (8, 5), (7, 6), (6, 7), (5, 8);
21
22 HANDLER t1 OPEN;
23
24 --echo # read 2nd set of values in forward direction using handler
25 HANDLER t1 READ idx1 > (4, 4) LIMIT 10;
26
27 --echo # replace 1st set of values to make them bigger in idx1 order
28 REPLACE INTO t1 VALUES (9, 1), (10, 2), (11, 3), (12, 4);
29
30 --echo # try handler next- expect no rows
31 HANDLER t1 READ idx1 next;
32
33 HANDLER t1 CLOSE;
34
35 --echo # delete all rows
36 DELETE FROM t1;
37
38 --echo # test handler read backward
39
40 --echo # insert values in all partitions - 1st set
41 INSERT INTO t1 VALUES (8, 5), (7, 6), (6, 7), (5, 8);
42
43 --echo # insert values in all partitions - 2nd set
44 INSERT INTO t1 VALUES (9, 9), (10, 10), (11, 11), (12, 12);
45
46 HANDLER t1 OPEN;
47
48 --echo # read 1st set of values in backward direction using handler
49 HANDLER t1 READ idx1 < (9, 9) LIMIT 10;
50
51 --echo # replace 2nd set of values to make them smaller in idx1 order
52 REPLACE INTO t1 VALUES ( 1, 9), ( 2, 10), ( 3, 11), ( 4, 12);
53
54 --echo # try handler previous- expect no rows
55 HANDLER t1 READ idx1 prev;
56
57 HANDLER t1 CLOSE;
58
59 DROP TABLE t1;
60 #------------------------------------------------------------------------------#