Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
-
None
Description
The following test succeeds, but shouldn't:
--source include/have_innodb.inc
|
|
CREATE TABLE t0 (pk integer primary key) WITH SYSTEM VERSIONING ENGINE=innodb ;
|
CREATE TABLE t1 (pk integer primary key REFERENCES t0(pk)
|
ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE=innodb ;
|
CREATE TABLE t2 (pk integer) ENGINE=innodb ;
|
|
INSERT INTO t0 (pk) VALUES (1) ;
|
INSERT INTO t1 (pk) VALUES (1) ;
|
INSERT INTO t2 (pk) VALUES (1) ;
|
# ALTER TABLE t1 ADD FOREIGN KEY (pk) ;
|
# FLUSH TABLES;
|
--error ER_ROW_IS_REFERENCED_2
|
DELETE FROM t0;
|
|
--echo # Succeeds!
|
REPLACE t0 values (1);
|
|
SELECT * FROM t0 INTO OUTFILE 'load_table1_innodb_int_autoinc';
|
--echo # Also succeeds!
|
LOAD DATA INFILE 'load_table1_innodb_int_autoinc' REPLACE INTO TABLE t0;
|
|
DELETE t0, t2 FROM t0 join t2;
|
select pk as `empty!` from t0;
|
|
|
DROP TABLE t1, t0, t2;
|
Here, the referential constraint forbids deleting. However, it succeeds for operations that do deletion, other than single-table delete
The expected behavior is: REPLACE, multi-DELETE and LOAD DATA...REPLACE fail with ER_ROW_IS_REFERENCED_2.
Attachments
Issue Links
- blocks
-
MDEV-29181 Potential corruption on Foreign key update on a table with vcol index
- Stalled
- relates to
-
MDEV-32221 SIGSEGV in ha_innobase::update_row, UBSAN: member access within null pointer of type 'struct TABLE_LIST'
- Confirmed