Topic: char_length neatitikimas
Trys simboliai 'abc', char_length teisingai nurodo, jog išties trys.
set @s = convert('abc' using utf8);
select length(@s), char_length(@s);
+------------+-----------------+
| length(@s) | char_length(@s) |
+------------+-----------------+
| 3 | 3 |
+------------+-----------------+
Jei vietoje 'abc' naudoju 'abč', rodo, jog keturi simboliai, nors, manau, turėtų rodyti 3.
set @s = convert('abč' using utf8);
select length(@s), char_length(@s);
+------------+-----------------+
| length(@s) | char_length(@s) |
+------------+-----------------+
| 6 | 4 |
+------------+-----------------+
Gal žinote kodėl?