MySQL cascade update failed when foreign key column referenced in composite primary key
问题 Unlike the similar other questions, I get error #1452 when updating the parent row. Why does it happen? Thank you in advance. Here are the relevant tables: CREATE TABLE IF NOT EXISTS `user` ( `username` VARCHAR(100) NOT NULL, `password` VARCHAR(200) NOT NULL, `name` VARCHAR(100), `surname` VARCHAR(100), `icon` BLOB, PRIMARY KEY (username) ); CREATE TABLE IF NOT EXISTS `document` ( `owner` VARCHAR(100) NOT NULL, `name` VARCHAR(100) NOT NULL, `sharing_link` VARCHAR(200) UNIQUE NOT NULL, PRIMARY