Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
mysqldump doesn't have an option for check_constraint_checks on tables that implement a constraint check. That makes it impossible to restore tables completely when the table has invalid data in it and check_constraint_checks was turned off when the constraint was implemented.
For example,
SET @@session.check_constraint_checks = 0 ; |
ALTER TABLE foo ADD CONSTRAINT json_valid_bar CHECK(JSON_VALID(bar)); |
... is run with a few rows of known bad data in it then a mysqldump is run, it's not possible to do a full restore without mangling the backup. If mysqldump had --check-constraint-checks=0 as an option, we could tell the dump to put SET @@SESSION.CHECK_CONSTRAINT_CHECKS = 0 in it on tables that have a constraint on them or for the entire backup... You get the idea.