#
# Bug #23135731 / #81495 "InnoDB: Failing assertion: table in file dict0dict.ic line 220"
# fixed in 5.5.50, 5.6.31, 5.7.13
# INSERT with ON DUPLICATE KEY UPDATE and REPLACE on a table with a foreign key
# constraint defined failed with an incorrect duplicate entry error rather than
# a foreign key constraint violation error.
#
--source include/have_innodb.inc

CREATE TABLE t1(c INT,PRIMARY KEY (c)) Engine=InnoDB;
INSERT IGNORE INTO t1 VALUES(),(),();
DROP TABLE t1;

CREATE TABLE t1(
  i INT KEY,
  t1i INT,
  FOREIGN KEY (t1i) REFERENCES t1(i)
) ENGINE=InnoDB;
--error ER_NO_REFERENCED_ROW_2
REPLACE INTO t1 VALUES(3,4);
DROP TABLE t1;
