1-- source include/have_innodb.inc 2 3let MYSQLD_DATADIR =`SELECT @@datadir`; 4 5SET AUTOCOMMIT = 0; 6 7# Export/import on the same instance, with --innodb-file-per-table=1 8CREATE DATABASE testdb_wl5522; 9CREATE TABLE testdb_wl5522.t1 (c1 int ) engine = Innodb; 10 11BEGIN; 12INSERT INTO testdb_wl5522.t1 VALUES (1),(123),(331); 13ROLLBACK; 14 15SELECT c1 FROM testdb_wl5522.t1; 16 17FLUSH TABLES testdb_wl5522.t1 FOR EXPORT; 18perl; 19do 'include/innodb-util.inc'; 20ib_backup_tablespaces("testdb_wl5522", "t1"); 21EOF 22UNLOCK TABLES; 23 24DROP TABLE testdb_wl5522.t1; 25 26CREATE TABLE testdb_wl5522.t1 (c1 int ) ENGINE = Innodb; 27ALTER TABLE testdb_wl5522.t1 DISCARD TABLESPACE; 28 29perl; 30do 'include/innodb-util.inc'; 31ib_discard_tablespaces("testdb_wl5522", "t1"); 32ib_restore_tablespaces("testdb_wl5522", "t1"); 33EOF 34 35ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE; 36CHECK TABLE testdb_wl5522.t1; 37SELECT c1 FROM testdb_wl5522.t1; 38 39SET AUTOCOMMIT = 1; 40DROP TABLE testdb_wl5522.t1; 41DROP DATABASE testdb_wl5522; 42