I was seeing a very strange issue where restores of mysqldump backups would fail to correctly restore two specific rows in the notifications table, causing the delivery column to become corrupted.
After extensive testing spanning multiple days, I found two ways to avoid the problem:
- This fix, wherein we limit the number of rows in each INSERT.
- Deleting the SET FOREIGN_KEY_CHECKS=0 line that gets automatically inserted at the top of the backup file by mysqldump.
I can't tell why the second option works and there's no way to configure mysqldump to prevent it from spitting out that line. We can remove it after-the-fact but that would be more work.
On the other hand, this solution is simple and "just works".