mariadb/mysql-test/suite/innodb/t/innodb-bug-14084530.test
Sergei Golubchik d929342b0f Merge the server part of MySQL WL#5522 - InnoDB transportable tablespaces.
Syntax. Server support. Test cases.
InnoDB bugfixes:
* don't mess around with system sprintf's, always use my_error() for errors.
* don't use InnoDB internal error codes where OS error codes are expected.
* don't say "file not found", when it was.
2014-02-02 10:00:36 +01:00

52 lines
1.3 KiB
Text

-- source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
let MYSQLD_DATADIR =`SELECT @@datadir`;
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
let $innodb_file_format = `SELECT @@innodb_file_format`;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
SET AUTOCOMMIT = 0;
# Export/import on the same instance, with --innodb-file-per-table=1
CREATE DATABASE testdb_wl5522;
CREATE TABLE testdb_wl5522.t1 (c1 int ) engine = Innodb;
BEGIN;
INSERT INTO testdb_wl5522.t1 VALUES (1),(123),(331);
ROLLBACK;
SELECT c1 FROM testdb_wl5522.t1;
FLUSH TABLES testdb_wl5522.t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("testdb_wl5522", "t1");
EOF
UNLOCK TABLES;
DROP TABLE testdb_wl5522.t1;
CREATE TABLE testdb_wl5522.t1 (c1 int ) ENGINE = Innodb;
ALTER TABLE testdb_wl5522.t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("testdb_wl5522", "t1");
ib_restore_tablespaces("testdb_wl5522", "t1");
EOF
ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE testdb_wl5522.t1;
SELECT c1 FROM testdb_wl5522.t1;
SET AUTOCOMMIT = 1;
DROP TABLE testdb_wl5522.t1;
DROP DATABASE testdb_wl5522;
eval SET GLOBAL INNODB_FILE_FORMAT=$innodb_file_format;
eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table;