Running with an out-of-date MySQL version in MW 1.39 emits:
MediaWiki 1.39.0-alpha Updater Your composer.lock file is up to date with current dependencies! ⧼config-mysql-old⧽
Note that the helpful status message which tells you what version of MySql/MariaDB you *should* be running is omitted.
What is expected is something like:
MediaWiki 1.39.0-alpha Updater Your composer.lock file is up to date with current dependencies! MySQL 16.99.0 or later is required. You have 10.5.15-MariaDB-0+deb11u1.
(You can test this by changing $minimumVersion in includes/installer/MysqlInstaller.php to something ridiculously high.
The root cause seem to be the fact that $wgMessagesDirs is updated to point to the error messages used by the installer/updater (T206765: config-mysql-old not being substituted by update.php) but the LocalisationCache gets passed the value of $wgMessagesDirs in its ServiceOptions. Thus we need to reset the LocalisationCache (as well as the LanguageFactory, which holds a reference to the LocalisationCache) in order to get it to pick up the new value of $wgMessagesDirs.