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

better error reporting when FOREIGN KEY CONSTRAINT fails

Details

    Description

      We frequently run into a problem where our customers are importing a few thousand records (which we do as a few INSERT statements with maybe 250 rows in a VALUE clause). The problem is that often the file has an issue and we get an error, but tracking down what row is bad is a long process.

      A typical error we might receive now looks like this:

      Cannot add or update a child row: a foreign key constraint fails (`db11234`.`Campaign_Contacts`, CONSTRAINT `Campaign_Contacts_ibfk_1` FOREIGN KEY (`Party_ID`) REFERENCES `Parties` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE)
      

      It would be SOOOOOO helpful if that error message included something like "for value 123456" so we know which value is causing the problem.

      Thank you.

      Attachments

        Issue Links

          People

            jplindst Jan Lindström (Inactive)
            rdyas Robert Dyas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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