[MDEV-33329] ALTER TABLE...FORCE fails to recalculate generated stored columns Created: 2024-01-30 Updated: 2024-01-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4 |
| Fix Version/s: | 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | repair | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
monty pointed out that when there are generated stored columns that might have been miscalculated due to an earlier bug, the statement
would fail to correctly recalculate the generated stored columns. I do not know a specific example of such a bug, but I think that the concern is plausible. The idea is that we would want the following outcome:
However, I do not know if this is a good idea. Maybe bugs related to stored generated columns are rare enough that it is enough that the user can explicitly specify ALGORITHM=COPY. Maybe a better idea would be to introduce a REPAIR option to ALTER TABLE. This option would be mostly like FORCE, but it would instruct InnoDB to refuse a native rebuild in this particular case, as well as in some other column conversions that might not be representable by setting the ALTER_COLUMN_STORAGE_TYPE flag:
|
| Comments |
| Comment by Marko Mäkelä [ 2024-01-30 ] |
|
MDEV-33087, which is currently targeting MariaDB Server 10.11, would fix some inefficiency of ALTER TABLE…ALGORITHM=COPY. It would still not be executed online until MariaDB Server 11.2 (which includes |