[MDEV-32839] LONG UNIQUE gives error when used with REPLACE Created: 2023-11-19 Updated: 2023-12-12 Resolved: 2023-12-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert |
| Affects Version/s: | 10.5, 10.6, 10.11, 11.0, 11.1, 11.2 |
| Fix Version/s: | 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Michael Widenius | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
REPLACE with unique key works in some cases, not in other cases:
There are two bugs here: One can get the correct result by removing 'USING HASH' above:
|
| Comments |
| Comment by Sergei Golubchik [ 2023-11-29 ] | |||
|
The problem here is — auto-increment values are calculated very late, inside the engine, in ha_myisam::write_row() for example. But long uniques are checked by the server in handler::ha_write_row(), so if there's a long duplicate, ha_myisam::write_row() isn't called, auto-increment value isn't calculated and the following update fails. A proper fix would be, of course, to fill in auto-inc values earlier, but we cannot do it in an old GA version | |||
| Comment by Sergei Golubchik [ 2023-12-05 ] | |||
|
bar, please review commits
| |||
| Comment by Alexander Barkov [ 2023-12-06 ] | |||
|
serg, review comments sent by email: |