Molecular Man
Molecular Man

Reputation: 22386

"SELECT" selects wrong rows when umlauts are present in table

The structure of table 'textconstraint' (collation utf8_general_ci) is as follows:

+-----+---------+
| id  | pattern |
+-----+---------+
|  11 | Ä       |
|  27 | A       |
+-----+---------+

When I query

SELECT * FROM textconstraint WHERE pattern = 'A' LIMIT 1;

The following rows are selected

+----+---------+
| id | pattern |
+----+---------+
| 11 | Ä       |
+----+---------+

Why A-umlaut is selected instead of A?

P.S. I do SET NAMES UTF8

Upvotes: 2

Views: 94

Answers (1)

fthiella
fthiella

Reputation: 49049

You can try this:

SELECT *
FROM textconstraint
WHERE pattern = BINARY 'A'

See this fiddle.

Upvotes: 1

Related Questions