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

Changing column case, does not update constraint case

    XMLWordPrintable

Details

    Description

      Create tables s_order_documents and s_order_documents_attributes using this SQL

      DROP TABLE IF EXISTS `s_order_documents`;
      CREATE TABLE IF NOT EXISTS `s_order_documents` (
        `ID` int(11) NOT NULL AUTO_INCREMENT,
        `date` date NOT NULL,
        `type` int(11) NOT NULL,
        `userID` int(11) NOT NULL,
        `orderID` int(11) unsigned NOT NULL,
        `amount` double NOT NULL,
        `docID` int(11) NOT NULL,
        `hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
        PRIMARY KEY (`ID`),
        KEY `orderID` (`orderID`),
        KEY `userID` (`userID`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
       
      -- --------------------------------------------------------
       
      --
      -- Tabellenstruktur für Tabelle `s_order_documents_attributes`
      --
       
      DROP TABLE IF EXISTS `s_order_documents_attributes`;
      CREATE TABLE IF NOT EXISTS `s_order_documents_attributes` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `documentID` int(11) DEFAULT NULL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `documentID` (`documentID`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
       
      ALTER TABLE `s_order_documents_attributes`
        ADD CONSTRAINT `s_order_documents_attributes_ibfk_1` FOREIGN KEY (`documentID`) REFERENCES `s_order_documents` (`ID`) ON DELETE CASCADE ON UPDATE NO ACTION;
      

      Execute in a another Connection:

      ALTER TABLE `s_order_documents_attributes` DROP FOREIGN KEY `s_order_documents_attributes_ibfk_1`;
      ALTER TABLE `s_order_documents` CHANGE COLUMN `ID` `id` INT(11) NOT NULL AUTO_INCREMENT FIRST;
       
      ALTER TABLE `s_order_documents_attributes` ADD CONSTRAINT `s_order_documents_attributes_ibfk_1` FOREIGN KEY (`documentID`) REFERENCES `s_order_documents` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE;
      

      Execute

      SHOW CREATE TABLE s_order_documents_attributes;
      

      and it still shows id in uppercase ( CONSTRAINT `s_order_documents_attributes_ibfk_1` FOREIGN KEY (`documentID`) REFERENCES `s_order_documents` (`ID`)).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shyim Soner Sayakci
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.