1CREATE DATABASE test_jfg;
2CREATE DATABASE test_jfg2;
3CREATE TABLE test_jfg.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB;
4RENAME TABLE test_jfg.test TO test_jfg2.test;
5SELECT REPLACE(path,'\\','/') path
6FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%';
7path
8./test_jfg2/test.ibd
9DROP DATABASE test_jfg;
10# restart
11DROP DATABASE test_jfg2;
12CREATE DATABASE abc_def;
13CREATE DATABASE abc_def2;
14CREATE TABLE abc_def.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB;
15RENAME TABLE abc_def.test TO abc_def2.test1;
16SELECT REPLACE(path,'\\','/') path
17FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%';
18path
19./abc_def2/test1.ibd
20DROP DATABASE abc_def;
21# restart
22DROP DATABASE abc_def2;
23call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)");
24CREATE TABLE t1 (a INT) ENGINE=InnoDB;
25RENAME TABLE t1 TO non_existing_db.t1;
26ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: 168 "Unknown (generic) error from engine")
27FOUND 1 /\[ERROR\] InnoDB: Cannot rename file '.*t1\.ibd' to '.*non_existing_db/ in mysqld.1.err
28DROP TABLE t1;
29