Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/serverinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2020-12-14 11:15:30 +0300
committerGitHub <noreply@github.com>2020-12-14 11:15:30 +0300
commit2810a15ad70bbd94349914b424cd8c36046e35c9 (patch)
tree15b54819834069a229dbd959b60416e49d3a16a9
parent2de129beef12833e7b64b0ae0e9bd911ff064e27 (diff)
parent6814c0f7f37e5374d9e279827b5a77a36dfde269 (diff)
Merge pull request #262 from nextcloud/backport/261/stable20v20.0.4
[stable20] Fix MySQL database size calculation
-rw-r--r--lib/DatabaseStatistics.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/DatabaseStatistics.php b/lib/DatabaseStatistics.php
index afdd039..a955f7f 100644
--- a/lib/DatabaseStatistics.php
+++ b/lib/DatabaseStatistics.php
@@ -95,12 +95,13 @@ class DatabaseStatistics {
// This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0
switch ($this->config->getSystemValue('dbtype')) {
case 'mysql':
+ $mysqlEngine = ['MyISAM', 'InnoDB', 'Aria'];
$db_name = $this->config->getSystemValue('dbname');
$sql = 'SHOW TABLE STATUS FROM `' . $db_name . '`';
$result = $this->connection->executeQuery($sql);
$database_size = 0;
while ($row = $result->fetch()) {
- if ((isset($row['Type']) && $row['Type'] !== 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] === 'MyISAM' || $row['Engine'] === 'InnoDB'))) {
+ if (isset($row['Engine']) && in_array($row['Engine'], $mysqlEngine)) {
$database_size += $row['Data_length'] + $row['Index_length'];
}
}