Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30168

mysqldump doesn't have an option for check_constraint_checks

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • Backup
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kbcmdba KB Benton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.