Subject: | Updates trigger foreign key deletions when using MySQL. |
"REPLACE INTO" is used in MySQL for both INSERTs and UPDATES.
Unfortunately, REPLACE INTO doesn't update. Instead it DELETEs and then
INSERTs.
This triggers foreign key constraints. By default, the updates just
fail. If your foreign keys have an ON DELETE CASCADE clause, you will
have unexpected data loss. (That's why I put this as "critical". Feel
free to lower if you disagree.)
If Class::PObject::Driver::mysql::_prepare_insert() used "INSERT INTO
[....] ON DUPLICATE KEY UPDATE" instead, you should have the intended
behavior.