-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-12868 MySQL bug #84038 also affects MariaDB 10.2
Cherry-pick the commit from MySQL 5.7.19, and adapt the test case: commit 45c933ac19c73a3e9c756a87ee1ba18ba1ac564c Author: Aakanksha Verma <aakanksha.verma@oracle.com> Date: Tue Mar 21 10:31:43 2017 +0530 Bug #25189192 ERRORS WHEN RESTARTING MYSQL AFTER RENAME TABLE. PROBLEM While renaming table innodb doesn't update the InnoDB Dictionary table INNODB_SYS_DATAFILES incase there is change in database while doing rename table. Hence on a restart the server log shows error that it couldnt find table with old path before rename which has actually been renamed. So the errors would only vanish if we update the system tablespace FIX Update the innodb dictionary table with new path in the case there is not a change in the table but the database holding the table as well. Reviewed-by: Jimmy Yang<Jimmy.Yang@oracle.com> RB: 15751
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CREATE DATABASE test_jfg; | ||
CREATE DATABASE test_jfg2; | ||
CREATE TABLE test_jfg.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; | ||
RENAME TABLE test_jfg.test TO test_jfg2.test; | ||
SELECT REPLACE(path,'\\','/') path | ||
FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; | ||
path | ||
./test_jfg2/test.ibd | ||
DROP DATABASE test_jfg; | ||
DROP DATABASE test_jfg2; | ||
CREATE DATABASE abc_def; | ||
CREATE DATABASE abc_def2; | ||
CREATE TABLE abc_def.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; | ||
RENAME TABLE abc_def.test TO abc_def2.test1; | ||
SELECT REPLACE(path,'\\','/') path | ||
FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; | ||
path | ||
./abc_def2/test1.ibd | ||
DROP DATABASE abc_def; | ||
DROP DATABASE abc_def2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--innodb | ||
--innodb-sys-datafiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--source include/have_innodb.inc | ||
--source include/not_embedded.inc | ||
|
||
CREATE DATABASE test_jfg; | ||
CREATE DATABASE test_jfg2; | ||
CREATE TABLE test_jfg.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; | ||
RENAME TABLE test_jfg.test TO test_jfg2.test; | ||
|
||
SELECT REPLACE(path,'\\','/') path | ||
FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; | ||
|
||
DROP DATABASE test_jfg; | ||
|
||
--source include/restart_mysqld.inc | ||
|
||
DROP DATABASE test_jfg2; | ||
|
||
CREATE DATABASE abc_def; | ||
CREATE DATABASE abc_def2; | ||
|
||
CREATE TABLE abc_def.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; | ||
RENAME TABLE abc_def.test TO abc_def2.test1; | ||
|
||
SELECT REPLACE(path,'\\','/') path | ||
FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; | ||
|
||
DROP DATABASE abc_def; | ||
|
||
--source include/restart_mysqld.inc | ||
|
||
DROP DATABASE abc_def2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters