[MDEV-30669] Changing the Data Type of a Column from Text to JSON causes a unexpected Table Rebuild Created: 2023-02-17 Updated: 2023-04-10 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.4, 10.6.11, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Michael Amadi | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
when attempting to change the Data type of an InnoDB table, from TEXT to JSON, given that they should be of the same storage format, we should not expect a table rebuild. However, using both ALGORITHM=INSTANT & INPLACE fails. only works with ALGORITHM=COPY (which the implicit ALGORITHM=DEFAULT would map to in this case). (P.S: Just a pointer to help, 10.4 already has fixed cases where changing the collation from utf8mb3 to utf8mb4 would not unnecessarily rebuild the table.) will attach test scenario to show this. |
| Comments |
| Comment by Marko Mäkelä [ 2023-02-17 ] | ||||||||
|
I can reproduce this with the following test. I would expect this to be performed as a schema-only change for any storage engine:
In | ||||||||
| Comment by Alexander Barkov [ 2023-03-24 ] | ||||||||
|
TEXT cannot be converted to JSON with a schema-only ALTER. | ||||||||
| Comment by Alexander Barkov [ 2023-03-24 ] | ||||||||
|
A better way to handle altering from TEXT to JSON will be possible after MDEV-16356 is done. |