Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.4.18, 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
CentOS 7
Description
Starting MariaDB server version 10.4.18 some SQL updates on the transaction precise versioned table fail.
100% reproducible with v10.4.18 and 10.4.19, see example below and detailed log in attachment v18_mariadb.log.
Attached also the same SQL commands executed against version 10.4.17 where everything works fine - v17_mariadb.log, as well as server errorlog - did not spot anything special in there.
Example:
create or replace table xxx (nid int, nstate int, ntype int, primary key(nid) ); |
|
alter table xxx add tx_start BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE, add tx_end BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE, add PERIOD FOR SYSTEM_TIME(tx_start, tx_end), add SYSTEM VERSIONING; |
|
insert into xxx values (1,1,1); |
Query OK, 1 row affected (0.003 sec)
|
|
select nid, nstate, tx_start, tx_end from xxx for system_time all where nid=1; |
+-----+--------+----------+----------------------+ |
| nid | nstate | tx_start | tx_end |
|
+-----+--------+----------+----------------------+ |
| 1 | 1 | 189558 | 18446744073709551615 |
|
+-----+--------+----------+----------------------+ |
1 row in set (0.000 sec) |
|
start transaction; |
Query OK, 0 rows affected (0.000 sec) |
|
update xxx set nstate=nstate where nid=1; |
Query OK, 0 rows affected (0.001 sec) |
Rows matched: 1 Changed: 0 Warnings: 0 |
|
select nid, nstate, tx_start, tx_end from xxx for system_time all where nid=1; |
+-----+--------+----------+----------------------+ |
| nid | nstate | tx_start | tx_end |
|
+-----+--------+----------+----------------------+ |
| 1 | 1 | 189558 | 189561 |
|
| 1 | 1 | 189558 | 18446744073709551615 |
|
+-----+--------+----------+----------------------+ |
2 rows in set (0.001 sec) |
|
update xxx set nstate=3 where nid=1; |
ERROR 1761 (23000): Foreign key constraint for table 'xxx', record '1-18446744073709551615' would lead to a duplicate entry in table 'xxx', key 'PRIMARY' |
Attachments
Issue Links
- is caused by
-
MDEV-23446 UPDATE does not insert history row if the row is not changed
- Closed
- relates to
-
MDEV-29813 REPLACE/IGNORE does not work with historical records in InnoDB
- Closed
-
MDEV-32221 SIGSEGV in ha_innobase::update_row, UBSAN: member access within null pointer of type 'struct TABLE_LIST'
- Confirmed
-
MDEV-29723 ROW START not always set correctly in transaction-precise tables
- Open
-
MDEV-30701 row_start not set properly when updating field without system versioning using on duplicate key update
- Open