Skip to content

MySQL: Multibyte Collation Support

  • Support collations with an ID above 255 (so 2 bytes instead of 1)
  • Update MySQL Collations to 8.0.36. Note that this contains the renaming of utf8 to utf8mb3. This is because utf8 is a deprecated alias for utf8mb3. I have tried to keep the original formatting to reduce the diff size.
  • Rename from Charset to Collation. Both exist in MySQL with a 1 to many relation.

Code to trigger a connection with a multibyte collation:

import mysql.connector
c = mysql.connector.connect(
    host='127.0.0.1',
    port=3306,
    user="test",
    password="test",
    collation="utf8mb4_ja_0900_as_cs",
    ssl_disabled=True
)
cur = c.cursor()
cur.execute("SHOW SESSION VARIABLES LIKE '%collation%'");
for col in cur:
    print(col)
cur.close()
c.close()

With this PR: image

The protocol docs don't seem to match the actual behavior. I've submitted https://github.com/mysql/mysql-server/pull/541 to update that.

Edited by Daniël van Eeden

Merge request reports