Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
In #3089902: "Azure Database for MySQL server" reports wrong database version we added
protected function getServerVersion(): string {
static $server_version;
if (!$server_version) {
$server_version = $this->connection->query('SELECT VERSION()')->fetchColumn();
}
return $server_version;
}
@neclimdul rightly points out that if a database connects to mutliple mysql databases of different versions this potentially could cause you problems.
Proposed resolution
Make it a private class property. Original this was inlined as a static because having to select the server version from the database and not get it from PDO is entirely caused by proxy sql services reporting incorrect versions and it felt wrong to add class properties to work around there bugs - but now we've introduced bugs of our own :(
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
Comment | File | Size | Author |
---|---|---|---|
#3 | 3186999-2.patch | 1.76 KB | alexpott |
Comments
Comment #3
alexpottThis was reported by @neclimdul.
Comment #4
longwaveRationale makes sense, I guess the presence of
runTestsInSeparateProcesses
should be a code smell that there might be some unexpected side effects.Comment #5
neclimdulYeah, the annotation was the smell then migrate was the concern. You guys rock +1 RTBC. Thanks so much.
Comment #8
catchCommitted/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!