diff --git a/libraries/DatabaseInterface.php b/libraries/DatabaseInterface.php index 114132ee9c..b394b01b43 100644 --- a/libraries/DatabaseInterface.php +++ b/libraries/DatabaseInterface.php @@ -871,7 +871,8 @@ class DatabaseInterface SUM(t.INDEX_LENGTH) AS SCHEMA_INDEX_LENGTH, SUM(t.DATA_LENGTH + t.INDEX_LENGTH) AS SCHEMA_LENGTH, - SUM(t.DATA_FREE) AS SCHEMA_DATA_FREE'; + SUM(IF(t.ENGINE <> \'InnoDB\', t.DATA_FREE, 0)) + AS SCHEMA_DATA_FREE'; } $sql .= ' FROM `information_schema`.SCHEMATA s'; diff --git a/libraries/controllers/server/ServerDatabasesController.php b/libraries/controllers/server/ServerDatabasesController.php index a8e2a46f2c..29db80d5c8 100644 --- a/libraries/controllers/server/ServerDatabasesController.php +++ b/libraries/controllers/server/ServerDatabasesController.php @@ -357,9 +357,11 @@ class ServerDatabasesController extends Controller 'format' => 'byte', 'footer' => 0, ); - // At this point we were preparing the display of Overhead using DATA_FREE - // but its content does not represent the real overhead in the case - // of InnoDB + $column_order['SCHEMA_DATA_FREE'] = array( + 'disp_name' => __('Overhead'), + 'format' => 'byte', + 'footer' => 0, + ); return $column_order; } diff --git a/test/classes/controllers/ServerDatabasesControllerTest.php b/test/classes/controllers/ServerDatabasesControllerTest.php index 11b583067f..3c7984a3d0 100644 --- a/test/classes/controllers/ServerDatabasesControllerTest.php +++ b/test/classes/controllers/ServerDatabasesControllerTest.php @@ -311,6 +311,11 @@ class ServerDatabasesControllerTest extends PMATestCase 'disp_name' => __('Total'), 'format' => 'byte', 'footer' => 0 + ), + 'SCHEMA_DATA_FREE' => array( + 'disp_name' => __('Overhead'), + 'format' => 'byte', + 'footer' => 0 ) ), $method->invoke($ctrl)