1
# Not supported in embedded
2
--source include/not_embedded.inc
4
-- source include/have_innodb.inc
7
DROP TABLE IF EXISTS t1;
10
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
11
let $innodb_file_format = `SELECT @@innodb_file_format`;
13
SET GLOBAL innodb_file_per_table = 1;
14
SELECT @@innodb_file_per_table;
16
SET GLOBAL innodb_file_format = `Barracuda`;
17
SELECT @@innodb_file_format;
19
let $MYSQLD_TMPDIR = `SELECT @@tmpdir`;
20
let $MYSQLD_DATADIR = `SELECT @@datadir`;
23
(a INT AUTO_INCREMENT PRIMARY KEY,
29
insert into t1 (b, c) values ('Apa', 'Filler........'),
30
('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'),
31
('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg');
33
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
34
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
35
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
36
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
37
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
38
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
39
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
40
SELECT COUNT(*) FROM t1;
41
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
42
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
43
--list_files $MYSQLD_DATADIR/test
44
--echo # Restarting server
45
-- source include/restart_mysqld.inc
46
--echo # Done restarting server
47
FLUSH TABLE t1 FOR EXPORT;
48
--echo # List before copying files
49
--list_files $MYSQLD_DATADIR/test
50
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
51
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
53
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
54
SELECT COUNT(*) FROM t1;
55
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
56
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
57
--echo # Restarting server
58
-- source include/restart_mysqld.inc
59
--echo # Done restarting server
60
--echo # List before t1 DISCARD
61
--list_files $MYSQLD_DATADIR/test
62
ALTER TABLE t1 DISCARD TABLESPACE;
63
--echo # List after t1 DISCARD
64
--list_files $MYSQLD_DATADIR/test
65
--copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
66
--copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
67
ALTER TABLE t1 IMPORT TABLESPACE;
68
ALTER TABLE t1 ENGINE InnoDB;
69
SELECT COUNT(*) FROM t1;
70
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
71
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
72
--list_files $MYSQLD_DATADIR/test
73
SELECT COUNT(*) FROM t1;
74
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
75
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
78
--remove_file $MYSQLD_TMPDIR/t1.cfg
79
--remove_file $MYSQLD_TMPDIR/t1.ibd
81
SET GLOBAL innodb_file_per_table = 1;
82
SELECT @@innodb_file_per_table;
84
SET GLOBAL innodb_file_format = `Barracuda`;
85
SELECT @@innodb_file_format;
87
let MYSQLD_DATADIR =`SELECT @@datadir`;
89
# Try importing when tablespace already exists
91
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
92
c2 INT) ENGINE=InnoDB;
94
INSERT INTO t1(c2) VALUES(1);
95
--error ER_TABLESPACE_EXISTS
96
ALTER TABLE t1 IMPORT TABLESPACE;
100
# Export/import on the same instance, with --innodb-file-per-table=1
102
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
103
c2 INT) ENGINE=InnoDB;
105
INSERT INTO t1(c2) VALUES(1);
106
INSERT INTO t1(c2) SELECT c2 FROM t1;
107
INSERT INTO t1(c2) SELECT c2 FROM t1;
108
INSERT INTO t1(c2) SELECT c2 FROM t1;
109
INSERT INTO t1(c2) SELECT c2 FROM t1;
111
--list_files $MYSQLD_DATADIR/test
113
FLUSH TABLES t1 FOR EXPORT;
114
SELECT COUNT(*) FROM t1;
116
do 'include/innodb-util.inc';
117
ib_backup_tablespaces("test", "t1");
120
--list_files $MYSQLD_DATADIR/test
127
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
128
c2 INT) ENGINE=InnoDB;
130
ALTER TABLE t1 DISCARD TABLESPACE;
131
--error ER_TABLESPACE_DISCARDED
135
do 'include/innodb-util.inc';
136
ib_discard_tablespaces("test", "t1");
137
ib_restore_tablespaces("test", "t1");
140
--list_files $MYSQLD_DATADIR/test
142
ALTER TABLE t1 IMPORT TABLESPACE;
145
SELECT COUNT(*) FROM t1;
149
# Export/import on the same instance, with --innodb-file-per-table=1
150
# Insert some more records to move the LSN forward and then drop the
153
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
154
c2 INT) ENGINE=InnoDB;
156
INSERT INTO t1(c2) VALUES(1);
157
INSERT INTO t1(c2) SELECT c2 FROM t1;
158
INSERT INTO t1(c2) SELECT c2 FROM t1;
159
INSERT INTO t1(c2) SELECT c2 FROM t1;
160
INSERT INTO t1(c2) SELECT c2 FROM t1;
162
--list_files $MYSQLD_DATADIR/test
163
FLUSH TABLES t1 FOR EXPORT;
164
SELECT COUNT(*) FROM t1;
166
do 'include/innodb-util.inc';
167
ib_backup_tablespaces("test", "t1");
169
--list_files $MYSQLD_DATADIR/test
172
--list_files $MYSQLD_DATADIR/test
174
# Move the LSN forward
175
INSERT INTO t1(c2) SELECT c2 FROM t1;
176
INSERT INTO t1(c2) SELECT c2 FROM t1;
181
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
182
c2 INT) ENGINE=InnoDB;
184
ALTER TABLE t1 DISCARD TABLESPACE;
185
--error ER_TABLESPACE_DISCARDED
189
do 'include/innodb-util.inc';
190
ib_discard_tablespaces("test", "t1");
191
ib_restore_tablespaces("test", "t1");
194
--list_files $MYSQLD_DATADIR/test
196
ALTER TABLE t1 IMPORT TABLESPACE;
199
SELECT COUNT(*) FROM t1;
203
# Export/import on the same instance, with --innodb-file-per-table=1
204
# Insert some more records to move the LSN forward and then drop the
205
# table and restore, this time the table has a secondary index too.
207
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
208
c2 INT, INDEX(c2)) ENGINE=InnoDB;
210
INSERT INTO t1(c2) VALUES(1);
211
INSERT INTO t1(c2) SELECT c2 FROM t1;
212
INSERT INTO t1(c2) SELECT c2 FROM t1;
213
INSERT INTO t1(c2) SELECT c2 FROM t1;
214
INSERT INTO t1(c2) SELECT c2 FROM t1;
216
FLUSH TABLES t1 FOR EXPORT;
217
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
219
do 'include/innodb-util.inc';
220
ib_backup_tablespaces("test", "t1");
222
--list_files $MYSQLD_DATADIR/test
225
# Move the LSN forward
226
INSERT INTO t1(c2) SELECT c2 FROM t1;
227
INSERT INTO t1(c2) SELECT c2 FROM t1;
232
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
233
c2 INT, INDEX(c2)) ENGINE=InnoDB;
235
ALTER TABLE t1 DISCARD TABLESPACE;
236
--error ER_TABLESPACE_DISCARDED
240
do 'include/innodb-util.inc';
241
ib_discard_tablespaces("test", "t1");
242
ib_restore_tablespaces("test", "t1");
245
ALTER TABLE t1 IMPORT TABLESPACE;
248
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
252
# Export/import on the same instance, with --innodb-file-per-table=1
253
# Insert some more records to move the LSN forward and then drop the
254
# table and restore, this time the table has a secondary index too.
255
# Rename the index on the create so that the IMPORT fails, drop index
256
# Create with proper name and then do an IMPORT.
258
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
259
c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
261
INSERT INTO t1(c2) VALUES(1);
262
INSERT INTO t1(c2) SELECT c2 FROM t1;
263
INSERT INTO t1(c2) SELECT c2 FROM t1;
264
INSERT INTO t1(c2) SELECT c2 FROM t1;
265
INSERT INTO t1(c2) SELECT c2 FROM t1;
267
FLUSH TABLES t1 FOR EXPORT;
268
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
270
do 'include/innodb-util.inc';
271
ib_backup_tablespaces("test", "t1");
275
# Move the LSN forward
276
INSERT INTO t1(c2) SELECT c2 FROM t1;
277
INSERT INTO t1(c2) SELECT c2 FROM t1;
282
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
283
c2 INT, INDEX x(c2)) ENGINE=InnoDB;
285
ALTER TABLE t1 DISCARD TABLESPACE;
286
--error ER_TABLESPACE_DISCARDED
290
do 'include/innodb-util.inc';
291
ib_discard_tablespaces("test", "t1");
292
ib_restore_tablespaces("test", "t1");
295
# This is really a name mismatch error, need better error codes.
296
-- error ER_TABLE_SCHEMA_MISMATCH
297
ALTER TABLE t1 IMPORT TABLESPACE;
299
ALTER TABLE t1 DROP INDEX x;
300
ALTER TABLE t1 ADD INDEX idx(c2);
303
do 'include/innodb-util.inc';
304
ib_restore_tablespaces("test", "t1");
307
ALTER TABLE t1 IMPORT TABLESPACE;
313
do 'include/innodb-util.inc';
314
ib_cleanup("test", "t1");
320
# Export/import on the same instance, with --innodb-file-per-table=0
321
# This should fail because it is not supported
322
SET GLOBAL innodb_file_per_table = 0;
325
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
326
c2 INT) ENGINE=InnoDB;
328
INSERT INTO t1(c2) VALUES(1);
329
INSERT INTO t1(c2) SELECT c2 FROM t1;
330
INSERT INTO t1(c2) SELECT c2 FROM t1;
331
INSERT INTO t1(c2) SELECT c2 FROM t1;
332
INSERT INTO t1(c2) SELECT c2 FROM t1;
334
SELECT COUNT(*) FROM t1;
336
SHOW CREATE TABLE t1;
338
# This should fail, InnoDB should return a warning
339
FLUSH TABLES t1 FOR EXPORT;
346
# Tests that check for schema mismatch during IMPORT
349
SET GLOBAL innodb_file_per_table = 1;
352
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
353
c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
355
INSERT INTO t1(c2) VALUES(1);
356
INSERT INTO t1(c2) SELECT c2 FROM t1;
357
INSERT INTO t1(c2) SELECT c2 FROM t1;
358
INSERT INTO t1(c2) SELECT c2 FROM t1;
359
INSERT INTO t1(c2) SELECT c2 FROM t1;
360
INSERT INTO t1(c2) SELECT c2 FROM t1;
362
SHOW CREATE TABLE t1;
365
FLUSH TABLES t1 FOR EXPORT;
368
do 'include/innodb-util.inc';
369
ib_backup_tablespaces("test", "t1");
376
# Table without the secondary index
378
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
379
c2 INT) ENGINE=InnoDB;
381
ALTER TABLE t1 DISCARD TABLESPACE;
382
--error ER_TABLESPACE_DISCARDED
386
do 'include/innodb-util.inc';
387
ib_discard_tablespaces("test", "t1");
388
ib_restore_tablespaces("test", "t1");
391
# This should fail because of a missing secondary index
392
-- error ER_TABLE_SCHEMA_MISMATCH
393
ALTER TABLE t1 IMPORT TABLESPACE;
396
do 'include/innodb-util.inc';
397
ib_unlink_tablespace("test", "t1");
402
# Table with an additional column
404
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
406
c3 INT, INDEX idx(c2)) ENGINE=InnoDB;
408
ALTER TABLE t1 DISCARD TABLESPACE;
409
--error ER_TABLESPACE_DISCARDED
413
do 'include/innodb-util.inc';
414
ib_discard_tablespaces("test", "t1");
415
ib_restore_tablespaces("test", "t1");
418
# This should fail because the table has an additional column
419
-- error ER_TABLE_SCHEMA_MISMATCH
420
ALTER TABLE t1 IMPORT TABLESPACE;
423
do 'include/innodb-util.inc';
424
ib_unlink_tablespace("test", "t1");
429
# Change the column type of c2
431
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
432
c2 BIGINT, INDEX idx(c2)) ENGINE=InnoDB;
434
ALTER TABLE t1 DISCARD TABLESPACE;
435
--error ER_TABLESPACE_DISCARDED
439
do 'include/innodb-util.inc';
440
ib_discard_tablespaces("test", "t1");
441
ib_restore_tablespaces("test", "t1");
444
# This should fail because c2 is now a BIGINT and not INT
445
-- error ER_TABLE_SCHEMA_MISMATCH
446
ALTER TABLE t1 IMPORT TABLESPACE;
449
do 'include/innodb-util.inc';
450
ib_unlink_tablespace("test", "t1");
457
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
458
c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
460
ALTER TABLE t1 DISCARD TABLESPACE;
461
--error ER_TABLESPACE_DISCARDED
465
do 'include/innodb-util.inc';
466
ib_discard_tablespaces("test", "t1");
467
ib_restore_tablespaces("test", "t1");
470
ALTER TABLE t1 IMPORT TABLESPACE;
474
do 'include/innodb-util.inc';
475
ib_cleanup("test", "t1");
478
SHOW CREATE TABLE t1;
484
# Row format tests [EXPORT REDUNDANT - IMPORT COMPACT & DYNAMIC]
487
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
488
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
490
INSERT INTO t1(c2) VALUES(1);
491
INSERT INTO t1(c2) SELECT c2 FROM t1;
492
INSERT INTO t1(c2) SELECT c2 FROM t1;
493
INSERT INTO t1(c2) SELECT c2 FROM t1;
494
INSERT INTO t1(c2) SELECT c2 FROM t1;
495
INSERT INTO t1(c2) SELECT c2 FROM t1;
497
SHOW CREATE TABLE t1;
500
FLUSH TABLES t1 FOR EXPORT;
503
do 'include/innodb-util.inc';
504
ib_backup_tablespaces("test", "t1");
512
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
513
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
515
ALTER TABLE t1 DISCARD TABLESPACE;
516
--error ER_TABLESPACE_DISCARDED
520
do 'include/innodb-util.inc';
521
ib_discard_tablespaces("test", "t1");
522
ib_restore_tablespaces("test", "t1");
525
ALTER TABLE t1 IMPORT TABLESPACE;
529
do 'include/innodb-util.inc';
530
ib_cleanup("test", "t1");
533
SHOW CREATE TABLE t1;
539
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
540
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
542
ALTER TABLE t1 DISCARD TABLESPACE;
543
--error ER_TABLESPACE_DISCARDED
547
do 'include/innodb-util.inc';
548
ib_discard_tablespaces("test", "t1");
549
ib_restore_tablespaces("test", "t1");
552
--error ER_TABLE_SCHEMA_MISMATCH
553
ALTER TABLE t1 IMPORT TABLESPACE;
556
do 'include/innodb-util.inc';
557
ib_unlink_tablespace("test", "t1");
563
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
564
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
566
ALTER TABLE t1 DISCARD TABLESPACE;
567
--error ER_TABLESPACE_DISCARDED
571
do 'include/innodb-util.inc';
572
ib_discard_tablespaces("test", "t1");
573
ib_restore_tablespaces("test", "t1");
576
--error ER_TABLE_SCHEMA_MISMATCH
577
ALTER TABLE t1 IMPORT TABLESPACE;
580
do 'include/innodb-util.inc';
581
ib_unlink_tablespace("test", "t1");
588
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
589
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
591
ALTER TABLE t1 DISCARD TABLESPACE;
592
--error ER_TABLESPACE_DISCARDED
596
do 'include/innodb-util.inc';
597
ib_discard_tablespaces("test", "t1");
598
ib_restore_tablespaces("test", "t1");
601
ALTER TABLE t1 IMPORT TABLESPACE;
604
do 'include/innodb-util.inc';
605
ib_cleanup("test", "t1");
608
SHOW CREATE TABLE t1;
614
# Row format tests [EXPORT COMPACT - IMPORT REDUNDANT & DYNAMIC]
617
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
618
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
620
INSERT INTO t1(c2) VALUES(1);
621
INSERT INTO t1(c2) SELECT c2 FROM t1;
622
INSERT INTO t1(c2) SELECT c2 FROM t1;
623
INSERT INTO t1(c2) SELECT c2 FROM t1;
624
INSERT INTO t1(c2) SELECT c2 FROM t1;
625
INSERT INTO t1(c2) SELECT c2 FROM t1;
627
SHOW CREATE TABLE t1;
630
FLUSH TABLES t1 FOR EXPORT;
633
do 'include/innodb-util.inc';
634
ib_backup_tablespaces("test", "t1");
642
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
643
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
645
ALTER TABLE t1 DISCARD TABLESPACE;
646
--error ER_TABLESPACE_DISCARDED
650
do 'include/innodb-util.inc';
651
ib_discard_tablespaces("test", "t1");
652
ib_restore_tablespaces("test", "t1");
655
ALTER TABLE t1 IMPORT TABLESPACE;
659
do 'include/innodb-util.inc';
660
ib_cleanup("test", "t1");
663
SHOW CREATE TABLE t1;
669
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
670
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
672
ALTER TABLE t1 DISCARD TABLESPACE;
673
--error ER_TABLESPACE_DISCARDED
677
do 'include/innodb-util.inc';
678
ib_discard_tablespaces("test", "t1");
679
ib_restore_tablespaces("test", "t1");
682
--error ER_TABLE_SCHEMA_MISMATCH
683
ALTER TABLE t1 IMPORT TABLESPACE;
686
do 'include/innodb-util.inc';
687
ib_unlink_tablespace("test", "t1");
693
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
694
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
696
ALTER TABLE t1 DISCARD TABLESPACE;
697
--error ER_TABLESPACE_DISCARDED
701
do 'include/innodb-util.inc';
702
ib_discard_tablespaces("test", "t1");
703
ib_restore_tablespaces("test", "t1");
706
--error ER_TABLE_SCHEMA_MISMATCH
707
ALTER TABLE t1 IMPORT TABLESPACE;
710
do 'include/innodb-util.inc';
711
ib_unlink_tablespace("test", "t1");
718
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
719
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
721
ALTER TABLE t1 DISCARD TABLESPACE;
722
--error ER_TABLESPACE_DISCARDED
726
do 'include/innodb-util.inc';
727
ib_discard_tablespaces("test", "t1");
728
ib_restore_tablespaces("test", "t1");
731
ALTER TABLE t1 IMPORT TABLESPACE;
735
do 'include/innodb-util.inc';
736
ib_cleanup("test", "t1");
739
SHOW CREATE TABLE t1;
745
# Row format tests [EXPORT DYNAMIC- IMPORT REDUNDANT & DYNAMIC]
748
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
749
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
751
INSERT INTO t1(c2) VALUES(1);
752
INSERT INTO t1(c2) SELECT c2 FROM t1;
753
INSERT INTO t1(c2) SELECT c2 FROM t1;
754
INSERT INTO t1(c2) SELECT c2 FROM t1;
755
INSERT INTO t1(c2) SELECT c2 FROM t1;
756
INSERT INTO t1(c2) SELECT c2 FROM t1;
758
SHOW CREATE TABLE t1;
761
FLUSH TABLES t1 FOR EXPORT;
764
do 'include/innodb-util.inc';
765
ib_backup_tablespaces("test", "t1");
773
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
774
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
776
ALTER TABLE t1 DISCARD TABLESPACE;
777
--error ER_TABLESPACE_DISCARDED
781
do 'include/innodb-util.inc';
782
ib_discard_tablespaces("test", "t1");
783
ib_restore_tablespaces("test", "t1");
786
ALTER TABLE t1 IMPORT TABLESPACE;
790
do 'include/innodb-util.inc';
791
ib_cleanup("test", "t1");
794
SHOW CREATE TABLE t1;
800
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
801
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
803
ALTER TABLE t1 DISCARD TABLESPACE;
804
--error ER_TABLESPACE_DISCARDED
808
do 'include/innodb-util.inc';
809
ib_discard_tablespaces("test", "t1");
810
ib_restore_tablespaces("test", "t1");
813
--error ER_TABLE_SCHEMA_MISMATCH
814
ALTER TABLE t1 IMPORT TABLESPACE;
817
do 'include/innodb-util.inc';
818
ib_unlink_tablespace("test", "t1");
824
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
825
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
827
ALTER TABLE t1 DISCARD TABLESPACE;
828
--error ER_TABLESPACE_DISCARDED
832
do 'include/innodb-util.inc';
833
ib_discard_tablespaces("test", "t1");
834
ib_restore_tablespaces("test", "t1");
837
--error ER_TABLE_SCHEMA_MISMATCH
838
ALTER TABLE t1 IMPORT TABLESPACE;
841
do 'include/innodb-util.inc';
842
ib_unlink_tablespace("test", "t1");
849
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
850
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
852
ALTER TABLE t1 DISCARD TABLESPACE;
853
--error ER_TABLESPACE_DISCARDED
857
do 'include/innodb-util.inc';
858
ib_discard_tablespaces("test", "t1");
859
ib_restore_tablespaces("test", "t1");
862
ALTER TABLE t1 IMPORT TABLESPACE;
866
do 'include/innodb-util.inc';
867
ib_cleanup("test", "t1");
870
SHOW CREATE TABLE t1;
875
call mtr.add_suppression("Got error -1 when reading table '.*'");
876
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
877
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
880
--remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg
881
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd
883
eval SET GLOBAL INNODB_FILE_FORMAT=$innodb_file_format;
884
eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table;