[MDEV-14837] Duplicate primary keys are allowed after ADD COLUMN / UPDATE Created: 2018-01-01 Updated: 2018-01-15 Resolved: 2018-01-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 10.3.2 |
| Fix Version/s: | 10.3.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | instant, regression | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
The test fails on INSERT, because it actually succeeds instead of producing the expected ER_DUP_ENTRY. |
| Comments |
| Comment by Marko Mäkelä [ 2018-01-09 ] | ||||||||||
|
The bug does not seem to affect ROW_FORMAT=REDUNDANT tables or PRIMARY KEY on fixed-length columns. VARCHAR(1) is the simplest key with which I reproduced the corruption. | ||||||||||
| Comment by Marko Mäkelä [ 2018-01-09 ] | ||||||||||
|
The condition in the function row_ins_clust_index_entry_low() to check for duplicates fails to hold, because up_match=low_match=0:
The bug is that the length of the PRIMARY KEY column is being read from the wrong offset here:
If I manually set nulls-- then the correct length will be returned and the duplicate will be returned. |