Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6
Description
To reproduce, please specify
--mariadbd=--innodb_evict_tables_on_commit_debug
|
--source include/have_debug_sync.inc
|
--source include/have_innodb.inc
|
|
create table t1 (a int, key(a), b int) engine=innodb; |
create table t2 (a int key references t1(a), b int) engine=innodb; |
insert t1 values (1, 1); |
insert t2 values (1, 1); |
set autocommit =0; |
|
|
--connect purge, localhost, root
|
BACKUP STAGE start;
|
--connection default
|
|
begin; |
update t1 set b = b + 1; |
# Commenting this makes the test pass
|
update t2 set b = b + 1; |
|
--connect bug, localhost, root
|
set debug_sync="open_tables_after_open_and_process_table signal open wait_for go"; |
send
|
update t1 set a = a + 1; |
|
--connection purge
|
BACKUP STAGE block_commit;
|
|
BACKUP STAGE END; |
|
--connection default
|
set debug_sync="now wait_for open"; |
commit; |
set debug_sync="now signal go"; |
--connection bug
|
--error ER_ROW_IS_REFERENCED_2
|
reap;
|
--connection default
|
|
|
# Cleanup
|
set debug_sync= reset; |
drop table t2, t1; |
Actual result, rev. 505da21e3 |
mysqltest: At line 36: query 'reap' succeeded - should have failed with error ER_ROW_IS_REFERENCED_2 (1451)...
|
Another suitable alternative to BACKUP STAGE can be FLUSH TABLES.
The table affected by a transaction is removed on COMMIT in lock_release().
Then it is removed from all {{referenced_set}}s in dict_sys_t::remove().
The trick is to make t2 reference count = 0, and leave t1 reference count != 0.
So t1 was opened for write, but t2 is going to be opened soon by prelocking,
so sync point is added right after t1 was opened.
Attachments
Issue Links
- causes
-
MDEV-30869 Failing assertion: rec == NULL || !(data[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG)
- Open
- relates to
-
MDEV-29181 Potential corruption on Foreign key update on a table with vcol index
- Stalled
-
MDEV-30103 FK constraint fails upon referenced table eviction
- Stalled