Debian Codegraph @

mysql-test/suite/parts/r/partition_tinyint_innodb.result

raw
1 create table t1 (a tinyint unsigned not null, primary key(a)) engine='InnoDB'
2 partition by key (a) (
3 partition pa1 max_rows=20 min_rows=2,
4 partition pa2 max_rows=30 min_rows=3,
5 partition pa3 max_rows=30 min_rows=4,
6 partition pa4 max_rows=40 min_rows=2);
7 show create table t1;
8 Table Create Table
9 t1 CREATE TABLE `t1` (
10 `a` tinyint(3) unsigned NOT NULL,
11 PRIMARY KEY (`a`)
12 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
13 PARTITION BY KEY (`a`)
14 (PARTITION `pa1` MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
15 PARTITION `pa2` MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
16 PARTITION `pa3` MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
17 PARTITION `pa4` MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB)
18 insert into t1 values (255), (254), (253), (252), (1), (2), (128);
19 select * from t1;
20 a
21 1
22 128
23 2
24 252
25 253
26 254
27 255
28 select * from t1 where a=253;
29 a
30 253
31 delete from t1 where a=253;
32 select * from t1;
33 a
34 1
35 128
36 2
37 252
38 254
39 255
40 drop table t1;
41 create table t2 (a tinyint unsigned not null, primary key(a)) engine='InnoDB'
42 partition by key (a) partitions 8;
43 show create table t2;
44 Table Create Table
45 t2 CREATE TABLE `t2` (
46 `a` tinyint(3) unsigned NOT NULL,
47 PRIMARY KEY (`a`)
48 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
49 PARTITION BY KEY (`a`)
50 PARTITIONS 8
51 insert into t2 values (255), (254), (253), (252);
52 select * from t2;
53 a
54 252
55 253
56 254
57 255
58 select * from t2 where a=253;
59 a
60 253
61 delete from t2 where a=253;
62 select * from t2;
63 a
64 252
65 254
66 255
67 delete from t2;
68 255 inserts;
69 select count(*) from t2;
70 count(*)
71 255
72 drop table t2;
73 create table t3 (a tinyint not null, primary key(a)) engine='InnoDB'
74 partition by key (a) partitions 7;
75 show create table t3;
76 Table Create Table
77 t3 CREATE TABLE `t3` (
78 `a` tinyint(4) NOT NULL,
79 PRIMARY KEY (`a`)
80 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
81 PARTITION BY KEY (`a`)
82 PARTITIONS 7
83 insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0);
84 select * from t3;
85 a
86 -1
87 -127
88 -128
89 0
90 1
91 124
92 125
93 126
94 127
95 select * from t3 where a=125;
96 a
97 125
98 delete from t3 where a=125;
99 select * from t3;
100 a
101 -1
102 -127
103 -128
104 0
105 1
106 124
107 126
108 127
109 drop table t3;