[MDEV-26783] System-versioned table writes historical rows on update without any changed data Created: 2021-10-07 Updated: 2023-09-08 Resolved: 2021-10-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.5.9 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Lucas Krause | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
When updating a row in a system-versioned table and updating a column's value with the exact current value, a new historical row is written, that has the same ROW_START value as well as the same value for any other column as the previous one, while a ON UPDATE CURRENT_TIMESTAMP() column is not updated on the current row. I also experienced that issue to not exist when updating a ENUM column with the exact current value, while existing when updating a INT column with the exact current value. However, in the example below the columns all behave the same.
SELECT *, ROW_START, ROW_END FROM Foobar FOR SYSTEM_TIME AS OF '<row_start_value>' WHERE id = 1 will also return 3 rows, while I would expect only 1. I would expect that a historical row is only written when data in the row really change, just like a ON UPDATE column behaves. |
| Comments |
| Comment by Alice Sherepa [ 2021-10-07 ] | |||||||||||||||||||||||
|
Thank you for reporting the issue! The decision to insert the historical row even if the row has not changed was intentional ( I also tried with enum type, the bug was also reproducible:
|