1# 2# Check how the embedded engine handles tablespace filenames 3# 4SET DEFAULT_STORAGE_ENGINE=InnoDB; 5# 6# Try a series of invalid relative ADD DATAFILE entries. 7# General tablespace files can be in the datadir but they cannot be under the datadir. 8# 9CREATE TABLESPACE bad ADD DATAFILE ''; 10ERROR HY000: Incorrect File Name ''. 11SHOW WARNINGS; 12Level Code Message 13Error 3121 Incorrect File Name ''. 14Error 1528 Failed to create TABLESPACE bad 15Error 1031 Table storage engine for 'bad' doesn't have this option 16CREATE TABLESPACE bad ADD DATAFILE '.ibd'; 17ERROR HY000: Incorrect File Name '.ibd'. 18SHOW WARNINGS; 19Level Code Message 20Error 3121 Incorrect File Name '.ibd'. 21Error 1528 Failed to create TABLESPACE bad 22Error 1031 Table storage engine for 'bad' doesn't have this option 23CREATE TABLESPACE bad ADD DATAFILE './ibd'; 24ERROR HY000: Incorrect File Name './ibd'. 25SHOW WARNINGS; 26Level Code Message 27Error 3121 Incorrect File Name './ibd'. 28Error 1528 Failed to create TABLESPACE bad 29Error 1031 Table storage engine for 'bad' doesn't have this option 30CREATE TABLESPACE bad ADD DATAFILE './.ibd'; 31ERROR HY000: Incorrect File Name './.ibd'. 32SHOW WARNINGS; 33Level Code Message 34Error 3121 Incorrect File Name './.ibd'. 35Error 1528 Failed to create TABLESPACE bad 36Error 1031 Table storage engine for 'bad' doesn't have this option 37CREATE TABLESPACE bad ADD DATAFILE '../spaces/'; 38ERROR HY000: Incorrect File Name '../spaces/'. 39SHOW WARNINGS; 40Level Code Message 41Error 3121 Incorrect File Name '../spaces/'. 42Error 1528 Failed to create TABLESPACE bad 43Error 1031 Table storage engine for 'bad' doesn't have this option 44CREATE TABLESPACE bad ADD DATAFILE 'test/bad.ibd'; 45ERROR HY000: Incorrect File Name 'test/bad.ibd'. 46SHOW WARNINGS; 47Level Code Message 48Error 3121 Incorrect File Name 'test/bad.ibd'. 49Error 3121 CREATE TABLESPACE data file cannot be under the datadir. 50Error 1528 Failed to create TABLESPACE bad 51Error 1031 Table storage engine for 'bad' doesn't have this option 52CREATE TABLESPACE bad ADD DATAFILE './test/bad.ibd'; 53ERROR HY000: Incorrect File Name './test/bad.ibd'. 54SHOW WARNINGS; 55Level Code Message 56Error 3121 Incorrect File Name './test/bad.ibd'. 57Error 3121 CREATE TABLESPACE data file cannot be under the datadir. 58Error 1528 Failed to create TABLESPACE bad 59Error 1031 Table storage engine for 'bad' doesn't have this option 60CREATE TABLESPACE bad ADD DATAFILE './test//bad.ibd'; 61ERROR HY000: Incorrect File Name './test//bad.ibd'. 62SHOW WARNINGS; 63Level Code Message 64Error 3121 Incorrect File Name './test//bad.ibd'. 65Error 3121 CREATE TABLESPACE data file cannot be under the datadir. 66Error 1528 Failed to create TABLESPACE bad 67Error 1031 Table storage engine for 'bad' doesn't have this option 68CREATE TABLESPACE bad ADD DATAFILE '../data/test/bad.ibd'; 69ERROR HY000: Incorrect File Name '../data/test/bad.ibd'. 70SHOW WARNINGS; 71Level Code Message 72Error 3121 Incorrect File Name '../data/test/bad.ibd'. 73Error 3121 CREATE TABLESPACE data file cannot be under the datadir. 74Error 1528 Failed to create TABLESPACE bad 75Error 1031 Table storage engine for 'bad' doesn't have this option 76CREATE TABLESPACE bad ADD DATAFILE '../data/../data/test/bad.ibd'; 77ERROR HY000: Incorrect File Name '../data/../data/test/bad.ibd'. 78SHOW WARNINGS; 79Level Code Message 80Error 3121 Incorrect File Name '../data/../data/test/bad.ibd'. 81Error 3121 CREATE TABLESPACE data file cannot be under the datadir. 82Error 1528 Failed to create TABLESPACE bad 83Error 1031 Table storage engine for 'bad' doesn't have this option 84CREATE TABLESPACE bad ADD DATAFILE '../does_not_exist/bad.ibd'; 85ERROR HY000: Incorrect File Name '../does_not_exist/bad.ibd'. 86SHOW WARNINGS; 87Level Code Message 88Error 3121 Incorrect File Name '../does_not_exist/bad.ibd'. 89Error 3121 The directory does not exist. 90Error 1528 Failed to create TABLESPACE bad 91Error 1031 Table storage engine for 'bad' doesn't have this option 92# 93# Try a series of valid relative ADD DATAFILE entries. 94# General tablespace files can be in the datadir but they cannot be under the datadir. 95# 96CREATE TABLESPACE ibport_s01 ADD DATAFILE 'ibport_s01.ibd'; 97CREATE TABLESPACE ibport_s02 ADD DATAFILE './ibport_s02.ibd'; 98CREATE TABLESPACE ibport_s03 ADD DATAFILE '../data/ibport_s03.ibd'; 99CREATE TABLESPACE ibport_s04 ADD DATAFILE 'test/../ibport_s04.ibd'; 100CREATE TABLESPACE ibport_s05 ADD DATAFILE './test/../ibport_s05.ibd'; 101CREATE TABLESPACE ibport_s06 ADD DATAFILE '..///data//test///..//ibport_s06.ibd'; 102CREATE TABLESPACE ibport_s12 ADD DATAFILE './/ibport_s12.ibd'; 103CREATE TABLESPACE ibport_s13 ADD DATAFILE '..//data//ibport_s13.ibd'; 104CREATE TABLESPACE ibport_s14 ADD DATAFILE 'test//..//ibport_s14.ibd'; 105CREATE TABLESPACE ibport_s15 ADD DATAFILE './/test//..//ibport_s15.ibd'; 106CREATE TABLESPACE ibport_s16 ADD DATAFILE '..//////data////test//////..////ibport_s16.ibd'; 107# Directory listing of MYSQLD_DATADIR/ ibport* 108ibport_s01.ibd 109ibport_s02.ibd 110ibport_s03.ibd 111ibport_s04.ibd 112ibport_s05.ibd 113ibport_s06.ibd 114ibport_s12.ibd 115ibport_s13.ibd 116ibport_s14.ibd 117ibport_s15.ibd 118ibport_s16.ibd 119SELECT s.space_type 'Type', s.name 'Space Name', d.path 'Path' 120 FROM information_schema.innodb_sys_tablespaces s, information_schema.innodb_sys_datafiles d 121WHERE s.name like '%ibport%' AND s.space = d.space ORDER BY s.space; 122Type Space Name Path 123General ibport_s01 MYSQLD_DATADIR/ibport_s01.ibd 124General ibport_s02 MYSQLD_DATADIR/./ibport_s02.ibd 125General ibport_s03 MYSQLD_DATADIR/../data/ibport_s03.ibd 126General ibport_s04 MYSQLD_DATADIR/test/../ibport_s04.ibd 127General ibport_s05 MYSQLD_DATADIR/./test/../ibport_s05.ibd 128General ibport_s06 MYSQLD_DATADIR/..///data//test///..//ibport_s06.ibd 129General ibport_s12 MYSQLD_DATADIR/.//ibport_s12.ibd 130General ibport_s13 MYSQLD_DATADIR/..//data//ibport_s13.ibd 131General ibport_s14 MYSQLD_DATADIR/test//..//ibport_s14.ibd 132General ibport_s15 MYSQLD_DATADIR/.//test//..//ibport_s15.ibd 133General ibport_s16 MYSQLD_DATADIR/..//////data////test//////..////ibport_s16.ibd 134SELECT s.space_type 'Type', s.name 'Space Name', f.file_name 'Path' 135 FROM information_schema.innodb_sys_tablespaces s, information_schema.files f 136WHERE s.name like '%ibport%' AND s.space = f.file_id ORDER BY s.space; 137Type Space Name Path 138General ibport_s01 MYSQLD_DATADIR/ibport_s01.ibd 139General ibport_s02 MYSQLD_DATADIR/./ibport_s02.ibd 140General ibport_s03 MYSQLD_DATADIR/../data/ibport_s03.ibd 141General ibport_s04 MYSQLD_DATADIR/test/../ibport_s04.ibd 142General ibport_s05 MYSQLD_DATADIR/./test/../ibport_s05.ibd 143General ibport_s06 MYSQLD_DATADIR/..///data//test///..//ibport_s06.ibd 144General ibport_s12 MYSQLD_DATADIR/.//ibport_s12.ibd 145General ibport_s13 MYSQLD_DATADIR/..//data//ibport_s13.ibd 146General ibport_s14 MYSQLD_DATADIR/test//..//ibport_s14.ibd 147General ibport_s15 MYSQLD_DATADIR/.//test//..//ibport_s15.ibd 148General ibport_s16 MYSQLD_DATADIR/..//////data////test//////..////ibport_s16.ibd 149DROP TABLESPACE ibport_s01; 150DROP TABLESPACE ibport_s02; 151DROP TABLESPACE ibport_s03; 152DROP TABLESPACE ibport_s04; 153DROP TABLESPACE ibport_s05; 154DROP TABLESPACE ibport_s06; 155DROP TABLESPACE ibport_s12; 156DROP TABLESPACE ibport_s13; 157DROP TABLESPACE ibport_s14; 158DROP TABLESPACE ibport_s15; 159DROP TABLESPACE ibport_s16; 160