[MDEV-23741] InnoDB: Table ... contains <n> indexes inside InnoDB, which is different from the number of indexes <n> defined in the MariaDB Created: 2020-09-16 Updated: 2021-04-19 Resolved: 2020-09-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Platform Windows |
| Affects Version/s: | 10.3.18 |
| Fix Version/s: | 10.3.26, 10.4.16, 10.5.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Allen Lee (Inactive) | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows server 2012 |
||
| Issue Links: |
|
||||||||
| Description |
|
Customer reported the following error when running alter table <x> add index.
this is exactly like
|
| Comments |
| Comment by Marko Mäkelä [ 2020-09-16 ] | |||||||||||||
|
allen.lee@mariadb.com, I tried but failed to repeat this on GNU/Linux with the following test case:
On Windows, the chmod may have to be replaced with something compatible. For me, it fails as follows:
I also tried with the described version:
It could be that this bug only affects the Windows platform, which I did not use. I suspect that what happens is the following:
| |||||||||||||
| Comment by Marko Mäkelä [ 2020-09-16 ] | |||||||||||||
|
I believe that this failure scenario is specific to Windows. On Windows, apparently making a file read-only will prevent renaming. But, the .frm file would only be renamed after the ALTER TABLE operation was already committed inside the storage engine. I think that this failure scenario should be considered in | |||||||||||||
| Comment by Vladislav Vaintroub [ 2020-09-17 ] | |||||||||||||
|
The fix I'm providing is merely a workaround. my_rename will do a couple of retries if file to be renamed is in use. For a better solution, we'd need atomic DDL. |