Details
-
Type:
Bug
-
Status: Waiting for peer review
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 3.9.3
-
Fix Version/s: None
-
Component/s: Database SQL/XMLDB
Description
With MySQL 8.0 and $CFG->prefix = '' the admin/cli/mysql_collation.php script fails with "Tried to convert groups, but there was a problem. Please check the details of this table and try again.".
See also: Cannot read database.
Note also a related issue: if the database has a character such as a '.' in the name (e.g. moodle.site1) then the script fails in a similar way, i.e. ALTER DATABASE moodle.site1 ... fails but ALTER DATABASE `moodle.site1` ... will work.
To reproduce:
- Create a new Moodle database on MySQL 8.0 with character set utf8 and default collation utf8_unicode_ci.
- Install a Moodle site using this database with $CFG->prefix set to an empty string.
- Run php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
Expected results: The database is migrated to the utf8mb4 character set with utf8mb4_unicode_ci default collation.
Actual results:
{{groups - Error: Tried to convert groups, but there was a problem. Please check the details of this
table and try again.}}