Skip to content

Commit

Permalink
fixing display of DB Size in MySQL. Fixes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
vincib committed Jan 18, 2016
1 parent 8e1e99b commit 1b61e78
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bureau/class/m_mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,12 @@ function restore($file, $stdout, $id) {
* @access private
*/
function get_db_size($dbname) {
global $db;

$this->dbus->query("SHOW TABLE STATUS FROM `$dbname`;");
$size = 0;
while ($db->next_record()) {
$size += $db->f('Data_length') + $db->f('Index_length');
if ($db->f('Engine') != 'InnoDB') {
$size += $db->f('Data_free');
while ($this->dbus->next_record()) {
$size += $this->dbus->f('Data_length') + $this->dbus->f('Index_length');
if ($this->dbus->f('Engine') != 'InnoDB') {
$size += $this->dbus->f('Data_free');
}
}
return $size;
Expand Down

0 comments on commit 1b61e78

Please sign in to comment.