[MDEV-16288] ALTER TABLE…ALGORITHM=DEFAULT does not override alter_algorithm Created: 2018-05-25 Updated: 2020-05-04 Resolved: 2020-05-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 10.3.7 |
| Fix Version/s: | 10.3.23, 10.4.13 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Even if ALGORITHM=DEFAULT is explicitly specified in ALTER TABLE, the variable alter_algorithm will be substituted. That variable should only be substituted when no ALGORITHM has been specified.
|
| Comments |
| Comment by Marko Mäkelä [ 2018-09-19 ] | ||||||||||||||||
|
Another test case:
| ||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2020-04-23 ] | ||||||||||||||||
|
The following patch could solve the issue: mdev16288-10.3-61c0df94655f2dc3146456e49f3f51610251e79fv1.patch Please review it | ||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2020-04-23 ] | ||||||||||||||||
|
Patch is in bb-10.3- | ||||||||||||||||
| Comment by Alexander Barkov [ 2020-04-30 ] | ||||||||||||||||
|
Hi Thiru, The patch https://jira.mariadb.org/secure/attachment/51404/51404_mdev16288-10.3-61c0df94655f2dc3146456e49f3f51610251e79fv1.patch looks ok to push for me. I'd only like you to add the entire two test cases from this report into the patch. Thanks. | ||||||||||||||||
| Comment by Alexander Barkov [ 2020-04-30 ] | ||||||||||||||||
|
One more thought: I feel slightly non-comfortable with this code duplication:
Why not have a method:
? So you can use it in multiple points in the code, instead of duplicating the code. I suggest to let Alter_info::requested_algorithm stay ALTER_TABLE_ALGORITHM_NONE. Let's encapsulate to make sure that the caller do not test the member directly and uses the method only. | ||||||||||||||||
| Comment by Alexander Barkov [ 2020-04-30 ] | ||||||||||||||||
|
This patch is OK to push: |