MySQL Forums
Forum List  »  Quality Assurance

Invisible UNIQUE index
Posted by: Martin Lechner
Date: February 14, 2018 07:07AM

(1.) Part of dump without data - One Table

DROP TABLE IF EXISTS `terminalconfiguration_crypto_configuration`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `terminalconfiguration_crypto_configuration` (
`tconfiguration_id` bigint(20) NOT NULL,
`cc_id` bigint(20) NOT NULL,
KEY `FKF428C11D7349287E` (`tconfiguration_id`),
KEY `FKF428C11DBDE83D1F` (`cc_id`),
CONSTRAINT `FK70pc36pkrt9x7lwvdf8796bcb` FOREIGN KEY (`tconfiguration_id`) REFERENCES `terminalconfiguration` (`id`),
CONSTRAINT `FKF428C11D7349287E` FOREIGN KEY (`tconfiguration_id`) REFERENCES `terminalconfiguration` (`id`),
CONSTRAINT `FKF428C11DBDE83D1F` FOREIGN KEY (`cc_id`) REFERENCES `tcryptoconfiguration` (`id`),
CONSTRAINT `FKm8d00sxnh9g09wqb05goi1dk2` FOREIGN KEY (`cc_id`) REFERENCES `tcryptoconfiguration` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


(2.) select * from information_schema.TABLE_CONSTRAINTS where table_name = 'terminalconfiguration_crypto_configuration' and constraint_type = 'UNIQUE';

(3.) Result of select (2):
CONSTRAINT CATALOG: def
CONSTRAINT_SCHEMA: batm
CONSTRAINT_NAME: UK_oux3v44rv2m0rtmgkrsknlv10
TABLE_SCHEMA: batm
TABLE_NAME: terminalconfiguration_crypto_configuration
CONSTRAINT_TYPE: UNIQUE

(4.) DROP INDEX `UK_oux3v44rv2m0rtmgkrsknlv10` ON `terminalconfiguration_crypto_configuration`;

(5.) Error of command (4):
Error: 1025, SQLState: HY000
Error on rename of './batm/#sql-4e5_4c' to './batm/terminalconfiguration_crypto_configuration' (errno: 150 - Foreign key constraint is incorrectly formed)

Encoding and engine are same in all tables (InnoDb, utf8). All PK IDs are bigint(20). It functions on many databases, but one our customer has this error. We cannot delete unique index and also it is not exported schema. How can I delete it? (Why is the index not in the exported schema?)

Options: ReplyQuote


Subject
Views
Written By
Posted
Invisible UNIQUE index
403
February 14, 2018 07:07AM
244
February 14, 2018 09:54AM
207
February 14, 2018 10:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.