[MDEV-12968] ALTER IGNORE TABLE does not ignore duplicates as did in 10.1.23 Created: 2017-06-01 Updated: 2021-10-25 Resolved: 2021-10-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 10.2.6 |
| Fix Version/s: | 10.2.23, 10.3.14, 10.4.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Frank Sagurna | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu Linux 16.04 packages from mariadb repository |
||
| Description |
|
In mariadb 10.1.23 for removing duplicates you can do a
Duplicates for this unique key will get removed. So the "IGNORE" seems to be ... well ignored. |
| Comments |
| Comment by Frank Sagurna [ 2017-06-01 ] | |||||||||||
|
Did a little fiddle for test. Works there in mysql 5.6, no mariadb to choose: | |||||||||||
| Comment by Elena Stepanova [ 2017-06-05 ] | |||||||||||
|
Thanks for the report.
Unsetting sql_mode does not make a difference. marko, would you be able to shed some light on it? | |||||||||||
| Comment by Marko Mäkelä [ 2017-06-05 ] | |||||||||||
|
In MySQL 5.6 and presumably MariaDB 10.0 and 10.1, InnoDB refuses ALGORITHM=INPLACE if the IGNORE keyword is present, so that the ALGORITHM=COPY will take care of the IGNORE. The following piece of code takes care of this in MariaDB 10.1:
The above code was removed from MySQL 5.7 by WL#7395, which also deprecated the IGNORE keyword in MySQL 5.6. | |||||||||||
| Comment by Marko Mäkelä [ 2017-06-05 ] | |||||||||||
|
Jan, can you take care of this? As part of this effort, I think that we should import all the InnoDB ALTER TABLE tests from MySQL 5.6 and 5.7 to MariaDB 10.2 (or even 10.0), because many of these tests are currently missing. | |||||||||||
| Comment by Denis Malinovskiy [ 2018-11-14 ] | |||||||||||
|
As a temporary workaround, it's possible to run the original query adding "ALGORITHM=COPY":
| |||||||||||
| Comment by Marko Mäkelä [ 2021-10-25 ] | |||||||||||
|
It turns out that on a merge of
|