Table Query:
CREATE TABLE `TESTING_TABLE` (
`ID` char(36) COLLATE utf8_bin NOT NULL,
`NAME` char(36) COLLATE utf8_bin NOT NULL,
`DISPLAY_NAME` varchar(128) COLLATE utf8_bin NOT NULL,
UNIQUE KEY `DISPLAY_NAME_UK` (`NAME`,`DISPLAY_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
First row insert:
INSERT INTO `TESTING_TABLE` (`ID`, `NAME`, `DISPLAY_NAME`) VALUES ('1', 'Foo', 'Bar');
Second row insert:
INSERT INTO `TESTING_TABLE` (`ID`, `NAME`, `DISPLAY_NAME`) VALUES ('2', 'Foo', 'bar');
As I have 'DISPLAY_NAME_UK' unique constraint, I expect the second row insert should throw a "Duplicate entry" exception. But it is allowing case sensitive values in DISPLAY_NAME column. How to make it case insensitive?