I have an InnoDB table with VARCHAR(250) cp1251_general_ci field named comment
.
I'm trying to search on this field, case sentative.
SELECT comment
FROM body_legend
WHERE comment LIKE '%ТТ%'
GROUP BY comment
works as expected, but its case insensitive.
I tried to use BINARY
like
SELECT comment
FROM body_legend
WHERE comment LIKE BINARY '%ТТ%'
GROUP BY comment`
it returns an empty result.
I tried to use COLLATE
like
SELECT comment
FROM body_legend
WHERE comment LIKE '%ТТ%' COLLATE cp1251_general_ci
it returns error
COLLATION 'cp1251_general_ci' is not valid for CHARACTER SET 'utf8mb4'
How to make search case sensitive? I would be glad if the answer is complemented by a description of why did not work my queries.