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. 1228823 fiddles created (16661 in the last week).

select version();
version()
5.6.48
 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 a (b) VALUES ('xxx'), ('yyyyy'), ('zzzzzzzzzz');
 hidden batch(es)


-- -- AS expected -- 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 a (b) VALUES ('あ A い I う U え E お O.'), -- 20 characters AFAICS ('想看什頭清只傷精,中美觀的接委主們認可易畫等助海因'); -- 25 characters AFAICS
 hidden batch(es)


-- -- NOT as expected -- 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)