utf8mb4, iOS smiles and 4 bytes symbols bugs

  • Filter
  • Time
  • Show
Clear All
new posts

  • utf8mb4, iOS smiles and 4 bytes symbols bugs

    Hi. I have running Percona Server (5.5.33-31.1 - Percona Server (GPL), Release rel31.1, Revision 2) on my Hostgator hosting (this guys no hurry to any updates) and because hosting is webshared i can't update Percona by himself.

    I install Wordpress (without plugins and other stuff) and I can't save any 4 bytes symbol (iOS smiles) in DB. I try to insert it manually in PHP My Admin and that I see:

    Warning: #1366 Incorrect string value: '\xF0\x9F\x98\xA1'
    I switch my DB from utf8_general_ci to utf8mb4_general_ci and now I can save 4 bytes symbols, but I get another errors — i can't create some tables. Example:

    CREATE TABLE IF NOT EXISTS `wp_domain_mapping` (
    `id` bigint(20) NOT NULL auto_increment,
    `blog_id` bigint(20) NOT NULL,
    `domain` varchar(255) NOT NULL,
    `active` tinyint(4) default '1',
    PRIMARY KEY (`id`),
    KEY `blog_id` (`blog_id`,`domain`,`active`)
    ​I try to execute this query manually in PHP My Admin and:

    #1071 - Specified key was too long; max key length is 1000 bytes
    How to fix this and what version of Percona Server don't have this errors (bugs)?

    Maybe you suggest another huge bugs of this version of Percona and then I can convince administrators to update the server?

    More info about smiles: stackoverflow.com/questions/9509668/iphone-emoticons-insert-into-mysql-but-become-blank-value

  • #2
    Why does this character (U+1F621) even get encoded to 4 bytes? 3 would be enough. Who does the encoding?


    • #3
      Damn, forget what I said. The 4 bytes are actually required and correct.