Debian Codegraph @

mysql-test/suite/innodb/r/alter_algorithm.result

raw
1 #
2 # sql_mode: alter_algorithm: COPY
3 #
4 CREATE TABLE t1(f1 INT NOT NULL,
5 f2 INT NOT NULL,
6 f3 INT NULL,
7 f4 INT as (f2) STORED,
8 f5 INT as (f3) STORED,
9 PRIMARY KEY(f1))ROW_FORMAT=COMPRESSED, ENGINE=INNODB;
10 INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
11 CREATE TABLE t2(f1 INT PRIMARY KEY, f2 INT NOT NULL,
12 f3 INT AS (f2 * f2) VIRTUAL,
13 f4 INT NOT NULL UNIQUE,
14 f5 INT NOT NULL,
15 INDEX idx(f2))ENGINE=INNODB;
16 INSERT INTO t2(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
17 # All the following cases needs table rebuild
18 # Add and Drop primary key
19 ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1), ALGORITHM=COPY;
20 affected rows: 1
21 info: Records: 1 Duplicates: 0 Warnings: 0
22 # Make existing column NULLABLE
23 ALTER TABLE t1 MODIFY f2 INT, ALGORITHM=COPY;
24 affected rows: 1
25 info: Records: 1 Duplicates: 0 Warnings: 0
26 # Drop Stored Column
27 ALTER TABLE t1 DROP COLUMN f5, ALGORITHM=COPY;
28 affected rows: 1
29 info: Records: 1 Duplicates: 0 Warnings: 0
30 # Add base non-generated column as a last column in the compressed table
31 ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=COPY;
32 affected rows: 1
33 info: Records: 1 Duplicates: 0 Warnings: 0
34 # Add base non-generated column but not in the last position
35 ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3, ALGORITHM=COPY;
36 affected rows: 1
37 info: Records: 1 Duplicates: 0 Warnings: 0
38 # Force the table to rebuild
39 ALTER TABLE t1 FORCE, ALGORITHM=COPY;
40 affected rows: 1
41 info: Records: 1 Duplicates: 0 Warnings: 0
42 # Row format changes
43 ALTER TABLE t1 ROW_FORMAT=COMPRESSED, ALGORITHM=COPY;
44 affected rows: 1
45 info: Records: 1 Duplicates: 0 Warnings: 0
46 # Engine table
47 ALTER TABLE t1 ENGINE=INNODB, ALGORITHM=COPY;
48 affected rows: 1
49 info: Records: 1 Duplicates: 0 Warnings: 0
50 ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
51 affected rows: 0
52 info: Records: 0 Duplicates: 0 Warnings: 0
53 ALTER TABLE t2 page_compressed=1, ALGORITHM=COPY;
54 affected rows: 1
55 info: Records: 1 Duplicates: 0 Warnings: 0
56 DROP TABLE t1;
57 affected rows: 0
58 DROP TABLE t2;
59 affected rows: 0
60 CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
61 f3 INT AS (f2 * f2) VIRTUAL,
62 f4 INT NOT NULL UNIQUE,
63 f5 INT NOT NULL,
64 INDEX idx(f2)) PAGE_COMPRESSED=1, ENGINE=INNODB;
65 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
66 INDEX(f1),
67 FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
68 INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
69 ALTER TABLE t1 ADD INDEX idx1(f4), page_compression_level=7, ALGORITHM=COPY;
70 affected rows: 1
71 info: Records: 1 Duplicates: 0 Warnings: 0
72 ALTER TABLE t1 DROP INDEX idx, page_compression_level=5, ALGORITHM=COPY;
73 affected rows: 1
74 info: Records: 1 Duplicates: 0 Warnings: 0
75 ALTER TABLE t1 ADD UNIQUE INDEX u1(f2), ALGORITHM=COPY;
76 affected rows: 1
77 info: Records: 1 Duplicates: 0 Warnings: 0
78 ALTER TABLE t1 DROP INDEX f4, page_compression_level=9, ALGORITHM=COPY;
79 affected rows: 1
80 info: Records: 1 Duplicates: 0 Warnings: 0
81 SET foreign_key_checks = 0;
82 affected rows: 0
83 ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1), ALGORITHM=COPY;
84 affected rows: 1
85 info: Records: 1 Duplicates: 0 Warnings: 0
86 DROP TABLE t2, t1;
87 affected rows: 0
88 CREATE TABLE t1(f1 INT NOT NULL,
89 f2 INT NOT NULL,
90 f3 INT AS (f2 * f2) VIRTUAL,
91 INDEX idx (f2))engine=innodb;
92 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
93 f3 VARCHAR(10),
94 INDEX(f1))ENGINE=INNODB;
95 INSERT INTO t1(f1, f2) VALUES(1, 1);
96 # Add column at the end of the table
97 ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL', ALGORITHM=COPY;
98 affected rows: 1
99 info: Records: 1 Duplicates: 0 Warnings: 0
100 # Change virtual column expression
101 ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL, ALGORITHM=COPY;
102 affected rows: 1
103 info: Records: 1 Duplicates: 0 Warnings: 0
104 # Add virtual column
105 ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL, ALGORITHM=COPY;
106 affected rows: 1
107 info: Records: 1 Duplicates: 0 Warnings: 0
108 # Rename Column
109 ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL, ALGORITHM=COPY;
110 affected rows: 1
111 info: Records: 1 Duplicates: 0 Warnings: 0
112 # Rename table
113 ALTER TABLE t1 RENAME t3, ALGORITHM=COPY;
114 affected rows: 1
115 info: Records: 1 Duplicates: 0 Warnings: 0
116 # Drop Virtual Column
117 ALTER TABLE t3 DROP COLUMN vcol, ALGORITHM=COPY;
118 affected rows: 1
119 info: Records: 1 Duplicates: 0 Warnings: 0
120 # Column length varies
121 ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20), ALGORITHM=COPY;
122 affected rows: 0
123 info: Records: 0 Duplicates: 0 Warnings: 0
124 SET foreign_key_checks = 0;
125 affected rows: 0
126 ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1), ALGORITHM=COPY;
127 affected rows: 1
128 info: Records: 1 Duplicates: 0 Warnings: 0
129 SET foreign_key_checks = 1;
130 affected rows: 0
131 ALTER TABLE t3 DROP FOREIGN KEY fidx, ALGORITHM=COPY;
132 affected rows: 1
133 info: Records: 1 Duplicates: 0 Warnings: 0
134 DROP TABLE t3, t2;
135 affected rows: 0
136 #
137 # sql_mode: alter_algorithm: INPLACE
138 #
139 CREATE TABLE t1(f1 INT NOT NULL,
140 f2 INT NOT NULL,
141 f3 INT NULL,
142 f4 INT as (f2) STORED,
143 f5 INT as (f3) STORED,
144 PRIMARY KEY(f1))ROW_FORMAT=COMPRESSED, ENGINE=INNODB;
145 INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
146 CREATE TABLE t2(f1 INT PRIMARY KEY, f2 INT NOT NULL,
147 f3 INT AS (f2 * f2) VIRTUAL,
148 f4 INT NOT NULL UNIQUE,
149 f5 INT NOT NULL,
150 INDEX idx(f2))ENGINE=INNODB;
151 INSERT INTO t2(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
152 # All the following cases needs table rebuild
153 # Add and Drop primary key
154 ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1), ALGORITHM=INPLACE;
155 affected rows: 0
156 info: Records: 0 Duplicates: 0 Warnings: 0
157 # Make existing column NULLABLE
158 ALTER TABLE t1 MODIFY f2 INT, ALGORITHM=INPLACE;
159 affected rows: 0
160 info: Records: 0 Duplicates: 0 Warnings: 0
161 # Drop Stored Column
162 ALTER TABLE t1 DROP COLUMN f5, ALGORITHM=INPLACE;
163 affected rows: 0
164 info: Records: 0 Duplicates: 0 Warnings: 0
165 # Add base non-generated column as a last column in the compressed table
166 ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INPLACE;
167 affected rows: 0
168 info: Records: 0 Duplicates: 0 Warnings: 0
169 # Add base non-generated column but not in the last position
170 ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3, ALGORITHM=INPLACE;
171 affected rows: 0
172 info: Records: 0 Duplicates: 0 Warnings: 0
173 # Force the table to rebuild
174 ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
175 affected rows: 0
176 info: Records: 0 Duplicates: 0 Warnings: 0
177 # Row format changes
178 ALTER TABLE t1 ROW_FORMAT=COMPRESSED, ALGORITHM=INPLACE;
179 affected rows: 0
180 info: Records: 0 Duplicates: 0 Warnings: 0
181 # Engine table
182 ALTER TABLE t1 ENGINE=INNODB, ALGORITHM=INPLACE;
183 affected rows: 0
184 info: Records: 0 Duplicates: 0 Warnings: 0
185 ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
186 affected rows: 0
187 info: Records: 0 Duplicates: 0 Warnings: 0
188 ALTER TABLE t2 page_compressed=1, ALGORITHM=INPLACE;
189 affected rows: 0
190 info: Records: 0 Duplicates: 0 Warnings: 0
191 DROP TABLE t1;
192 affected rows: 0
193 DROP TABLE t2;
194 affected rows: 0
195 CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
196 f3 INT AS (f2 * f2) VIRTUAL,
197 f4 INT NOT NULL UNIQUE,
198 f5 INT NOT NULL,
199 INDEX idx(f2)) PAGE_COMPRESSED=1, ENGINE=INNODB;
200 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
201 INDEX(f1),
202 FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
203 INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
204 ALTER TABLE t1 ADD INDEX idx1(f4), page_compression_level=7, ALGORITHM=INPLACE;
205 affected rows: 0
206 info: Records: 0 Duplicates: 0 Warnings: 0
207 ALTER TABLE t1 DROP INDEX idx, page_compression_level=5, ALGORITHM=INPLACE;
208 affected rows: 0
209 info: Records: 0 Duplicates: 0 Warnings: 0
210 ALTER TABLE t1 ADD UNIQUE INDEX u1(f2), ALGORITHM=INPLACE;
211 affected rows: 0
212 info: Records: 0 Duplicates: 0 Warnings: 0
213 ALTER TABLE t1 DROP INDEX f4, page_compression_level=9, ALGORITHM=INPLACE;
214 affected rows: 0
215 info: Records: 0 Duplicates: 0 Warnings: 0
216 SET foreign_key_checks = 0;
217 affected rows: 0
218 ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1), ALGORITHM=INPLACE;
219 affected rows: 0
220 info: Records: 0 Duplicates: 0 Warnings: 0
221 DROP TABLE t2, t1;
222 affected rows: 0
223 CREATE TABLE t1(f1 INT NOT NULL,
224 f2 INT NOT NULL,
225 f3 INT AS (f2 * f2) VIRTUAL,
226 INDEX idx (f2))engine=innodb;
227 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
228 f3 VARCHAR(10),
229 INDEX(f1))ENGINE=INNODB;
230 INSERT INTO t1(f1, f2) VALUES(1, 1);
231 # Add column at the end of the table
232 ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL', ALGORITHM=INPLACE;
233 affected rows: 0
234 info: Records: 0 Duplicates: 0 Warnings: 0
235 # Change virtual column expression
236 ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL, ALGORITHM=INPLACE;
237 affected rows: 0
238 info: Records: 0 Duplicates: 0 Warnings: 0
239 # Add virtual column
240 ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL, ALGORITHM=INPLACE;
241 affected rows: 0
242 info: Records: 0 Duplicates: 0 Warnings: 0
243 # Rename Column
244 ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL, ALGORITHM=INPLACE;
245 affected rows: 0
246 info: Records: 0 Duplicates: 0 Warnings: 0
247 # Rename table
248 ALTER TABLE t1 RENAME t3, ALGORITHM=INPLACE;
249 affected rows: 0
250 # Drop Virtual Column
251 ALTER TABLE t3 DROP COLUMN vcol, ALGORITHM=INPLACE;
252 affected rows: 0
253 info: Records: 0 Duplicates: 0 Warnings: 0
254 # Column length varies
255 ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20), ALGORITHM=INPLACE;
256 affected rows: 0
257 info: Records: 0 Duplicates: 0 Warnings: 0
258 SET foreign_key_checks = 0;
259 affected rows: 0
260 ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1), ALGORITHM=INPLACE;
261 affected rows: 0
262 info: Records: 0 Duplicates: 0 Warnings: 0
263 SET foreign_key_checks = 1;
264 affected rows: 0
265 ALTER TABLE t3 DROP FOREIGN KEY fidx, ALGORITHM=INPLACE;
266 affected rows: 0
267 info: Records: 0 Duplicates: 0 Warnings: 0
268 DROP TABLE t3, t2;
269 affected rows: 0
270 #
271 # sql_mode: alter_algorithm: NOCOPY
272 #
273 CREATE TABLE t1(f1 INT NOT NULL,
274 f2 INT NOT NULL,
275 f3 INT NULL,
276 f4 INT as (f2) STORED,
277 f5 INT as (f3) STORED,
278 PRIMARY KEY(f1))ROW_FORMAT=COMPRESSED, ENGINE=INNODB;
279 INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
280 CREATE TABLE t2(f1 INT PRIMARY KEY, f2 INT NOT NULL,
281 f3 INT AS (f2 * f2) VIRTUAL,
282 f4 INT NOT NULL UNIQUE,
283 f5 INT NOT NULL,
284 INDEX idx(f2))ENGINE=INNODB;
285 INSERT INTO t2(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
286 # All the following cases needs table rebuild
287 # Add and Drop primary key
288 ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1), ALGORITHM=NOCOPY;
289 Got one of the listed errors
290 # Make existing column NULLABLE
291 ALTER TABLE t1 MODIFY f2 INT, ALGORITHM=NOCOPY;
292 Got one of the listed errors
293 # Drop Stored Column
294 ALTER TABLE t1 DROP COLUMN f5, ALGORITHM=NOCOPY;
295 Got one of the listed errors
296 # Add base non-generated column as a last column in the compressed table
297 ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=NOCOPY;
298 Got one of the listed errors
299 # Add base non-generated column but not in the last position
300 ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3, ALGORITHM=NOCOPY;
301 Got one of the listed errors
302 # Force the table to rebuild
303 ALTER TABLE t1 FORCE, ALGORITHM=NOCOPY;
304 Got one of the listed errors
305 # Row format changes
306 ALTER TABLE t1 ROW_FORMAT=COMPRESSED, ALGORITHM=NOCOPY;
307 Got one of the listed errors
308 # Engine table
309 ALTER TABLE t1 ENGINE=INNODB, ALGORITHM=NOCOPY;
310 Got one of the listed errors
311 ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
312 affected rows: 0
313 info: Records: 0 Duplicates: 0 Warnings: 0
314 ALTER TABLE t2 page_compressed=1, ALGORITHM=NOCOPY;
315 Got one of the listed errors
316 DROP TABLE t1;
317 affected rows: 0
318 DROP TABLE t2;
319 affected rows: 0
320 CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
321 f3 INT AS (f2 * f2) VIRTUAL,
322 f4 INT NOT NULL UNIQUE,
323 f5 INT NOT NULL,
324 INDEX idx(f2)) PAGE_COMPRESSED=1, ENGINE=INNODB;
325 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
326 INDEX(f1),
327 FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
328 INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
329 ALTER TABLE t1 ADD INDEX idx1(f4), page_compression_level=7, ALGORITHM=NOCOPY;
330 affected rows: 0
331 info: Records: 0 Duplicates: 0 Warnings: 0
332 ALTER TABLE t1 DROP INDEX idx, page_compression_level=5, ALGORITHM=NOCOPY;
333 affected rows: 0
334 info: Records: 0 Duplicates: 0 Warnings: 0
335 ALTER TABLE t1 ADD UNIQUE INDEX u1(f2), ALGORITHM=NOCOPY;
336 affected rows: 0
337 info: Records: 0 Duplicates: 0 Warnings: 0
338 ALTER TABLE t1 DROP INDEX f4, page_compression_level=9, ALGORITHM=NOCOPY;
339 affected rows: 0
340 info: Records: 0 Duplicates: 0 Warnings: 0
341 SET foreign_key_checks = 0;
342 affected rows: 0
343 ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1), ALGORITHM=NOCOPY;
344 affected rows: 0
345 info: Records: 0 Duplicates: 0 Warnings: 0
346 DROP TABLE t2, t1;
347 affected rows: 0
348 CREATE TABLE t1(f1 INT NOT NULL,
349 f2 INT NOT NULL,
350 f3 INT AS (f2 * f2) VIRTUAL,
351 INDEX idx (f2))engine=innodb;
352 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
353 f3 VARCHAR(10),
354 INDEX(f1))ENGINE=INNODB;
355 INSERT INTO t1(f1, f2) VALUES(1, 1);
356 # Add column at the end of the table
357 ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL', ALGORITHM=NOCOPY;
358 affected rows: 0
359 info: Records: 0 Duplicates: 0 Warnings: 0
360 # Change virtual column expression
361 ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL, ALGORITHM=NOCOPY;
362 affected rows: 0
363 info: Records: 0 Duplicates: 0 Warnings: 0
364 # Add virtual column
365 ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL, ALGORITHM=NOCOPY;
366 affected rows: 0
367 info: Records: 0 Duplicates: 0 Warnings: 0
368 # Rename Column
369 ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL, ALGORITHM=NOCOPY;
370 affected rows: 0
371 info: Records: 0 Duplicates: 0 Warnings: 0
372 # Rename table
373 ALTER TABLE t1 RENAME t3, ALGORITHM=NOCOPY;
374 affected rows: 0
375 # Drop Virtual Column
376 ALTER TABLE t3 DROP COLUMN vcol, ALGORITHM=NOCOPY;
377 affected rows: 0
378 info: Records: 0 Duplicates: 0 Warnings: 0
379 # Column length varies
380 ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20), ALGORITHM=NOCOPY;
381 affected rows: 0
382 info: Records: 0 Duplicates: 0 Warnings: 0
383 SET foreign_key_checks = 0;
384 affected rows: 0
385 ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1), ALGORITHM=NOCOPY;
386 affected rows: 0
387 info: Records: 0 Duplicates: 0 Warnings: 0
388 SET foreign_key_checks = 1;
389 affected rows: 0
390 ALTER TABLE t3 DROP FOREIGN KEY fidx, ALGORITHM=NOCOPY;
391 affected rows: 0
392 info: Records: 0 Duplicates: 0 Warnings: 0
393 DROP TABLE t3, t2;
394 affected rows: 0
395 #
396 # sql_mode: alter_algorithm: INSTANT
397 #
398 CREATE TABLE t1(f1 INT NOT NULL,
399 f2 INT NOT NULL,
400 f3 INT NULL,
401 f4 INT as (f2) STORED,
402 f5 INT as (f3) STORED,
403 PRIMARY KEY(f1))ROW_FORMAT=COMPRESSED, ENGINE=INNODB;
404 INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
405 CREATE TABLE t2(f1 INT PRIMARY KEY, f2 INT NOT NULL,
406 f3 INT AS (f2 * f2) VIRTUAL,
407 f4 INT NOT NULL UNIQUE,
408 f5 INT NOT NULL,
409 INDEX idx(f2))ENGINE=INNODB;
410 INSERT INTO t2(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
411 # All the following cases needs table rebuild
412 # Add and Drop primary key
413 ALTER TABLE t1 ADD COLUMN col1 INT NOT NULL,DROP PRIMARY KEY,ADD PRIMARY KEY(col1), ALGORITHM=INSTANT;
414 Got one of the listed errors
415 # Make existing column NULLABLE
416 ALTER TABLE t1 MODIFY f2 INT, ALGORITHM=INSTANT;
417 Got one of the listed errors
418 # Drop Stored Column
419 ALTER TABLE t1 DROP COLUMN f5, ALGORITHM=INSTANT;
420 Got one of the listed errors
421 # Add base non-generated column as a last column in the compressed table
422 ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INSTANT;
423 Got one of the listed errors
424 # Add base non-generated column but not in the last position
425 ALTER TABLE t1 ADD COLUMN f7 INT NOT NULL after f3, ALGORITHM=INSTANT;
426 Got one of the listed errors
427 # Force the table to rebuild
428 ALTER TABLE t1 FORCE, ALGORITHM=INSTANT;
429 Got one of the listed errors
430 # Row format changes
431 ALTER TABLE t1 ROW_FORMAT=COMPRESSED, ALGORITHM=INSTANT;
432 Got one of the listed errors
433 # Engine table
434 ALTER TABLE t1 ENGINE=INNODB, ALGORITHM=INSTANT;
435 Got one of the listed errors
436 ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
437 affected rows: 0
438 info: Records: 0 Duplicates: 0 Warnings: 0
439 ALTER TABLE t2 page_compressed=1, ALGORITHM=INSTANT;
440 Got one of the listed errors
441 DROP TABLE t1;
442 affected rows: 0
443 DROP TABLE t2;
444 affected rows: 0
445 CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
446 f3 INT AS (f2 * f2) VIRTUAL,
447 f4 INT NOT NULL UNIQUE,
448 f5 INT NOT NULL,
449 INDEX idx(f2)) PAGE_COMPRESSED=1, ENGINE=INNODB;
450 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
451 INDEX(f1),
452 FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
453 INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
454 ALTER TABLE t1 ADD INDEX idx1(f4), page_compression_level=7, ALGORITHM=INSTANT;
455 ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
456 ALTER TABLE t1 DROP INDEX idx, page_compression_level=5, ALGORITHM=INSTANT;
457 ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: DROP INDEX. Try ALGORITHM=NOCOPY
458 ALTER TABLE t1 ADD UNIQUE INDEX u1(f2), ALGORITHM=INSTANT;
459 ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
460 ALTER TABLE t1 DROP INDEX f4, page_compression_level=9, ALGORITHM=INSTANT;
461 ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: DROP INDEX. Try ALGORITHM=NOCOPY
462 SET foreign_key_checks = 0;
463 affected rows: 0
464 ALTER TABLE t1 ADD FOREIGN KEY(f5) REFERENCES t2(f1), ALGORITHM=INSTANT;
465 ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
466 DROP TABLE t2, t1;
467 affected rows: 0
468 CREATE TABLE t1(f1 INT NOT NULL,
469 f2 INT NOT NULL,
470 f3 INT AS (f2 * f2) VIRTUAL,
471 INDEX idx (f2))engine=innodb;
472 CREATE TABLE t2(f1 INT NOT NULL, f2 INT NOT NULL,
473 f3 VARCHAR(10),
474 INDEX(f1))ENGINE=INNODB;
475 INSERT INTO t1(f1, f2) VALUES(1, 1);
476 # Add column at the end of the table
477 ALTER TABLE t1 ADD COLUMN f4 char(100) default 'BIG WALL', ALGORITHM=INSTANT;
478 affected rows: 0
479 info: Records: 0 Duplicates: 0 Warnings: 0
480 # Change virtual column expression
481 ALTER TABLE t1 CHANGE f3 f3 INT AS (f2 * f2) VIRTUAL, ALGORITHM=INSTANT;
482 affected rows: 0
483 info: Records: 0 Duplicates: 0 Warnings: 0
484 # Add virtual column
485 ALTER TABLE t1 ADD COLUMN f5 INT AS (f2) VIRTUAL, ALGORITHM=INSTANT;
486 affected rows: 0
487 info: Records: 0 Duplicates: 0 Warnings: 0
488 # Rename Column
489 ALTER TABLE t1 CHANGE f3 vcol INT AS (f2) VIRTUAL, ALGORITHM=INSTANT;
490 affected rows: 0
491 info: Records: 0 Duplicates: 0 Warnings: 0
492 # Rename table
493 ALTER TABLE t1 RENAME t3, ALGORITHM=INSTANT;
494 affected rows: 0
495 # Drop Virtual Column
496 ALTER TABLE t3 DROP COLUMN vcol, ALGORITHM=INSTANT;
497 affected rows: 0
498 info: Records: 0 Duplicates: 0 Warnings: 0
499 # Column length varies
500 ALTER TABLE t2 CHANGE f3 f3 VARCHAR(20), ALGORITHM=INSTANT;
501 affected rows: 0
502 info: Records: 0 Duplicates: 0 Warnings: 0
503 SET foreign_key_checks = 0;
504 affected rows: 0
505 ALTER TABLE t3 ADD FOREIGN KEY fidx(f2) REFERENCES t2(f1), ALGORITHM=INSTANT;
506 affected rows: 0
507 info: Records: 0 Duplicates: 0 Warnings: 0
508 SET foreign_key_checks = 1;
509 affected rows: 0
510 ALTER TABLE t3 DROP FOREIGN KEY fidx, ALGORITHM=INSTANT;
511 affected rows: 0
512 info: Records: 0 Duplicates: 0 Warnings: 0
513 DROP TABLE t3, t2;
514 affected rows: 0