I am trying to create an index, it always works for me but since version 10.6 it does not, I am using the following command CREATE OR REPLACE INDEX And it tells me that the entry is duplicated as follows ERROR:
ERROR DE SQL(102):Entrada dupliada '9' para la clave "tipodeopcion"
The error occurs when I try to add an index with the following command:
create OR REPLACE UNIQUE INDEX tipodeopcion on nueva.opciones (terminalid) USING BTREE;
Being the following table:
CREATE TABLE `opciones` (
`dato` MEDIUMBLOB NULL DEFAULT NULL,
`datobinario` TINYINT(1) NULL DEFAULT NULL,
`diayhora` DATETIME NULL DEFAULT NULL,
`numero` DECIMAL(11,2) NULL DEFAULT NULL,
`opciones` INT(12) NOT NULL AUTO_INCREMENT,
`texto` TEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
`tipodeopcion` VARCHAR(100) NOT NULL COLLATE 'utf8mb3_general_ci',
`tipop` INT(1) NOT NULL DEFAULT '0',
`terminalid` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`opciones`) USING BTREE,
INDEX `tipodeopcion2` (`tipodeopcion`) USING BTREE,
INDEX `terminalid` (`terminalid`) USING BTREE,
INDEX `opciones` (`opciones`) USING BTREE
)
COLLATE='utf8mb3_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=148
;
As you can see, what I want to add is an index that is unique for the optiontype and terminalid columns, called "optiontype", and it gives an error even with heidisql, when doing it by interface, why has the error happened to someone?