Note: In the following question you may see ? or blocks instead of characters, this is because you don't have the appropriate font. Please ignore this.
Background
I have a table with data structured as follows:
CREATE TABLE `decomposition_dup` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`structure` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`child` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `parent` (`parent`),
KEY `child` (`child`),
KEY `parent_2` (`parent`,`child`)
) ENGINE=InnoDB AUTO_INCREMENT=211929 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
And some example data:
INSERT INTO `decomposition_dup` (`id`, `parent`, `structure`, `child`) VALUES
(154647, '锦', 'a', '钅'),
(154648, '锦', 'a', '帛'),
(185775, '钅', 'd', '二'),
(185774, '钅', 'd', '㇟'),
(21195, '钅', 'd', '
If you want them to be the same, set the
COLLATION
of the columns toutf8mb4_unicode_ci
orutf8mb4_unicode_520_ci
.If you want them to be different, use
utf8mb4_general_ci
, instead:From what I can make out the problem lies within the SQL side of things upon research you'll see that this error code means that
so It might be the characters you are using within the cases of SQL