Jake B.
Well-known member
- Affected version
- 2.2.12
Code:
root@web1:~# mysql --version
mysql Ver 15.1 Distrib 10.7.6-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Code:
MariaDB [***]> show full columns from xf_post;
+-------------------------+---------------------------------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------------------------+---------------------------------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
[...]
| message | mediumtext | utf8mb3_general_ci | NO | | NULL | | select,insert,update,references | |
[...]
It looks like these tables are using
utf8mb3_general_ci
while XenForo is expecting utf8_general_ci
during the conversion. From what I can tell this likely also happens on MySQL 8.0.30+ as well: https://dev.mysql.com/doc/relnotes/connector-cpp/en/news-8-0-30.htmlCollation names returned by the CollationInfo::getName() method for CollationInfo members in Collation<21> have changed. For example, Collation<21>::general_ci.getName() now returns “utf8mb3_general_ci” instead of “utf8_general_ci”.
It seems applying this patch resolves the issue:
Diff:
diff --git a/src/XF/Cli/Command/ConvertUtf8mb4.php b/src/XF/Cli/Command/ConvertUtf8mb4.php
index fe4196eed..ea366dbb4 100644
--- a/src/XF/Cli/Command/ConvertUtf8mb4.php
+++ b/src/XF/Cli/Command/ConvertUtf8mb4.php
@@ -63,7 +63,7 @@ class ConvertUtf8mb4 extends Command
continue;
}
- if (!preg_match('/^utf8_/', $table['Collation']))
+ if (!preg_match('/^utf8_/', $table['Collation']) && !preg_match('/^utf8mb3_/', $table['Collation']))
{
continue;
}