title: Inserting 4-byte unicode characters into MySQL/MariaDB
body: <p>When attempting to insert  (for example, which is a 4-byte unicode char), both MySQL (5.7) and MariaDB (10.2/10.3/10.4) give the same error:</p>
  
  <p><code>Incorrect string value: '\xF0\x9F\x92\xA9'</code></p>
  
  <p>The statement:</p>
  
  <pre><code>mysql&gt; insert into bob (test) values ('');
  </code></pre>
  
  <p>Here's my database's charset/collation:</p>
  
  <pre><code>mysql&gt; select @@collation_database;                                                                     +----------------------+
  | @@collation_database |
  +----------------------+
  | utf8mb4_unicode_ci   |
  +----------------------+
  1 row in set (0.00 sec)
  
  mysql&gt; SELECT @@character_set_database;                                                                 +--------------------------+
  | @@character_set_database |
  +--------------------------+
  | utf8mb4                  |
  +--------------------------+
  1 row in set (0.00 sec)
  </code></pre>
  
  <p>The server's character set:</p>
  
  <pre><code>mysql&gt; show global variables like '%character_set_server%'\G;                                           *************************** 1. row ***************************
  Variable_name: character_set_server
          Value: utf8mb4
  </code></pre>
  
  <p>The table:</p>
  
  <pre><code>create table bob ( `test` TEXT NOT NULL );
  </code></pre>
  
  <pre><code>mysql&gt; SHOW FULL COLUMNS FROM bob;
  +-------+------+--------------------+------+-----+---------+-------+---------------------------------+---------+
  | Field | Type | Collation          | Null | Key | Default | Extra | Privileges                      | Comment |
  +-------+------+--------------------+------+-----+---------+-------+---------------------------------+---------+
  | test  | text | utf8mb4_unicode_ci | NO   |     | NULL    |       | select,insert,update,references |         |
  +-------+------+--------------------+------+-----+---------+-------+---------------------------------+---------+
  1 row in set (0.00 sec)
  </code></pre>
  
  <p>Can anyone point me in the right direction?</p>