[MDEV-21296] Data corruption after DROP COLUMN on InnoDB tables with char primary key Created: 2019-12-12 Updated: 2019-12-12 Resolved: 2019-12-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.4.10 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Dominik Leibenger | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
10.4.10-MariaDB-log - mariadb.org binary distribution on Windows 10 (1909) |
||
| Issue Links: |
|
||||||||
| Description |
|
When an InnoDB table has a char field with a UTF8 collation which is set as primary key, dropping a column seems to cause data corruption. The problem can be reproduced on a fresh database by executing the following queries:
The altered table keeps working fine until the MariaDB server is restarted. But after restart, attempts to access the table result in the following error: #1932 - Table 'test.example' doesn't exist in engine mysql_error.log excerpt: 2019-12-12 1:19:55 25 [ERROR] InnoDB: Table `test`.`example` contains unrecognizable instant ALTER metadata The problem seems to occur only if the data type of the primary key column is char and only for certain collations (utf8mb4_bin, utf8_bin, utf8_unicode_ci, ...), but for any lengths. The data type of the column that is dropped does not seem to matter. I presume this bug is related to the alter algorithm: It occurs with DEFAULT, INPLACE, NOCOPY and INSTANT, but not with COPY, i.e., the problem can be avoided by executing
before running the ALTER query. If the table has already been altered but the MariaDB server has not yet been restarted, recreating the table via
seems to prevent the mentioned data corruption. |
| Comments |
| Comment by Alice Sherepa [ 2019-12-12 ] |
|
Thanks for the report! It is the same bug as |