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

CHECK constraints appears with unquoted names in SHOW CREATE TABLE

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.2.1
    • 10.2.3
    • OTHER
    • None

    Description

      When doing s SHOW TABLE on a tables with CHECK constraints, any names in the CHECK constraint appears unquoted, in difference to other names and constraints and also to the actual CHECK constraint name, this issue is only about the actual content of the check constraint:

      DROP TABLE IF EXISTS foo2;
      DROP TABLE IF EXISTS foo1;
       
      CREATE TABLE foo1(bar INT NOT NULL PRIMARY KEY);
      CREATE TABLE foo2(bar INT,
        FOREIGN KEY(bar) REFERENCES foo1(bar),
        CHECK(bar > 1));
       
      SHOW CREATE TABLE foo2;
      CREATE TABLE `foo2` (
        `bar` int(11) DEFAULT NULL,
        KEY `bar` (`bar`),
        CONSTRAINT `foo2_ibfk_1` FOREIGN KEY (`bar`) REFERENCES `foo1` (`bar`),
        CONSTRAINT `CONSTRAINT_1` CHECK (bar > 1)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            karlsson Anders Karlsson
            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.