clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1228830 fiddles created (16646 in the last week).

select version();
version()
5.6.48
 hidden batch(es)


CREATE TABLE x ( i INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, y VARCHAR (255) ) ENGINE = InnoDB DEFAULT CHARSET ASCII;
 hidden batch(es)


CREATE TABLE a ( i INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR (255) ) ENGINE = InnoDB DEFAULT CHARSET utf8mb4;
 hidden batch(es)


INSERT INTO x (y) VALUES ('xxx'), ('yyyyy'), ('zzzzzzzzzz');
 hidden batch(es)


INSERT INTO a (b) VALUES ('xxx'), ('yyyyy'), ('zzzzzzzzzz');
 hidden batch(es)


SELECT LENGTH(y) AS x_len_1, CHAR_LENGTH(y) AS cx_len_1 FROM x;
x_len_1 cx_len_1
3 3
5 5
10 10
 hidden batch(es)


SELECT LENGTH(b) AS a_len_1, CHAR_LENGTH(b) AS ca_len_1 FROM a;
a_len_1 ca_len_1
3 3
5 5
10 10
 hidden batch(es)


INSERT INTO x (y) VALUES ('あ A い I う U え E お O.');
Incorrect string value: '\xE3\x81\x82 A ...' for column 'y' at row 1
 hidden batch(es)


INSERT INTO a (b) VALUES ('あ A い I う U え E お O.'), ('想看什頭清只傷精,中美觀的接委主們認可易畫等助海因');
 hidden batch(es)


SELECT y AS y_str, LENGTH(y) AS y_byte_len, CHAR_LENGTH(y) AS y_char_len FROM x;
y_str y_byte_len y_char_len
xxx 3 3
yyyyy 5 5
zzzzzzzzzz 10 10
 hidden batch(es)


SELECT b AS b_str, LENGTH(b) AS b_byte_len, CHAR_LENGTH(b) AS b_char_len FROM a;
b_str b_byte_len b_char_len
xxx 3 3
yyyyy 5 5
zzzzzzzzzz 10 10
あ A い I う U え E お O. 48 30
想看什頭清只傷精,中美觀的接委主們認可易畫等助海因 163 75
 hidden batch(es)


SET @s = CONVERT('MySQL String Length' USING utf8); SELECT CHAR_LENGTH(@s), LENGTH(@s);
CHAR_LENGTH(@s) LENGTH(@s)
19 19
 hidden batch(es)


SET @s = CONVERT('あ A い I う U え E お O.' USING utf8); SELECT CHAR_LENGTH(@s), LENGTH(@s);
CHAR_LENGTH(@s) LENGTH(@s)
30 48
 hidden batch(es)


SET @a = 'あ A い I う U え E お O.'; SET @b = CONVERT('あ A い I う U え E お O.' USING utf8; SET @c = CONVERT('あ A い I う U え E お O.' USING utf8mb4; SELECT 'あ A い I う U え E お O.', LENGTH('あ A い I う U え E お O.') AS byte_len, CHAR_LENGTH('あ A い I う U え E お O.') AS char_len, LENGTH(@b) AS byte_len_utf8, CHAR_LENGTH(@b) AS char_len_utf8, LENGTH(@c) AS char_len_utfmb4, CHAR_LENGTH(@c) AS char_len_utf8mb4);
 hidden batch(es)