Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.2.2
-
None
-
Docker Image mariadb:10.3
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
- is duplicated by
-
MDEV-13671 InnoDB should use case-insensitive column name comparisons like the rest of the server
- Closed