RENAME TABLE fails with "Table ... already exists" error with not existent table
Bug #1605000 reported by
Sveta Smirnova
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Triaged
|
Medium
|
Unassigned | |||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
Trying to verify bug #1597497 found this one.
Description:
RENAME TABLE fails with "Table ... already exists" error with not existent table
How to repeat:
show tables;
Tables_in_test
XK4P3A_
_product_
customer_profile
organisation
product_
mysqltest: At line 152: query 'RENAME TABLE `_product_
Test case will be attached.
tags: | added: upstream |
To post a comment you must log in.
For what it's worth, I reproduced (with PS 5.6.27) using MTR queries
...snip... ------- ------- ------- ------- ------- ------- ------- ------- ----+ ------- ------- ------- ------- ------- ------- ------- ------- ----+ B0ZCUC_ 4WXPFR_ MIDTE7_ BOA174_ IQJFXC_ 2AE81C_ HP6FVD_ 1OLDJ0_ K | instance_ new | specification | ------- ------- ------- ------- ------- ------- ------- ------- ----+
msandbox@localhost (empty) > SHOW TABLES;
+------
| Tables_in_empty |
+------
| XK4P3A_
| _product_
| customer_profile |
| organisation |
| product_
+------
5 rows in set (0.00 sec)
msandbox@localhost (empty) > SYSTEM ls -lha data/empty/; profile. frm profile. ibd instance_ new.frm instance_ new.ibd specification. frm specification. ibd B0ZCUC_ 4WXPFR_ MIDTE7_ BOA174_ IQJFXC_ 2AE81C_ HP6FVD_ 1OLDJ0_ K.frm B0ZCUC_ 4WXPFR_ MIDTE7_ BOA174_ IQJFXC_ 2AE81C_ HP6FVD_ 1OLDJ0_ K.ibd schema. innodb_ sys_tables WHERE name LIKE '%product_ instance% ' OR name LIKE '%XK4P3A%'; ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- +------ +------ --+---- ---+--- ------- ---+--- ------- --+---- ------- ----+ ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- +------ +------ --+---- ---+--- ------- ---+--- ------- --+---- ------- ----+ B0ZCUC_ 4WXPFR_ MIDTE7_ BOA174_ IQJFXC_ 2AE81C_ HP6FVD_ 1OLDJ0_ K | 1 | 20 | 200 | Antelope | Compact | 0 | product_ instance_ new | 1 | 21 | 197 | Antelope | Compact | 0 | instance_ new | 1 | 21 | 172 | Antelope | Compact | 0 | ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- +------ +------ --+---- ---+--- ------- ---+--- ------- --+---- ------- ----+
total 828K
drwx------ 2 marcos.albe percona 4.0K Jul 20 18:54 .
drwx------ 8 marcos.albe percona 4.0K Jul 20 18:54 ..
-rw-rw---- 1 marcos.albe percona 9.9K Jul 20 18:54 customer_
-rw-rw---- 1 marcos.albe percona 176K Jul 20 18:54 customer_
-rw-rw---- 1 marcos.albe percona 61 Jul 20 18:54 db.opt
-rw-rw---- 1 marcos.albe percona 9.3K Jul 20 18:54 organisation.frm
-rw-rw---- 1 marcos.albe percona 112K Jul 20 18:54 organisation.ibd
-rw-rw---- 1 marcos.albe percona 9.4K Jul 20 18:54 _product_
-rw-rw---- 1 marcos.albe percona 192K Jul 20 18:54 _product_
-rw-rw---- 1 marcos.albe percona 13K Jul 20 18:54 product_
-rw-rw---- 1 marcos.albe percona 96K Jul 20 18:54 product_
-rw-rw---- 1 marcos.albe percona 9.3K Jul 20 18:54 XK4P3A_
-rw-rw---- 1 marcos.albe percona 176K Jul 20 18:54 XK4P3A_
RDS: msandbox@localhost (empty) > SELECT * FROM information_
+------
| TABLE_ID | NAME | FLAG | N_COLS | SPACE | FILE_FORMAT | ROW_FORMAT | ZIP_PAGE_SIZE |
+------
| 228 | empty/XK4P3A_
| 225 | empty/_
| 200 | test/_product_
+------
3 rows in set (0.00 sec)
RDS: msandbox@localhost (empty) > RENAME TABLE `_product_ instance_ new` TO `product_instance`;
ERROR 1050 (42S01): Table './em...