[MDEV-23100] ODKU of non-versioning column inserts history row Created: 2020-07-06 Updated: 2023-09-11 Resolved: 2023-07-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.4.12 |
| Fix Version/s: | 10.4.31, 10.11, 10.5.22, 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.0.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | BlueT - Matthew Lien | Assignee: | Aleksey Midenkov |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
10.4.12-MariaDB-1:10.4.12+maria~bionic |
||
| Issue Links: |
|
||||||||||||
| Description |
Reproduce
Result
ExpectedNo history rows inserted.
NotesWhen enable versioning (timestamp) for whole table except one column, using upsert (insert ... on duplicate update) to update the unversioning column, will still create new version records. How to reproduce: https://hackmd.io/WNz_xg9pRYiQrL69QkufrQ A workaround is to use txrid (transaction id) based versioning, but it doesn't support partitions to separate current and historic data, still. |
| Comments |
| Comment by BlueT - Matthew Lien [ 2020-07-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||
DescriptionWith versioned table (timestamp based) including one non-versioned column, using upsert (insert … on duplicate update) to update the unversioning column will still create new version records, which shouldn't. EnvironmentDocker image from docker hub > Server version: 10.4.12-MariaDB-1:10.4.12+maria~bionic ReproduceCreate versioned tableCreate in 3 different ways, inclusive, exclusive, and set by each column.
UpsertUpsert with `insert on duplicate key update`. The 2nd and 3rd SQL query for each table are doing UPDATE to non-versioned column.
OutputThere should be only 1 version, but we see 3 instead.
https://i.imgur.com/Tsl95of.png Simple UPDATE works fine
https://i.imgur.com/uPe4lWJ.png > With `on duplicate key update`, Replace?
https://i.imgur.com/u44RWBX.png
| ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2023-07-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
According to
| ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2023-07-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
Following same logic of | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2023-07-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
Please review bb-10.4-midenok | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nikita Malyavin [ 2023-07-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
ok to push | ||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2023-07-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||
|
10.4.31 10.5.22 10.6.15 10.9.8 10.10.6 10.11.5 11.0.3 11.1.2 11.2.1 |