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

FK errors are hidden behind an obscure command

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.4(EOL)
    • None

    Description

      Whenever creating a foreign key fails, the server reports something like

      1005: Can't create table test.t3 (errno: 150 "Foreign key constraint is incorrectly formed")
      

      which is not very informative. One can get a much better understanding of an error by issuing SHOW ENGINE INNODB STATUS, if one knows to do it.

      But one shouldn't be required to. The error information should be returned when an error happens. For example, InnoDB could return a warning with, say, "There is no index in the referenced table where the referenced columns appear as the first columns" (may be slightly paraphrased, as appropriate for a warning message).

      It could still do its SHOW ENGINE INNODB STATUS, but returning a warning goes a long way towards helping users to understand the problem

      Attachments

        Issue Links

          Activity

            serg Sergei Golubchik created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value

            I think that this should be addressed as part of MDEV-16417.

            If ALTER TABLE is using the native algorithm (not ALGORITHM=COPY), then better messages could already be reported. But, until MDEV-16356 is fixed, ADD FOREIGN KEY will require ALGORITHM=COPY unless SET foreign_key_checks=0 is in effect.

            marko Marko Mäkelä added a comment - I think that this should be addressed as part of MDEV-16417 . If ALTER TABLE is using the native algorithm (not ALGORITHM=COPY ), then better messages could already be reported. But, until MDEV-16356 is fixed, ADD FOREIGN KEY will require ALGORITHM=COPY unless SET foreign_key_checks=0 is in effect.
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 96699 ] MariaDB v4 [ 141287 ]

            People

              marko Marko Mäkelä
              serg Sergei Golubchik
              Votes:
              1 Vote for this issue
              Watchers:
              3 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.