diff --git a/api-ref/source/samples/databases-create-request.json b/api-ref/source/samples/databases-create-request.json index 215ee99beb..ed45f1e7b8 100644 --- a/api-ref/source/samples/databases-create-request.json +++ b/api-ref/source/samples/databases-create-request.json @@ -1,8 +1,8 @@ { "databases": [ { - "character_set": "utf8", - "collate": "utf8_general_ci", + "character_set": "utf8mb3", + "collate": "utf8mb3_general_ci", "name": "databaseA" }, { diff --git a/api-ref/source/samples/instance-create-request.json b/api-ref/source/samples/instance-create-request.json index 7e4b3e85d4..1c15b4bab8 100644 --- a/api-ref/source/samples/instance-create-request.json +++ b/api-ref/source/samples/instance-create-request.json @@ -10,8 +10,8 @@ }, "databases": [ { - "character_set": "utf8", - "collate": "utf8_general_ci", + "character_set": "utf8mb3", + "collate": "utf8mb3_general_ci", "name": "sampledb" }, { diff --git a/releasenotes/notes/mysql8-6a81a8498ee2c229.yaml b/releasenotes/notes/mysql8-6a81a8498ee2c229.yaml new file mode 100644 index 0000000000..07b71886b7 --- /dev/null +++ b/releasenotes/notes/mysql8-6a81a8498ee2c229.yaml @@ -0,0 +1,2 @@ +fixes: + - explicitly specify utf8mb3 as character set for mysql diff --git a/trove/common/db/mysql/data.py b/trove/common/db/mysql/data.py index 9a3b754dc8..69f6522c0b 100644 --- a/trove/common/db/mysql/data.py +++ b/trove/common/db/mysql/data.py @@ -79,6 +79,7 @@ charset = {"big5": ["big5_chinese_ci", "big5_bin"], "utf8_general_mysql500_ci" ], "utf8mb4": ["utf8mb4_0900_ai_ci"], + "utf8mb3": ["utf8mb3_general_ci"], "ucs2": ["ucs2_general_ci", "ucs2_bin", "ucs2_unicode_ci", @@ -268,6 +269,7 @@ collation = {"big5_chinese_ci": "big5", "armscii8_general_ci": "armscii8", "armscii8_bin": "armscii8", "utf8_general_ci": "utf8", + "utf8mb3_general_ci": "utf8mb3", "utf8_bin": "utf8", "utf8_unicode_ci": "utf8", "utf8_icelandic_ci": "utf8", diff --git a/trove/common/db/mysql/models.py b/trove/common/db/mysql/models.py index b9df7c58e2..23a1aa5f0a 100644 --- a/trove/common/db/mysql/models.py +++ b/trove/common/db/mysql/models.py @@ -29,8 +29,8 @@ class MySQLSchema(models.DatastoreSchema): """Represents a MySQL database and its properties.""" # Defaults - __charset__ = "utf8" - __collation__ = "utf8_general_ci" + __charset__ = "utf8mb3" + __collation__ = "utf8mb3_general_ci" dbname = re.compile(r"^[A-Za-z0-9_-]+[\s\?\#\@]*[A-Za-z0-9_-]+$") # Complete list of acceptable values diff --git a/trove/tests/api/instances.py b/trove/tests/api/instances.py index 7f0f7887f4..ee21ce43ea 100644 --- a/trove/tests/api/instances.py +++ b/trove/tests/api/instances.py @@ -1093,8 +1093,8 @@ class TestInstanceMgmtInfo(object): 'databases': [ { 'name': 'db2', - 'character_set': 'utf8', - 'collate': 'utf8_general_ci', + 'character_set': 'utf8mb3', + 'collate': 'utf8mb3_general_ci', }, { 'name': 'firstdb',