Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6
-
None
Description
With the following sync point added:
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
|
--- a/storage/innobase/row/row0ins.cc (revision 05cd10b74cffe882d04c6dd3333ef0beec2b41c2)
|
+++ b/storage/innobase/row/row0ins.cc (date 1669546784733)
|
@@ -1944,6 +1944,7 @@
|
dict_table_t* referenced_table
|
= foreign->referenced_table;
|
|
+ DEBUG_SYNC_C("row_ins_check_fk_ref_table_loaded");
|
if (referenced_table == NULL) {
|
|
ref_table = dict_table_open_on_name( |
The following test fails to insert a row in a child table, however the opposite is expected:
--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); |
set autocommit =0; |
set global innodb_evict_tables_on_commit_debug=1; |
|
|
begin; |
insert t1 values (20000, 1); |
|
--connect bug, localhost, root
|
set debug_sync="row_ins_check_fk_ref_table_loaded signal open wait_for go"; |
send
|
insert t2 values(1,1); |
|
--connect purge, localhost, root
|
FLUSH TABLES;
|
|
--connection default
|
set debug_sync="now wait_for open"; |
commit; |
set debug_sync="now signal go"; |
--connection bug
|
reap;
|
--connection default
|
|
# Cleanup
|
set debug_sync= reset; |
drop table t2, t1; |
actual result, rev. 05cd10b74c |
mysqltest: At line 26: query 'reap' failed: ER_NO_REFERENCED_ROW_2 (1452):
|
Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT
|
`t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
|
The effect may be much more severe with real eviction, but I didn't succeed to simulate it with just innodb_evict_tables_on_commit_debug
Attachments
Issue Links
- is caused by
-
MDEV-22180 Planner opens unnecessary tables when updated table is referenced by foreign keys
- Closed
- relates to
-
MDEV-29181 Potential corruption on Foreign key update on a table with vcol index
- Stalled
-
MDEV-22180 Planner opens unnecessary tables when updated table is referenced by foreign keys
- Closed
-
MDEV-26217 Failing assertion: list.count > 0 in ut_list_remove or Assertion `lock->trx == this' failed in dberr_t trx_t::drop_table
- Closed
-
MDEV-30021 FK actions are ignored after tc_purge and COMMIT
- Stalled