Skip Menu |

This queue is for tickets about the Class-PObject CPAN distribution.

Report information
The Basics
Id: 17575
Status: new
Priority: 0/
Queue: Class-PObject

People
Owner: Nobody in particular
Requestors: cpan [...] thechaz.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.17
Fixed in: (no value)



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.