Keep collations at utf8mb4_general_ci going forward: functions.php now ends by calling databaseConnectionCollation, which runs SET collation_connection = 'utf8mb4_general_ci' on the connection config.php opened, so a string the server makes itself, CAST(x AS CHAR) for one, matches the tables where on MySQL 8 it came out utf8mb4_0900_ai_ci and failed beside a column with Illegal mix of collations, on a new install as much as an upgraded one; only the collation is set and not the character set, no SET NAMES and no mysqli_set_charset, because on a server that defaults to latin1 the connection has always been latin1 and changing it shows every accented letter already stored as two wrong ones, where setting collation_connection alone leaves what is stored and what is stored after the same; admin/database_updates.php calls databaseCollationRepair after a run that applied at least one database update and finished, so a table a migration creates without a COLLATE is given the collation db.sql has in the same run, with what it changed and what it could not going to App Logs and to the output of scripts/update_cli.php, a table it cannot change left as it was and never failing the update, and a run that stops at a failed migration leaving this for the run that finishes; run on MySQL 8.0 and MariaDB 10.11, on a latin1 server default and through update_cli.php --update_db with a migration written as 2.4.1 was; CONTRIBUTING.md and the 26.11.7 changelog section say so

This commit is contained in:
johnnyq
2026-11-11 20:52:46 -05:00
parent bce68aac6a
commit 69fd43051f
6 changed files with 84 additions and 1 deletions

View File

@@ -107,3 +107,7 @@ require_once __DIR__ . '/functions/settings.php';
require_once __DIR__ . '/functions/mail_queue.php';
require_once __DIR__ . '/functions/managed.php';
require_once __DIR__ . '/functions/demo.php';
// The connection config.php opened takes the collation the tables have, so that a string the
// server makes (CAST(x AS CHAR), say) matches them - functions/database_collation.php
databaseConnectionCollation();