[MDEV-5309] RENAME TABLE does not check for existence of the table's engine Created: 2013-11-19 Updated: 2015-06-17 Resolved: 2015-06-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugins |
| Affects Version/s: | 5.5.33a, 10.0.6 |
| Fix Version/s: | 10.0.20 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | upstream | ||
| Sprint: | 10.0.20 |
| Description |
|
When RENAME TABLE is executed, it apparently does not check whether the engine is available (unlike ALTER TABLE .. RENAME, which does). It means that if the engine in question was not loaded on some reason, the table might become unusable, since the engine won't know about the change. It was an upstream bug, which existed in previous versions as well, but it seems to be fixed in 5.7. Given how many engines we have and how easy it is to get this problem accidentally, maybe it makes sense to consider backporting the fix into 10.0. The test case below uses InnoDB to be universal for MariaDB and MySQL, so it looks a bit of a stretch. In reality, I encountered the problem with TokuDB, and it was really just a human error:
Test case:
Fixing it is not that easy, simple reverse rename does not work, you have to repeat the whole exercise – start server without the engine, rename the table back, start server with the engine... |
| Comments |
| Comment by Sergey Vojtovich [ 2015-02-09 ] | |||||||
|
The problem is around since 2004. I can guess that it wasn't really intentional.
| |||||||
| Comment by Sergey Vojtovich [ 2015-02-09 ] | |||||||
|
serg, please review fix for this bug. | |||||||
| Comment by Sergey Vojtovich [ 2015-06-15 ] | |||||||
|
serg, please review updated fix. |