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

Improve foreign keys warnings/errors

Details

    • 5.5.45, 10.1.7-1

    Description

      Hi guys, we should check if this should be merged or not from mysql
      http://bugs.mysql.com/bug.php?id=73757

      probably a document bug, or maybe not, just check to don't leave dba searching were is the erro, include a "create table report errors at show warnings about foreign keys" or something like this

      Attachments

        Issue Links

          Activity

            Fix on 5.7 seems to me unsatisfactory :

            mysql> create table t2(a int, constraint a foreign key a (a) references t1(a))engine=innodb;
            ERROR 1215 (HY000): Cannot add foreign key constraint
            mysql> show warnings\G
            *************************** 1. row ***************************
              Level: Warning
               Code: 150
            Message: Create table 'test/t2' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns.

            This is unclear when there is more than one foreign key on table test/t2.

            jplindst Jan Lindström (Inactive) added a comment - Fix on 5.7 seems to me unsatisfactory : mysql> create table t2(a int, constraint a foreign key a (a) references t1(a))engine=innodb; ERROR 1215 (HY000): Cannot add foreign key constraint mysql> show warnings\G *************************** 1. row *************************** Level: Warning Code: 150 Message: Create table 'test/t2' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns. This is unclear when there is more than one foreign key on table test/t2.

            I can't change actual error messages on GA product. However, I can add additional or improved error messages to show warnings.

            jplindst Jan Lindström (Inactive) added a comment - I can't change actual error messages on GA product. However, I can add additional or improved error messages to show warnings.

            People

              jplindst Jan Lindström (Inactive)
              rspadim roberto spadim
              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.