Upgrade from 22.04.2 to 22.10 failing with column character encoding mismatch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Upgrade from Mahara 22.04.2 to 22.10 fails during ensure_
We did not manually change character encodings on the database or tables. We followed the normal upgrade procedure from version to version. Did a prior upgrade silently failed (maybe trying to migrate the indexes of some tables), leaving us with a mix and match of utf8/utf8mb4 tables and columns?
Did a mysqldump fo the current database schema, some tables are in utf8:
CREATE TABLE `config` (
`field` varchar(255) NOT NULL,
`value` longtext,
PRIMARY KEY (`field`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
while others are in utf8mb4:
CREATE TABLE `module_
`id` bigint(10) NOT NULL AUTO_INCREMENT,
`groupid` bigint(10) NOT NULL,
`ownertype` varchar(20) COLLATE utf8mb4_bin NOT NULL,
`ownerid` bigint(10) NOT NULL,
`portfolioele
`portfolioele
`portfolioele
`submissiondate` datetime DEFAULT NULL,
`status` tinyint(2) NOT NULL,
`taskid` bigint(10) DEFAULT NULL,
`tasktitle` text COLLATE utf8mb4_bin,
`exportarchiveid` bigint(10) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `modusubm_exp_uix` (`exportarchive
KEY `modusubm_gro_ix` (`groupid`),
KEY `modusubm_
KEY `modusubm_tas_ix` (`taskid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=
The database was created years ago (prior to the move to utf8mb4) with this command:
create database mahara character set UTF8;
But now shows:
MariaDB [mahara]> SELECT @@character_
+------
| @@character_
+------
| utf8mb4 | utf8mb4_bin |
+------
We also filed another bug (#2002038) for the fresh install of 22.10 in a fully utf8mb4 compliant database.
Bug #1912492 contains instructions on how to change your collation on an existing database.