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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2012-07-17 07:16:52 +0400
committermattpiwik <matthieu.aubry@gmail.com>2012-07-17 07:16:52 +0400
commit165f14bdfa5361c82339f40c53f8c0838f3387b8 (patch)
treead7cb4234e52ee36b8f9b5925f6fdc5c71e76d7b /plugins/DBStats/MySQLMetadataProvider.php
parent75b55655eab0095e6edd8b8d186f0d15f4a1d6db (diff)
Fix Warning: Division by zero in /vhosts/piwik/html-8080/plugins/DBStats/MySQLMetadataProvider.php on line 303
git-svn-id: http://dev.piwik.org/svn/trunk@6514 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/DBStats/MySQLMetadataProvider.php')
-rwxr-xr-xplugins/DBStats/MySQLMetadataProvider.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/DBStats/MySQLMetadataProvider.php b/plugins/DBStats/MySQLMetadataProvider.php
index 53ec8c3324..9ac6243373 100755
--- a/plugins/DBStats/MySQLMetadataProvider.php
+++ b/plugins/DBStats/MySQLMetadataProvider.php
@@ -298,9 +298,12 @@ class Piwik_DBStats_MySQLMetadataProvider
$fixedSizeColumnLength += $this->sizeOfMySQLColumn($columnType);
}
}
-
// calculate the average row size
- $avgRowSize = $status['Index_length'] / $status['Rows'] + $fixedSizeColumnLength;
+ if($status['Rows'] == 0) {
+ $avgRowSize = 0;
+ } else {
+ $avgRowSize = $status['Index_length'] / $status['Rows'] + $fixedSizeColumnLength;
+ }
// calculate the row set's size
return $avgRowSize * $row_count + $blob_size + $name_size;