Debian Codegraph @

mysql-test/suite/ndb/r/ndb_restore_conv_pk_auto.result

raw
1 use test;
2 ********************************
3 Autoincrement extend pk
4 Prepare table + backup with log
5 ********************************
6 create table test.autokey (
7 ak bigint unsigned not null auto_increment,
8 ok bigint unsigned not null,
9 data varchar(200) not null,
10 primary key(ak),
11 key(ok))
12 engine=ndb;
13 insert into test.autokey (ok,data) values
14 (1, "1-1"),
15 (1, "1-2"),
16 (1, "1-3"),
17 (1, "1-4"),
18 (2, "2-1"),
19 (2, "2-2"),
20 (2, "2-3"),
21 (3, "3-1"),
22 (3, "3-2"),
23 (3, "3-3");
24 select * from test.autokey order by data;
25 ak ok data
26 1 1 1-1
27 2 1 1-2
28 3 1 1-3
29 4 1 1-4
30 5 2 2-1
31 6 2 2-2
32 7 2 2-3
33 8 3 3-1
34 9 3 3-2
35 10 3 3-3
36 Stall backup completion
37 Run backup
38 Starting backup
39 Backup started
40 Make some changes which will be logged...
41 insert into test.autokey (ok,data) values
42 (4, "4-1"),
43 (4, "4-2"),
44 (4, "4-3"),
45 (5, "5-1"),
46 (5, "5-2");
47 update test.autokey set data = concat(data, "-mk2");
48 update test.autokey set ok=ok, data=concat(data,"-1");
49 delete from test.autokey where ok=2;
50 Allow backup to complete...
51 Waiting for backup to complete
52 Backup completed
53 select * from test.autokey order by data;
54 ak ok data
55 1 1 1-1-mk2-1
56 2 1 1-2-mk2-1
57 3 1 1-3-mk2-1
58 4 1 1-4-mk2-1
59 8 3 3-1-mk2-1
60 9 3 3-2-mk2-1
61 10 3 3-3-mk2-1
62 11 4 4-1-mk2-1
63 12 4 4-2-mk2-1
64 13 4 4-3-mk2-1
65 14 5 5-1-mk2-1
66 15 5 5-2-mk2-1
67 Check next auto-inc value
68 insert into test.autokey (ok,data) values (6, "6-1");
69 select ak from test.autokey where ok=6;
70 ak
71 16
72 drop table test.autokey;
73 Primary key extended to include another column
74 PK order changed
75 Extra secondary index dropped
76 **********************************************
77 create table test.autokey (
78 ak bigint unsigned not null auto_increment,
79 ok bigint unsigned not null,
80 data varchar(200) not null,
81 primary key(ok,ak))
82 engine=ndb partition by key(ok);
83 Run restore
84 select * from test.autokey order by data;
85 ak ok data
86 1 1 1-1-mk2-1
87 2 1 1-2-mk2-1
88 3 1 1-3-mk2-1
89 4 1 1-4-mk2-1
90 8 3 3-1-mk2-1
91 9 3 3-2-mk2-1
92 10 3 3-3-mk2-1
93 11 4 4-1-mk2-1
94 12 4 4-2-mk2-1
95 13 4 4-3-mk2-1
96 14 5 5-1-mk2-1
97 15 5 5-2-mk2-1
98 Check next auto-inc value
99 insert into test.autokey (ok,data) values (6, "6-1");
100 select ak from test.autokey where ok=6;
101 ak
102 16
103 drop table test.autokey;
104 Primary key extended to include another column
105 PK column demoted
106 !PK column promoted
107 PK order changed
108 Extra secondary index dropped
109 **********************************************
110 create table test.autokey (
111 ak bigint unsigned not null auto_increment,
112 ok int unsigned not null,
113 data varchar(250) not null,
114 primary key(ok,ak))
115 engine=ndb partition by key(ok);
116 Run restore
117 select * from test.autokey order by data;
118 ak ok data
119 1 1 1-1-mk2-1
120 2 1 1-2-mk2-1
121 3 1 1-3-mk2-1
122 4 1 1-4-mk2-1
123 8 3 3-1-mk2-1
124 9 3 3-2-mk2-1
125 10 3 3-3-mk2-1
126 11 4 4-1-mk2-1
127 12 4 4-2-mk2-1
128 13 4 4-3-mk2-1
129 14 5 5-1-mk2-1
130 15 5 5-2-mk2-1
131 Check next auto-inc value
132 insert into test.autokey (ok,data) values (6, "6-1");
133 select ak from test.autokey where ok=6;
134 ak
135 16
136 drop table test.autokey;
137 ********************************
138 Autoincrement reduce pk
139 Prepare table + backup with log
140 ********************************
141 create table test.autokey (
142 ak bigint unsigned not null auto_increment,
143 ok bigint unsigned not null,
144 data varchar(200) not null,
145 primary key(ok,ak))
146 engine=ndb partition by key(ok);
147 insert into test.autokey (ok,data) values
148 (1, "1-1"),
149 (1, "1-2"),
150 (1, "1-3"),
151 (1, "1-4"),
152 (2, "2-1"),
153 (2, "2-2"),
154 (2, "2-3"),
155 (3, "3-1"),
156 (3, "3-2"),
157 (3, "3-3");
158 select * from test.autokey order by data;
159 ak ok data
160 1 1 1-1
161 2 1 1-2
162 3 1 1-3
163 4 1 1-4
164 5 2 2-1
165 6 2 2-2
166 7 2 2-3
167 8 3 3-1
168 9 3 3-2
169 10 3 3-3
170 Stall backup completion
171 Run backup
172 Starting backup
173 Backup started
174 Make some changes which will be logged...
175 insert into test.autokey (ok,data) values
176 (4, "4-1"),
177 (4, "4-2"),
178 (4, "4-3"),
179 (5, "5-1"),
180 (5, "5-2");
181 update test.autokey set data = concat(data, "-mk2");
182 delete from test.autokey where ok=2;
183 Allow backup to complete...
184 Waiting for backup to complete
185 Backup completed
186 select * from test.autokey order by data;
187 ak ok data
188 1 1 1-1-mk2
189 2 1 1-2-mk2
190 3 1 1-3-mk2
191 4 1 1-4-mk2
192 8 3 3-1-mk2
193 9 3 3-2-mk2
194 10 3 3-3-mk2
195 11 4 4-1-mk2
196 12 4 4-2-mk2
197 13 4 4-3-mk2
198 14 5 5-1-mk2
199 15 5 5-2-mk2
200 Check next auto-inc value
201 insert into test.autokey (ok,data) values (6, "6-1");
202 select ak from test.autokey where ok=6;
203 ak
204 16
205 drop table test.autokey;
206 Primary key reduced down to autoincrement
207 Extra secondary index
208 **********************************************
209 create table test.autokey (
210 ak bigint unsigned not null auto_increment,
211 ok bigint unsigned not null,
212 data varchar(200) not null,
213 primary key(ak),
214 key(ok))
215 engine=ndb;
216 Run restore
217 select * from test.autokey order by data;
218 ak ok data
219 1 1 1-1-mk2
220 2 1 1-2-mk2
221 3 1 1-3-mk2
222 4 1 1-4-mk2
223 8 3 3-1-mk2
224 9 3 3-2-mk2
225 10 3 3-3-mk2
226 11 4 4-1-mk2
227 12 4 4-2-mk2
228 13 4 4-3-mk2
229 14 5 5-1-mk2
230 15 5 5-2-mk2
231 Check next auto-inc value
232 insert into test.autokey (ok,data) values (6, "6-1");
233 select ak from test.autokey where ok=6;
234 ak
235 16
236 drop table test.autokey;
237 Primary key reduced down to autoincrement
238 Ex-PK demoted
239 Non-PK demoted
240 Extra secondary index
241 **********************************************
242 create table test.autokey (
243 ak bigint unsigned not null auto_increment,
244 ok int unsigned not null,
245 data varchar(20) not null,
246 primary key(ak),
247 key(ok))
248 engine=ndb;
249 Run restore
250 select * from test.autokey order by data;
251 ak ok data
252 1 1 1-1-mk2
253 2 1 1-2-mk2
254 3 1 1-3-mk2
255 4 1 1-4-mk2
256 8 3 3-1-mk2
257 9 3 3-2-mk2
258 10 3 3-3-mk2
259 11 4 4-1-mk2
260 12 4 4-2-mk2
261 13 4 4-3-mk2
262 14 5 5-1-mk2
263 15 5 5-2-mk2
264 Check next auto-inc value
265 insert into test.autokey (ok,data) values (6, "6-1");
266 select ak from test.autokey where ok=6;
267 ak
268 16
269 drop table test.autokey;