Skip to content

Commit 47cf6c9

Browse files
committed
Use "utf8mb4_0900_ai_ci" as the default collation, as MySQL 8+ does
1 parent fa10497 commit 47cf6c9

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

wp-includes/sqlite-ast/class-wp-sqlite-configurator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public function ensure_schemata_data(): void {
147147
VALUES (?, ?, ?) ON CONFLICT(SCHEMA_NAME) DO NOTHING',
148148
$this->driver->get_connection()->quote_identifier( $schemata_table )
149149
),
150+
// The "INFORMATION_SCHEMA" database stays on "utf8mb3" even in MySQL 8 and 9.
150151
array( 'information_schema', 'utf8mb3', 'utf8mb3_general_ci' )
151152
);
152153

@@ -190,6 +191,8 @@ public function ensure_schemata_data(): void {
190191
'INSERT INTO %s (SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME) VALUES (?, ?, ?)',
191192
$this->driver->get_connection()->quote_identifier( $schemata_table )
192193
),
194+
// @TODO: This should probably be version-dependent.
195+
// Before MySQL 8, the default was different.
193196
array( $db_name, 'utf8mb4', 'utf8mb4_0900_ai_ci' )
194197
);
195198
}

wp-includes/sqlite-ast/class-wp-sqlite-information-schema-builder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ class WP_SQLite_Information_Schema_Builder {
232232
'utf16le' => 'utf16le_general_ci',
233233
'utf32' => 'utf32_general_ci',
234234
'utf8' => 'utf8_general_ci',
235-
'utf8mb4' => 'utf8mb4_general_ci', // @TODO: From MySQL 8.0.1, this is utf8mb4_0900_ai_ci.
235+
'utf8mb4' => 'utf8mb4_0900_ai_ci', // @TODO: This should probably be version-dependent.
236+
// Before MySQL 8, the default was different.
236237
);
237238

238239
/**

0 commit comments

Comments
 (0)