diff --git a/core/Db.php b/core/Db.php index afa13ab2659..c0b58bfecd2 100644 --- a/core/Db.php +++ b/core/Db.php @@ -472,6 +472,10 @@ public static function deleteAllRows($table, $where, $orderBy, $maxRowsPerQuery */ public static function optimizeTables($tables, $force = false) { + if (empty($tables)) { + return false; + } + $tables = !is_array($tables) ? [$tables] : $tables; return Schema::getInstance()->optimizeTables($tables, (bool) $force); } diff --git a/tests/PHPUnit/Integration/Db/Schema/TiDbTest.php b/tests/PHPUnit/Integration/Db/Schema/TidbTest.php similarity index 97% rename from tests/PHPUnit/Integration/Db/Schema/TiDbTest.php rename to tests/PHPUnit/Integration/Db/Schema/TidbTest.php index 1103a202d92..87fe17dc382 100644 --- a/tests/PHPUnit/Integration/Db/Schema/TiDbTest.php +++ b/tests/PHPUnit/Integration/Db/Schema/TidbTest.php @@ -13,7 +13,7 @@ use Piwik\Db; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -class TiDbTest extends IntegrationTestCase +class TidbTest extends IntegrationTestCase { public function testIsOptimizeInnoDBSupportedReturnsCorrectResult() {