| 1 |
DROP TABLE IF EXISTS t1; |
| 2 |
SELECT COUNT(*) FROM t1; |
| 3 |
COUNT(*) |
| 4 |
8192 |
| 5 |
FLUSH TABLES t1 FOR EXPORT; |
| 6 |
UNLOCK TABLES; |
| 7 |
DROP TABLE t1; |
| 8 |
select count(*) from t1; |
| 9 |
count(*) |
| 10 |
8192 |
| 11 |
DELETE FROM t1; |
| 12 |
select count(*) from t1; |
| 13 |
count(*) |
| 14 |
0 |
| 15 |
ALTER TABLE t1 DISCARD PARTITION p0,p1,p2,p3,p4,p5,p6,p7,p8 TABLESPACE; |
| 16 |
restore: t1#p#p0 .ibd and .cfg files |
| 17 |
restore: t1#p#p1 .ibd and .cfg files |
| 18 |
restore: t1#p#p2 .ibd and .cfg files |
| 19 |
restore: t1#p#p3 .ibd and .cfg files |
| 20 |
restore: t1#p#p4 .ibd and .cfg files |
| 21 |
restore: t1#p#p5 .ibd and .cfg files |
| 22 |
restore: t1#p#p6 .ibd and .cfg files |
| 23 |
restore: t1#p#p7 .ibd and .cfg files |
| 24 |
restore: t1#p#p8 .ibd and .cfg files |
| 25 |
ALTER TABLE t1 IMPORT PARTITION p0,p1,p2,p3,p4,p5,p6,p7,p8 TABLESPACE; |
| 26 |
SELECT * FROM t1 PARTITION (p0,p1,p2,p3,p4,p5,p6,p7,p8) ORDER BY i; |
| 27 |
i |
| 28 |
0 |
| 29 |
1 |
| 30 |
2 |
| 31 |
3 |
| 32 |
4 |
| 33 |
5 |
| 34 |
6 |
| 35 |
7 |
| 36 |
SELECT * FROM t1 ORDER BY i; |
| 37 |
i |
| 38 |
0 |
| 39 |
1 |
| 40 |
2 |
| 41 |
3 |
| 42 |
4 |
| 43 |
5 |
| 44 |
6 |
| 45 |
7 |
| 46 |
ALTER TABLE t1 DISCARD PARTITION p9,p10 TABLESPACE; |
| 47 |
SELECT * FROM t1 PARTITION (p0,p1,p2,p3,p4,p5,p6,p7,p8) ORDER BY i; |
| 48 |
i |
| 49 |
0 |
| 50 |
1 |
| 51 |
2 |
| 52 |
3 |
| 53 |
4 |
| 54 |
5 |
| 55 |
6 |
| 56 |
7 |
| 57 |
ALTER TABLE t1 DISCARD PARTITION all TABLESPACE; |
| 58 |
Warnings: |
| 59 |
Warning 1812 InnoDB: Tablespace is missing for table test/t1#p#p9. |
| 60 |
Warning 1812 InnoDB: Tablespace is missing for table test/t1#p#p10. |
| 61 |
ALTER TABLE t1 IMPORT PARTITION all TABLESPACE; |
| 62 |
SELECT * FROM t1 PARTITION (p0,p1,p2,p3,p4,p5,p6,p7,p8) ORDER BY i; |
| 63 |
i |
| 64 |
0 |
| 65 |
1 |
| 66 |
2 |
| 67 |
3 |
| 68 |
4 |
| 69 |
5 |
| 70 |
6 |
| 71 |
7 |
| 72 |
SELECT COUNT(*) FROM t1 ORDER BY i; |
| 73 |
COUNT(*) |
| 74 |
8192 |
| 75 |
SELECT * FROM t1 WHERE i%1000 = 0 ORDER BY i; |
| 76 |
i |
| 77 |
0 |
| 78 |
1000 |
| 79 |
2000 |
| 80 |
3000 |
| 81 |
4000 |
| 82 |
5000 |
| 83 |
6000 |
| 84 |
7000 |
| 85 |
8000 |
| 86 |
DROP TABLE t1; |
| 87 |
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing"); |
| 88 |
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* in DISCARD TABLESPACE. Tablespace not found"); |
| 89 |
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache."); |
| 90 |
call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file"); |
| 91 |
call mtr.add_suppression("InnoDB: Operating system error number 2 in a file operation."); |
| 92 |
call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified."); |