Debian Codegraph @

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

raw
1 create table t1 (a smallint 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` smallint(5) 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 (65535), (65534), (65533), (65532), (1), (2), (256);
19 select * from t1;
20 a
21 1
22 2
23 256
24 65532
25 65533
26 65534
27 65535
28 select * from t1 where a=65533;
29 a
30 65533
31 delete from t1 where a=65533;
32 select * from t1;
33 a
34 1
35 2
36 256
37 65532
38 65534
39 65535
40 drop table t1;
41 create table t2 (a smallint 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` smallint(5) 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 (65535), (65534), (65533), (65532);
52 select * from t2;
53 a
54 65532
55 65533
56 65534
57 65535
58 select * from t2 where a=65533;
59 a
60 65533
61 delete from t2 where a=65533;
62 select * from t2;
63 a
64 65532
65 65534
66 65535
67 delete from t2;
68 1024 inserts;
69 select count(*) from t2;
70 count(*)
71 1024
72 drop table t2;
73 create table t3 (a smallint 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` smallint(6) 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 (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0);
84 select * from t3;
85 a
86 -1
87 -32767
88 -32768
89 0
90 1
91 32764
92 32765
93 32766
94 32767
95 select * from t3 where a=32765;
96 a
97 32765
98 delete from t3 where a=32765;
99 select * from t3;
100 a
101 -1
102 -32767
103 -32768
104 0
105 1
106 32764
107 32766
108 32767
109 drop table t3;