mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
fix[installer]: improve database version retrieval to avoid incorrect information
This commit is contained in:
@@ -92,7 +92,15 @@ class Database {
|
||||
throw new Exception(__("Database is not empty."));
|
||||
}
|
||||
|
||||
$mysql_version = $link->server_info;
|
||||
$version_query = $link->query("SELECT VERSION() as version")->fetch_assoc(); // $link->server_info sometimes returns wrong version or additional (in this case unnecessary) information, e.g. 5.5.5-10.3.29-MariaDB-0+deb10u1
|
||||
if (!$version_query) {
|
||||
throw new Exception(__("Unable to get Database version: ") . $link->error);
|
||||
}
|
||||
if (!isset($version_query['version'])) {
|
||||
throw new Exception(__("Database version could not be retrieved."));
|
||||
}
|
||||
$mysql_version = $version_query['version'];
|
||||
|
||||
|
||||
$link->close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user