[MDEV-15990] REPLACE on a precise-versioned table returns duplicate key error (ER_DUP_ENTRY) Created: 2018-04-23 Updated: 2023-11-28 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Nikita Malyavin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Test case from the description of
Same for stored functions and probably for triggers. |
| Comments |
| Comment by Nikita Malyavin [ 2018-07-06 ] | |||||||||||||||||||||||||||||||||||||||||
|
replace fails even more with trx_id:
Inserting same record twice damages row_start | |||||||||||||||||||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2018-07-10 ] | |||||||||||||||||||||||||||||||||||||||||
|
timestamp-versioned table inserts extra field, when no versioned fields changed
// UPD actually that's correct behavior, `trx_id` should be fixed instead | |||||||||||||||||||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2019-02-28 ] | |||||||||||||||||||||||||||||||||||||||||
|
row_start spoiling is related to | |||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings [ 2022-10-28 ] | |||||||||||||||||||||||||||||||||||||||||
|
nikitamalyavin can this and the current open PR be closed then? | |||||||||||||||||||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2022-11-02 ] | |||||||||||||||||||||||||||||||||||||||||
|
TheLinuxJedi I have to revisit this task, to answer precisely, but I think no. Given the discussion on mail: It still had to be reviewed. But I'll better make sure, and update the patch to the latest branch version first. Thanks for bumping. | |||||||||||||||||||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2022-11-02 ] | |||||||||||||||||||||||||||||||||||||||||
|
Rising the priority to make it more visible next time | |||||||||||||||||||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2022-12-12 ] | |||||||||||||||||||||||||||||||||||||||||
|
Last discussion was here:https://lists.launchpad.net/maria-developers/msg13241.html | |||||||||||||||||||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2022-12-15 ] | |||||||||||||||||||||||||||||||||||||||||
|
I have reworked the fix completely. The behavior should be identical to the following:
That is, a versioned REPLACE may delete a row with a same row_start several times. Second delete would result in a duplicated row error, which would break transactional versioning workflow (already fixed in By definition, a versioned row delete is a normal row delete + insert of a historical row. That is, a historical row, is a row from a previous transaction/timestamp. Also such (duplicated) history row would end up with row_start=row_end, which should not happen. For a spontaneously set row_start it means, that deletion goes in history modification mode, i.e.: The new fix is available here: A change in delete.result demonstrates, that a new fix produces a better history, without faulty history rows. The new patch also removes versioning processing from the optimized code path (a.k.a no triggers, no referenced tables, etc). |