[MDEV-32951] Move duplicates from trx_t to cursor Created: 2023-12-05  Updated: 2024-01-29

Status: In Progress
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5, 10.6, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4
Fix Version/s: 10.5, 10.6, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6

Type: Bug Priority: Critical
Reporter: Vladislav Lesin Assignee: Vladislav Lesin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-17814 Server crashes in is_current_stmt_bin... Open

 Description   

CREATE TABLE ... REPLACE SELECT ... set flag on trx object
indicating that REPLACE behaviour was requested, but did not
clear the flag before updating dependent VIEWs, which caused
INSERT to mysql/columns to be carried as if it was REPLACE,
in particular to use wrong kind of row locks.

The root cause is that flags were stored on trx object, instead
of keeping them local to the scope of particular
query thread/table handle/iterator/prebuilt struct.

See also the following commit in MySQL:

commit 6b83b56b09445843a7c3bdc6cf6b83df2b0fa040
Author: Jakub Łopuszański <jakub.lopuszanski@oracle.com>
Date:   Thu May 16 14:19:58 2019 +0200
 
    Bug #28523025   INNODB: ASSERTION FAILURE: LOCK0LOCK.CC:1468:LOCK_REC_GET_REC_NOT_GAP(LOCK)

commit 58d2400343656cf82ff5fbb6680beaf46f5de974
Author: Jakub Łopuszański <jakub.lopuszanski@oracle.com>
Date:   Tue May 14 09:56:17 2019 +0200
 
    Bug #29004362   LOCK->TRX->DUPLICATES CAN NOT BE USED TO DETERMINE IF LOCK IS CREATED BY IODKU

commit 2bb0216eec4386d6d3338a5f6784005044711118
Author: Marc Alff <marc.alff@oracle.com>
Date:   Tue Sep 13 16:04:54 2016 +0200
 
    WL#6657 PERFORMANCE_SCHEMA LOCK_DATA


Generated at Thu Feb 08 10:35:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.